PWE_PRC8/_module/nss/chk_name.nss
Jaysyn904 ee1dc35889 Initial Commit
Initial Commit
2025-04-03 10:29:41 -04:00

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);
}
}