command does not work anymore.
#1

Hello i downloaded a filterscript, fire system. The /fire command, only Rcon have access i change it so admins getting access to it but if i type /fire ingame its saying server unknown command

OLD COMMAND:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	new idx, cmd[256];
	cmd = strtok(cmdtext, idx);
	if(IsPlayerAdmin(playerid))
	{
		#if defined German
		if(strcmp("/feuer", cmd, true) == 0)
		#else
		if(strcmp("/fire", cmd, true) == 0)
		#endif
		{
      		new Float:x, Float:y, Float:z, Float:a;
		    GetXYInFrontOfPlayer(playerid, x, y, z, a, 2.5);
		    /*CallRemoteFuntion("*/CreateFire(/*", "fff", */x, y, z);
			return 1;
		}
	}
	return 0;
}
NEW COMMAND

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	new idx, cmd[256];
	cmd = strtok(cmdtext, idx);
	if(PlayerInfo[playerid][pAdmin] >= 2)	{
		#if defined German
		if(strcmp("/feuer", cmd, true) == 0)
		#else
		if(strcmp("/fire", cmd, true) == 0)
		#endif
		{
      		new Float:x, Float:y, Float:z, Float:a;
		    GetXYInFrontOfPlayer(playerid, x, y, z, a, 2.5);
		    /*CallRemoteFuntion("*/CreateFire(/*", "fff", */x, y, z);
			return 1;
		}
	}
	return 0;
}
What did i wrong ? i defined [pAdmin] in playerinfo, so i don't know what is wrong.

Thanks in advance!
Reply
#2

Anyone ?
Reply
#3

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	new idx, cmd[256];
	cmd = strtok(cmdtext, idx);
	
	#if defined German
	if(strcmp("/feuer", cmd, true) == 0)
	#else
	if(strcmp("/fire", cmd, true) == 0)
	#endif
	{
		if(PlayerInfo[playerid][pAdmin] >= 2)
		{
  			new Float:x, Float:y, Float:z, Float:a;
	    	        GetXYInFrontOfPlayer(playerid, x, y, z, a, 2.5);
	    	        CreateFire(x, y, z);
			return 1;
		}
		else return SendClientMessage(playerid, 0xFF0000FF, "Error: You need to be admin level 3 to use this command");
	}
	
	return 0;
}
Reply
#4

Quote:
Originally Posted by FOTIS6
Посмотреть сообщение
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	new idx, cmd[256];
	cmd = strtok(cmdtext, idx);
	
	#if defined German
	if(strcmp("/feuer", cmd, true) == 0)
	#else
	if(strcmp("/fire", cmd, true) == 0)
	#endif
	{
		if(PlayerInfo[playerid][pAdmin] >= 2)
		{
  			new Float:x, Float:y, Float:z, Float:a;
	    	        GetXYInFrontOfPlayer(playerid, x, y, z, a, 2.5);
	    	        CreateFire(x, y, z);
			return 1;
		}
		else return SendClientMessage(playerid, 0xFF0000FF, "Error: You need to be admin level 3 to use this command");
	}
	
	return 0;
}
now i get this ingame Error: You need to be admin level 3 to use this but im level 6 Admin
Reply
#5

Are you sure that your pAdmin is successfully set to level 2 or more when using the command?
Before you were returning 0 aswell, and with no "else" for the
pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 2)
Which will cause the "Unknown Command"-message if you aren't level 2+.
Reply
#6

I know but what did i do wrong then i only changed the IsPlayerAdmin to that see here the defines

Код:
enum pInfo
{
	pAdmin

}

new PlayerInfo[MAX_PLAYERS][pInfo];
Reply
#7

But you might still be setting it wrongly, where-ever you got the admin level 6, could you show that code?
Reply
#8

Its a fire filterscript so
Reply
#9

Make a command like set level to set your level ingame and then see if you can execute the command.
Or make a command that will return Your admin level as a Client Message.
Reply
#10

Its pAdmin not pLevel
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)