12.02.2014, 20:11
pawn Код:
// STRCMP
if(strcmp(cmd, "/mp", true) == 0)
{
new id, msg[128];
if(sscanf(cmdtext, "us[128]", id, msg))
return SendClientMessage(playerid, COLOR_GRAD2, "USE: (/mp) [id] [texto]");
if(!IsPlayerConnected(id))
return SendClientMessage(playerid, COLOR_GRAD1, " Esse jogador estб off-line.");
new string[128], player[MAX_PLAYER_NAME], obj[MAX_PLAYER_NAME];
GetPlayerName(playerid, player, sizeof(player));
GetPlayerName(id, obj, sizeof(obj));
format(string, sizeof(string), "MP enviada para %s(ID: %d). Msg: %s", obj, id, msg);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "MP recebida de %s(ID: %d). Msg: %s", player, playerid, msg);
SendClientMessage(id, COLOR_YELLOW, string);
return 1;
}
// ZCMD
CMD:mp(playerid, params[])
{
if(sscanf(params, "us[128]", params[0], params[1]))
return SendClientMessage(playerid, COLOR_GRAD2, "USE: (/mp) [id] [texto]");
if(!IsPlayerConnected(params[0]))
return SendClientMessage(playerid, COLOR_GRAD1, " Esse jogador estб off-line.");
new string[128], player[MAX_PLAYER_NAME], obj[MAX_PLAYER_NAME];
GetPlayerName(playerid, player, MAX_PLAYER_NAME);
GetPlayerName(params[0], obj, MAX_PLAYER_NAME);
format(string, sizeof(string), "MP enviada para %s(ID: %d). Msg: %s", obj, params[0], params[1]);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "MP recebida de %s(ID: %d). Msg: %s", player, playerid, params[1]);
SendClientMessage(params[0], COLOR_YELLOW, string);
return 1;
}