15.03.2017, 13:42
Enjoy it
PHP код:
CMD:wisper(playerid, params[])
{
new string[128],id,mess[250],giveplayer[25],sendername[25];
if(sscanf(params, "us[250]",id,mess)) return SendClientMessage(playerid, -1, "{FFFFFF}Syntax: {FFFFFF}/w <Name/Playerid> <Message>");
if(id != INVALID_PLAYER_ID)
{
if(GetDistanceBetweenPlayers(playerid,id) > 5) return SendClientMessage(playerid,-1,"{FFFFCC}This player is not near you.");
if(id == playerid) return SendClientMessage(playerid, -1,"{FFB870}You can not send a message to yourself.");
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(id, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "{00DBDB}%s whispers: %s", sendername, mess);
SendClientMessage(id, -1, string);
format(string, sizeof(string), "{00DBDB}Whisper to %s: %s", giveplayer, mess);
SendClientMessage(playerid, -1, string);
return 1;
}
}
alias:wisper("w");