Rcon Command script not working
#1

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;
}
Reply
#2

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.
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)