/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: /pm command (
/showthread.php?tid=105412)
/pm command -
Alice[WS] - 29.10.2009
Hey, i made the /pm command for 0.3, but it seem like i'm missing something with the CallLocalFunction.
The script :
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/pm", true) == 0)
{
new x_nr[256];
x_nr = strtok(cmdtext, idx);
new recieverid = strval(x_nr);
new text[MAX_STRING];
if(!strlen(x_nr)) return SendClientMessage(playerid, 0x00C8C8FF, "Enter a valid player ID!");
if(cmdtext[5] == 0) return SendClientMessage(playerid, 0x00C8C8FF, "Enter a message!");
if(!IsPlayerConnected(recieverid)) return SendClientMessage(playerid, 0x00C8C8FF, "Enter a valid player ID!");
if(recieverid == playerid) return SendClientMessage(playerid, 0x00C8C8FF, "You cannot PM yourself!");
if(strlen(x_nr) == 1) { format(text,sizeof(text), "%s", cmdtext[6]); }
if(strlen(x_nr) == 2) { format(text,sizeof(text), "%s", cmdtext[7]); }
if(strlen(x_nr) == 3) { format(text,sizeof(text), "%s", cmdtext[8]); }
CallLocalFunction("OnPlayerPrivmsg","playerid,recieverid,text[]");
return 1;
}
}
Re: /pm command -
dice7 - 29.10.2009
There is no OnPlayerPrivmsg function in 0.3
Re: /pm command -
MadeMan - 29.10.2009
You can make OnPlayerPrivmsg yourself.
https://sampwiki.blast.hk/wiki/OnPlayerPrivmsg - there is an example how to make /pm command.
Re: /pm command -
dice7 - 29.10.2009
He obviously has his /pm command, he's just calling an invalid function with CallRemoteFunction
Re: /pm command -
MadeMan - 29.10.2009
Quote:
Originally Posted by dice7
He obviously has his /pm command, he's just calling an invalid function with CallRemoteFunction
|
What is the valid function to call then?
I was obviously showing how he can make that function.
Re: /pm command -
Correlli - 29.10.2009
It's invalid, indeed.
This is his code:
Quote:
Originally Posted by Alice[A11
]
Код:
CallLocalFunction("OnPlayerPrivmsg","playerid,recieverid,text[]");
|
This is correct:
pawn Код:
CallLocalFunction("OnPlayerPrivmsg", "iis", playerid, recieverid, text);
Re: /pm command -
Alice[WS] - 29.10.2009
Quote:
Originally Posted by Don Correlli
This is correct:
pawn Код:
CallLocalFunction("OnPlayerPrivmsg", "iis", playerid, recieverid, text);
|
Thanks you
Quote:
Originally Posted by dice7
There is no OnPlayerPrivmsg function in 0.3
|
I knew it ^^' i just added the forward and the command to make it like on 0.2
Re: /pm command -
dirkblok - 29.10.2009
Why don't you use the base filterscript?
You can edit that one too