23.06.2015, 11:19
pawn Код:
CMD:pm(playerid, params[])
{
new id, str[100];
if(sscanf(params, "ds[100]", id, str)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /pm [id] [message]");
if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Player is not connected");
if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "You cannot PM yourself");
if(!DND[id]) return SendClientMessage(playerid, COLOR_RED, "That player is in 'Do Not Disturb' mode!");
new str2[144];
format(str2, sizeof(str2), "PM to [%d]%s: %s", id, GetPlayerName(id), str);
SendClientMessage(playerid, COLOR_YELLOW, str);
format(str, sizeof(str), "PM from [%d]%s: %s", playerid, GetPlayerName(playerid), str);
SendClientMessage(id, COLOR_YELLOW, str);
SendClientMessage(id, -1, "Use "cyellow"/rpm [message] "cwhite"to reply to this PM");
format(str2, sizeof(str2), "PM from %s[%d] to %s[%d]: %s", GetPlayerName(playerid), playerid, GetPlayerName(id), id, str);
SendClientMessageToAll(COLOR_WHITE, str2); // SendClientMessageToAll? I don't think that's right...
LastPm[id] = playerid;
return 1;
}
DND[id]
or:
LastPm[id] = playerid;
Where 'id' is causing an out of bounds error.