/pm bug
#1

Hello, I am pretty sure that my GM is using /pm but it says unknown command blablabla

What and where to add something in GM to make that granted simple cmd work?
Reply
#2

Open your "gm" in PAWNO and press Control+F and search for "/pm" or "pm" and then make sure its in there.
Reply
#3

Hmm...No, it is not there
Reply
#4

Then it's normal that it says Unknown Command, lol.
Reply
#5

Quote:
Originally Posted by Delux13
Посмотреть сообщение
Then it's normal that it says Unknown Command, lol.
haha yes indeed! You just expect /pm cmd when you dwl a GM
Anyone knows hot to add it? It must be something very simple right?
Reply
#6

Do you have ZCMD and sscanf? Here is your codeh:
pawn Код:
COMMAND:pm(playerid,params[]) {
    new
        name1[30],
        name2[30],
        id,
        mess[50],
        text1[128],
        text2[128],
        logtext[128];
    if(sscanf(params,"us",id,mess))
        return SendClientMessage(playerid,red,"USAGE: /pm [id] [message] - will send a private message to a player.");
    if(IsPlayerConnected(id)) {
        GetPlayerName(playerid,name1,sizeof(name1));
        GetPlayerName(id,name2,sizeof(name2));
        format(text1,sizeof(text1),"PM sent to %s.",name2);
        format(text2,sizeof(text2),"PM from %s: %s",name1,mess);
        SendClientMessage(playerid,COLOR_LIGHTGREEN,text1);
        SendClientMessage(playerid,COLOR_LIGHTGREEN,text2);
        format(logtext,sizeof(logtext),"PM from %s, to %s: %s",name1,name2,mess);
    } else {
        return SendClientMessage(playerid,red,"Invalid ID.");
    }
    return 1;
}
If not, then you must use strcmp and strtok, I'm not gonna make that

EDIT: woah 100th post xd
Reply
#7

Try.
you use:
pawn Код:
new string[128];
format(string, sizeof(string),"this is message");
SendClientMessage(id, COLOR, string);
format(string, sizeof(string),"this is other message");
SendClientMessage(playerid, COLOR, string);
format(string, sizeof(string),"this is other message");
print(string);
pawn Код:
COMMAND:pm(playerid,params[])
{
    static id, mess, Nome1[24], Nome2[24],string[128];
       
    if(sscanf(params,"us",id,mess))
        return SendClientMessage(playerid,red,"USAGE: /pm [id] [message] - will send a private message to a player.");
       
    if(IsPlayerConnected(id)) return SendClientMessage(playerid,red,"Invalid ID.");
    GetPlayerName(playerid,Nome1,sizeof(Nome1));
    GetPlayerName(id,Nome2,sizeof(Nome2));
    format(string,sizeof(string),"PM sent to %s.",Nome2);SendClientMessage(playerid,COLOR_LIGHTGREEN,text1);
    format(string,sizeof(string),"PM from %s: %s",Nome1,mess);
    SendClientMessage(playerid,COLOR_LIGHTGREEN,text2);
    return 1;
}
Reply
#8

Fail
if everything is hard to u
try this
https://sampforum.blast.hk/showthread.php?tid=227048
or search if this one dont work
Reply
#9

Thanks. It is working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)