CMD
m(playerid, params[])
{
new stringpm[128],toid, toname[128];
if(sscanf(params, "us", toid, params)) SendClientMessage(playerid, COLOR_ORANGE, "Correct usage: /pm <id> <message>");
else if(!IsPlayerConnected(toid)) SendClientMessage(playerid, COLOR_ORANGE, "ERROR: Player not connected");
if(playerid == toid) SendClientMessage(playerid, COLOR_ORANGE, "ERROR: You cannot send a PM to yourself!");
else
{
GetPlayerName(toid, toname, sizeof(toname));
format(stringpm, sizeof(stringpm), "PM To %s(%d): %s", playername, toid, params);
SendClientMessage(playerid, COLOR_YELLOW, stringpm);
format(stringpm, sizeof(stringpm), "PM From %s(%d): %s", playername, playerid, params);
SendClientMessage(toid, COLOR_YELLOW, stringpm);
}
return 1;
}
I did this but I keep getting error:
E:\My Server\gamemodes\SARCR.pwn(596) : error 029: invalid expression, assumed zero
E:\My Server\gamemodes\SARCR.pwn(596) : error 017: undefined symbol "cmd_pm"
E:\My Server\gamemodes\SARCR.pwn(596) : error 029: invalid expression, assumed zero
E:\My Server\gamemodes\SARCR.pwn(596) : fatal error 107: too many error messages on one line