Someone, help me to make PM command?
#1

How to make PM command? please help me :S
Reply
#2

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.
Reply
#3

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??
Reply
#4

Just pull the pm command out of base.pawn
Reply
#5

what do you mean?
Reply
#6

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

Still the same problem :/
Reply
#8

c'mon! someone help mee
Reply
#9

https://sampwiki.blast.hk/wiki/OnPlayerPrivmsg
Reply
#10

OnPlayerPrivmsg callback was removed in SA-MP 0.3.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)