29.08.2013, 10:23
pawn Код:
CMD:pm(playerid, params[]) // PM ( Para todos os players )
{
new id;
new string[128];
new string1[128];
new msg[128];
new playername[MAX_PLAYER_NAME];
new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(id, playername2, sizeof(playername2));
if(sscanf(params, "us", id, msg)) return SendClientMessage(playerid, INFO,"[ USO: ] /pm [playerid] [mensagem]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, FAIL,"[ ERRO: ] O player nгo estб conectado.");
format(string, sizeof(string), "PM enviada para %s: %s", playername2, msg);
SendClientMessage(playerid, INFO2, string);
format(string1, sizeof(string1), "PM recebida de %s: %s", playername, msg);
SendClientMessage(id, INFO3, string1);
return 1;
}
Includes:
ZCMD
sscanf