/pm Commands - 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)
+--- Thread: /pm Commands (
/showthread.php?tid=287847)
/pm Commands -
Azzeto - 05.10.2011
I know its a simple command, but I get errors "Server: Unknown Command" and Im not sure if it sends the message or not
pawn Код:
CMD:pm(playerid,params[]){
new id,message;
if(sscanf(params,"uz",id,message)) return SendClientMessage(playerid,COLOR_GRAY,"SYNTAX: /pm [ID] [Message]");
else{
new string[128];
format(string,sizeof(string),"PM From %s: %s",GetName(id),params);
SendClientMessage(playerid,COLOR_YELLOW,string);
format(string,sizeof(string),"PM To %s: %s",GetName(playerid),params);
SendClientMessage(playerid,COLOR_YELLOW,string);
}
return 1;
}
Re: /pm Commands -
$India$ - 05.10.2011
LOL Its really Wrong Command.
pawn Код:
CMD:pm(playerid, params[])
{
new id, message;
if(sscanf(params,"us[128]", id, Message))
{
new string[128];
format(string, sizeof(string),"PM From %s[ID: %d]: %s", GetName(id), id, Message);
SendClientMessage(playerid, -1, string);
format(string, sizeof(string),"PM To %s[ID: %d]: %s", GetName(playerid), id, Message);
SendClientMessage(id, -1, string);
}
else SendClientMessage(playerid, -1,"Usage: /pm [id][message]");
return 1;
}
Rep
Re: /pm Commands -
[HiC]TheKiller - 05.10.2011
Quote:
Originally Posted by $India$
LOL Its really Wrong Command.
pawn Код:
CMD:pm(playerid, params[]) { new id, message; if(sscanf(params,"us[128]", id, Message)) { new string[128]; format(string, sizeof(string),"PM From %s[ID: %d]: %s", GetName(id), id, Message); SendClientMessage(playerid, -1, string); format(string, sizeof(string),"PM To %s[ID: %d]: %s", GetName(playerid), id, Message); SendClientMessage(id, -1, string); } else SendClientMessage(playerid, -1,"Usage: /pm [id][message] return 1; }
Rep
|
That's even worse, and
DO NOT ASK FOR REP. Make sure that OnPlayerCommandPerformed + OnPlayerCommandReceived returning 1 and that you actually have the script loaded.
Re: /pm Commands -
$India$ - 05.10.2011
I have fixed that.
Forgot to put that