SA-MP Forums Archive
/Pm cmd problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /Pm cmd problem (/showthread.php?tid=317841)



/Pm cmd problem - Face9000 - 12.02.2012

pawn Код:
CMD:pm(playerid, params[])
{
    new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
    if(sscanf(params, "us", id, str2))
    {
        SendClientMessage(playerid, 0xFF0000FF, "Usage: /pm <id> <message>");
        return 1;
    }
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
    if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!")
    GetPlayerName(playerid, Name1, sizeof(Name1));
    GetPlayerName(id, Name2, sizeof(Name2));
    format(str, sizeof(str), "PM To %s(ID %d): %s", Name2, id, str2);
    SendClientMessage(playerid, 0xFF0000FF, str);
    format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2);
    SendClientMessage(id, 0xFF0000FF, str);
    return 1;
}
error 001: expected token: ";", but found "-identifier-"




Re: /Pm cmd problem - ReneG - 12.02.2012

pawn Код:
if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!");
You forgot to add a ; at the end of SendClientMessage


Re: /Pm cmd problem - Face9000 - 12.02.2012

Oh lol,thanks.