24 lines
628 B
Plaintext
24 lines
628 B
Plaintext
#include "inc_isdm"
|
|
|
|
string FixName(string nam)
|
|
{
|
|
string fixed = "", c;
|
|
string valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890";
|
|
int s;
|
|
for(s=0; s < GetStringLength(nam); s++) {
|
|
c = GetSubString(nam, s, 1);
|
|
//SpeakString(IntToString(FindSubString(valid, c)), TALKVOLUME_SHOUT);
|
|
if (FindSubString(valid, c) != -1) fixed += c;
|
|
}
|
|
return fixed;
|
|
}
|
|
|
|
void main()
|
|
{
|
|
object PC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, TRUE);
|
|
if (isdm(PC) == TRUE || GetTag(OBJECT_SELF) == "d_" + FixName(GetPCPlayerName(PC))) {
|
|
ActionOpenDoor(OBJECT_SELF);
|
|
}
|
|
}
|
|
|