Rcon Command script not working - 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: Rcon Command script not working (
/showthread.php?tid=599091)
Rcon Command script not working -
brandypol - 20.01.2016
hi guys, i'm a beginner at scripting i have to admit it lool.. anyways I added what I think is an Rcon command script in my gamemode script and when I compiled I got 1 error saying : error 017: undefined symbol "playerid". I don't know how to fix the problem because I'm not a pro in scripting so can someone help me please ?
Here's the script :
Code:
public OnRconCommand(cmd[])
{
if(strcmp(cmd, "/rcmds",true)==0)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Rcon Commands", "/givexp\n/givelevel\n/giveprestige\n/resetrank\n/rdm\n/createhouse", "OK", "");
return 1;
}
return 0;
}
Re: Rcon Command script not working -
Vince - 20.01.2016
This callback is meant to be used with commands typed into the (remote) console. It cannot be used in-game and hence it also lacks a playerid parameter.
Re: Rcon Command script not working -
yvoms - 20.01.2016
Meaning if you make a command i use ZCMD as example.
Code:
CMD:kick(playerid,params[])
{
new Targetid;
if(!IsPlayerAdmin) return SendClientMessage(playerid, -1, "you are not an RCON admin"); //<--IsPlayerAdmin checks if the player is logged in to rcon.
//Proceed command.
if(sscanf(params,"u",Targetid)) return SendClientMessage(playerid,-1,"{ff0000}[Error]:{ffffff} /kick [ID]");//Checking the input, u = userid/name so it searches for a match.
Kick(Targetid); //Kicking the player id that you have typed in.
return 1; //Execute the above code.
}
https://sampforum.blast.hk/showthread.php?tid=599091