11.01.2012, 18:54
pawn Код:
CMD:es(playerid, params[])
{
new ID,message[128],str[128],pname[MAX_PLAYER_NAME],reciever[MAX_PLAYER_NAME];
if(sscanf(params,"us[256]",ID,message)) return SendClientMessage(playerid,COLOR_RED,""KASUTUS" /es <playername/id> <sхnum>");
if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"ERROR: Vale kasutaja!");
if(ID == playerid) return SendClientMessage(playerid,COLOR_RED,"ERROR: Sa ei saa iseendale erasхnumit saata!");
GetPlayerName(ID,reciever,sizeof(reciever));
GetPlayerName(playerid,pname,sizeof(pname));
if(togglepm[ID] == 0)
{
format(str,sizeof(str),"%s proovis sulle saata "KOLLANE"erasхnumit.",pname);
SendClientMessage(ID,COLOR_RED,str);
return SendClientMessage(playerid,COLOR_RED,"ERROR: Sellel kasutajal on erasхnumid vдlja lьlitatud.");
}
format(str,sizeof(str),"-> %s(ID:%d): %s",reciever,ID,message);
SendClientMessage(playerid,COLOR_YELLOW,str);
format(str,sizeof(str),"%s(ID:%d) <-: %s",pname,playerid,message);
SendClientMessage(ID,COLOR_YELLOW,str);
PlayerPlaySound(ID,1085,0,0,0);
return 1;
}