06.02.2018, 20:14
Quote:
The code itself isn't to bad I guess, i couldn't help but notice this.
Код:
CMD:pm(playerid, params[]) { new str[175], str2[175], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME]; if(sscanf(params, "us", id, str2)) { SendClientMessage(playerid, COLOR_ORANGE, "Usage: /pm <id> <message>"); return 1; } if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player not connected"); if(playerid == id) return SendClientMessage(playerid, COLOR_RED, "ERROR: You cannot pm yourself!"); { // This isn't needed GetPlayerName(playerid, Name1, sizeof(Name1)); GetPlayerName(id, Name2, sizeof(Name2)); format(str, sizeof(str), "PM To %s(ID %d): %s", Name2, id, str2); SendClientMessage(playerid, COLOR_ORANGE, str); PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0); format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2); SendClientMessage(id, COLOR_YELLOW, str); PlayerPlaySound(id, 1057, 0.0, 0.0, 0.0); printf(str); LastPm[id] = playerid; } // This isn't needed return 1; } |
PHP код:
if(playerid == id) return SendClientMessage(playerid, COLOR_RED, "ERROR: You cannot pm yourself!");
And gj to the creator, keep it up.