23.12.2017, 06:14
Код:
CMD:pm(playerid,params[]) { new id, gMessage[128],Message[128],iName[MAX_PLAYER_NAME], pmName[MAX_PLAYER_NAME]; if (sscanf(params, "is",id,gMessage)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /pm <ID> <Message>"); if(!IsPlayerConnected(id)) { SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/pm : Bad player ID"); return 1; } if(playerid == id) { SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"You cannot PM yourself"); return 1; } if(ServerInfo[ReadPMs] == 1 && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) { new string[128],recievername[MAX_PLAYER_NAME]; GetPlayerName(playerid, string, sizeof(string)); GetPlayerName(id, recievername, sizeof(recievername)); format(string, sizeof(string), "***PM: %s To %s: %s", string, recievername, gMessage); for (new a = 0; a < MAX_PLAYERS; a++) if ((PlayerInfo[a][Level] >= ServerInfo[MaxAdminLevel]) && a != playerid) SendClientMessage(a, grey, string); } if(PlayerInfo[playerid][Muted] == 1) { new string[128]; PlayerInfo[playerid][MuteWarnings]++; if(PlayerInfo[playerid][MuteWarnings] < ServerInfo[MaxMuteWarnings]) { format(string, sizeof(string),"WARNING: You are muted, if you continue to speak you will be kicked (Warning: %d/%d)", PlayerInfo[playerid][MuteWarnings], ServerInfo[MaxMuteWarnings] ); SendClientMessage(playerid,red,string); } else { SendClientMessage(playerid,red,"You have been warned! Now you have been kicked"); GetPlayerName(playerid, string, sizeof(string)); format(string, sizeof(string),"%s [ID %d] Kicked for exceeding mute warnings", string, playerid); SendClientMessageToAll(grey,string); SaveToFile("KickLog",string); Kick(playerid); } return 0; } GetPlayerName(id,iName,sizeof(iName)); GetPlayerName(playerid,pmName,sizeof(pmName)); format(Message,sizeof(Message),">> %s(%d): %s",iName,id,gMessage); SendClientMessage(playerid,PM_OUTGOING_COLOR,Message); format(Message,sizeof(Message),"** %s(%d): %s",pmName,playerid,gMessage); SendClientMessage(id,PM_INCOMING_COLOR,Message); PlayerPlaySound(id,1085,0.0,0.0,0.0); printf("PM: %s",Message); return 1; }
i mean,i want reply last send pm using /r
coz few player complaint coz my server dont have /r