OnRconCommand - 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: OnRconCommand (
/showthread.php?tid=246639)
OnRconCommand -
Mmartin - 05.04.2011
Hey, i have little problem.
pawn Код:
public OnRconCommand(cmd[])
{
if( strcmp(cmd,"wmsg",true,strlen("wmsg") )==0 )
{
new
Owner[20],
Sprava[100],
command[20],
str[128]
;
sscanf(cmd,"s[20] s[20] s[100]",command,Owner,Sprava);
format(str,128,"%s: %s",Owner,Sprava);
SendClientMessageToAll(biela,str);
}
return 1;
}
and, when i type eg. "/rcon wmsg Mmartin some aweeesome text here", nothing happens. Any idea?
Re: OnRconCommand -
Gamer_Z - 05.04.2011
Quote:
Originally Posted by Magazinez
whats the 3rd string for?
s[100]?
EDIT: and i cant see a GetPlayerName function..
|
He doesn't need one, he is typing his 'own' name.
[strike]
maybe this sounds akward but..
you should use
strcmp + >>>STRREST<<<
[/strike]
You should use the sscanf to get the rest of the string, i think you just can leave 's' there?
http://forum.sa-mp.com/showthread.ph...ghlight=sscanf
Re: OnRconCommand -
Mmartin - 05.04.2011
Problem solution was on wiki..
Quote:
This callback is called when a player types things into the RCON console. This callback will only work in the gamemode if you have it in a filterscript that gets loaded.
|
Re: OnRconCommand -
Gamer_Z - 05.04.2011
okay nice, I learned something too xD