01.05.2018, 10:02
PHP код:
#define scm SendClientMessage
gName(pid){
new s[24];
GetPlayerName(pid,s,24);
return s;
}
AdminMsg(color,s[]){
for (new i; i< MAX_PLAYERS; i++){
if(PlayerInfo[i][Level]>=ServerInfo[MaxAdminLevel])SendClientMessage(i,color,s);
}
return 1;
}
CMD:pm(pid,p[]) {
if(PlayerInfo[pid][Muted])return scm(pid,-1,"You are muted!");
new id,s[128];
if(sscanf(p,"us[128]",id,p))return scm(pid,-1,"USAGE: /pm <ID> <Message>");
if(!IsPlayerConnected(id)) return scm(pid,-1,"Player isn't connected!");
if(pid==id) return scm(pid,-1,"You can't pm youself!");
if(ServerInfo[ReadPMs] && PlayerInfo[pid][Level] != ServerInfo[MaxAdminLevel]){
format(s,sizeof(s),"***[PM]: %s To %s: %s",gName(pid),gName(id),p);
IRC_GroupSay(groupID,IRC_ADMINCHANNEL,s);
AdminMsg(grey,s);
}
format(s,sizeof(s),">> %s(%d): %s",gName(id),id,p);
scm(pid,PM_OUTGOING_COLOR,s);
format(s,sizeof(s),"** %s(%d): %s",gName(pid),pid,p);
scm(id,PM_INCOMING_COLOR,s);
PlayerPlaySound(id,1085,0.0,0.0,0.0);
return 1;
}