27.06.2016, 02:09
Make a function, don't make a stock.
If you need only for this command:
By the way I don't know why you store player's name with this
instead of GetPlayerName(...).
If you need only for this command:
PHP код:
CMD:pm(playerid,params[])
{
if(Player[playerid][Mute] == true) return SendClientMessage(playerid, -1, "{FFFFFF}Error: {0099FF}You are muted, STFU.");
new recieverid, text[180];
#if PLUGINS == 1
if(sscanf(params,"is[180]",recieverid, text)) return SendClientMessage(playerid,-1,"{FFFFFF}USAGE: {0099FF}/pm [Player ID] [Text]");
#else
if(sscanf(params,"is",recieverid, text)) return SendClientMessage(playerid,-1,"{FFFFFF}USAGE: {0099FF}/pm [Player ID] [Text]");
#endif
if(!IsPlayerConnected(recieverid)) return SendClientMessage(playerid,-1,"{FFFFFF}Error: {0099FF}Player not connected.");
new String[180];
format(String,sizeof(String),"{66CC00}*** PM from %s (%d): %s",Player[playerid][Name], playerid, text);
SendClientMessage(recieverid,-1,String);
format(String,sizeof(String),"{66CC00}*** PM to %s (%d): %s", Player[recieverid][Name], recieverid, text);
SendClientMessage(playerid,-1,String);
PlayerPlaySound(recieverid,1054,0,0,0);
for(new i; i<MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(!IsPlayerAdmin(i)) continue;
format(String,sizeof(String),"{66CC00}*** PM from %s to %s (%d): %s",Player[playerid][Name], Player[recieverid][Name], recieverid, text);
SendClientMessage(playerid,-1,String);
}
PHP код:
Player[recieverid][Name]