SA-MP Forums Archive
/pm bug - 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: /pm bug (/showthread.php?tid=251724)



/pm bug - ColdIce - 28.04.2011

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?


Re: /pm bug - SchurmanCQC - 28.04.2011

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


Re: /pm bug - ColdIce - 28.04.2011

Hmm...No, it is not there


Re: /pm bug - [MWR]Blood - 28.04.2011

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


Re: /pm bug - ColdIce - 28.04.2011

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?


Re: /pm bug - Seven_of_Nine - 28.04.2011

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


Re: /pm bug - TheGarfield - 28.04.2011

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;
}



Re: /pm bug - ScRaT - 28.04.2011

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


Re: /pm bug - ColdIce - 28.04.2011

Thanks. It is working