SA-MP Forums Archive
Someone, help me to make PM command? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Someone, help me to make PM command? (/showthread.php?tid=244290)



Someone, help me to make PM command? - kemppis_ - 26.03.2011

How to make PM command? please help me :S


Re: Someone, help me to make PM command? - Jochemd - 26.03.2011

Use ZCMD/DCMD and sscanf. Then sscanf the ID of the player you want to send and the text. Format the text into a string, then send.


Re: Someone, help me to make PM command? - kemppis_ - 26.03.2011

Hey!

pawn Код:
COMMAND:pm(playerid, params[])
{
    new text;
    new pID;
    if(!sscanf(params, "ds", pID, text))
    {
        if(!IsPlayerConnected(pID))
        {
            SendClientMessage(playerid,0xFFFFFF,"Player is not in the server!");
        }else
        {
            new name[MAX_PLAYER_NAME];
            new string[128];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string), "0xFFFFFF [PM]%s say: %s ", name, text);
            SendClientMessage(pID,playerid,string);
            return 1;
        }
    }
    else return SendClientMessage(playerid, 0xFFFFFF, "USAGE: /pm [id] [Text]");
    return true;
}
I use this now, and when i type exmpl: "/pm 4 hello!"

it says,
[PM]Kemppis_ says: hello!
Unknown command!

why this Unknown Command??


Re: Someone, help me to make PM command? - -Rebel Son- - 26.03.2011

Just pull the pm command out of base.pawn


Re: Someone, help me to make PM command? - kemppis_ - 26.03.2011

what do you mean?


Re: Someone, help me to make PM command? - -Rebel Son- - 26.03.2011

open base.pwn in the filterscripts folder, it has a PM Command


Re: Someone, help me to make PM command? - kemppis_ - 26.03.2011

Still the same problem :/


Re: Someone, help me to make PM command? - kemppis_ - 27.03.2011

c'mon! someone help mee


Re: Someone, help me to make PM command? - MadeMan - 27.03.2011

https://sampwiki.blast.hk/wiki/OnPlayerPrivmsg


Re: Someone, help me to make PM command? - Hoxxy - 27.03.2011

OnPlayerPrivmsg callback was removed in SA-MP 0.3.