03.03.2012, 15:04
I really cant figure out what is wrong with this code, it doesent compile any errors, but when i type ingame /pm 0 text it says server unknown command, please help.
pawn Код:
dcmd_pm(playerid, params[])
{
new id, text[128], iName[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], str[128];
if(sscanf(params, "us", id, text)) SendClientMessage(playerid, LIGHTBLUE, "USAGE: {FFFFFF}/pm [playerid] [text]");
else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, ORANGERED, "ERROR: {FFFFFF}Invalid PlayerID");
{
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid, name,sizeof(name));
format(str,sizeof(str),"PM sent %s (ID: %d): %s",iName,id,text);
SendClientMessage(playerid,YELLOW,str);
format(str,sizeof(str),"PM From %s (ID: %d): %s",name,playerid,text);
SendClientMessage(id,ORANGE,str);
PlayerPlaySound(id,1085,0.0,0.0,0.0);
printf("PM Logger: %s (From: %s) (To: %s)",str, iName, name);
}
return 1;
}