What The Command Says I Am Not Allowed To Use,Even If I Have Permission -
Speaker - 31.12.2017
Hello Guys I Am Having My Whole Admin System In My Gamemode, Recently I made a filterscript for event and i make a cmd:event in it which can be used by admin level 6 but i am not able to use it it says i am not allowed here is the example code
In Gamemod i have Having Like This
Код:
enum PlayerData
{
bip,
Registered,
LoggedIn,
Level,
Helper,
Tag
};
new PlayerInfo[MAX_PLAYERS][PlayerData];
So For Checking If Player Having Required Admin level or not i am using this In My GM
Код:
if(PlayerInfo[playerid][Level] < 6)
Now When It Comes To Filtescript I Want Level 6 Admin Should Be Able To Use Cmd:event
So On Top I Added This In My FS
Код:
enum PlayerData
{
Level
};
new PlayerInfo[MAX_PLAYERS][PlayerData];
For For Checking That The Player Is Of Required Admin level I Use This In FS
Код:
if(PlayerInfo[playerid][Level] < 6) return SendClientMessage(playerid,COLOR_YELLOW,"You are not allowed to use this command.");
But I Am Having A Problem When I Use The cmd:event it says u r not allowed to use this cmd even if i am level 10
i want to ask
Does I Have To Add That cmd In GM To Make It Work If Yes Plzz Tell Me How I Can Make It Work In FS and also why this problem is arising
Re: What The Command Says I Am Not Allowed To Use,Even If I Have Permission -
RogueDrifter - 31.12.2017
You can:
1- put that cmd in the GM.
2- save the player's level in a file and read it from the FILTERSCRIPT.
Re: What The Command Says I Am Not Allowed To Use,Even If I Have Permission -
Speaker - 31.12.2017
How I Can Read It From FS Could U Explain
Re: What The Command Says I Am Not Allowed To Use,Even If I Have Permission -
Ritzy2K - 31.12.2017
Код:
if(PlayerInfo[playerid][Level] == 6)
Re: What The Command Says I Am Not Allowed To Use,Even If I Have Permission -
Speaker - 31.12.2017
You mean something like this
Код:
CMD:event(playerid)
{
if (udb_Exists(PlayerName2(playerid)))
{
PlayerInfo[playerid][Level] = (dUserINT(PlayerName2(playerid)).("Level"));
}
Re: What The Command Says I Am Not Allowed To Use,Even If I Have Permission -
RogueDrifter - 31.12.2017
Quote:
Originally Posted by Ritzy
Код:
if(PlayerInfo[playerid][Level] == 6)
|
He's asking how he can read it from an FS not from the GM,
@OP: just read the file path you used to save the playerinfo in from the FS or read this
y_ini tutorial if you have no idea what you're doing.
Re: What The Command Says I Am Not Allowed To Use,Even If I Have Permission -
Speaker - 31.12.2017
Ok Thanks
Re: What The Command Says I Am Not Allowed To Use,Even If I Have Permission -
Ritzy2K - 31.12.2017
Quote:
Originally Posted by RogueDrifter
He's asking how he can read it from an FS not from the GM,
@OP: just read the file path you used to save the playerinfo in from the FS or read this y_ini tutorial if you have no idea what you're doing.
|
If you read his thread carefully. He said that it says he's not allowed to use this command. Right? Which means, the issue comes down to the if clause which checks if the player has required admin level. Right? Now, he is admin level 6, and he wants admin level 6 to run the command, right? Now look at his original clause. It will make the command available for everyone below admin lvl 6, lol.
Re: What The Command Says I Am Not Allowed To Use,Even If I Have Permission -
RogueDrifter - 31.12.2017
Quote:
Originally Posted by Ritzy
If you read his thread carefully. He said that it says he's not allowed to use this command. Right? Which means, the issue comes down to the if clause which checks if the player has required admin level. Right? Now, he is admin level 6, and he wants admin level 6 to run the command, right? Now look at his original clause. It will make the command available for everyone below admin lvl 6, lol.
|
LOL, okay sorry but dude that's not what he asked for in his post he asked about how to use the level check in other filterscripts man,
@OP: what ritzy said is right you need to change
PHP код:
if(PlayerInfo[playerid][Level] < 6)
to
PHP код:
if(PlayerInfo[playerid][Level] >= 6)
Re: What The Command Says I Am Not Allowed To Use,Even If I Have Permission -
jasperschellekens - 31.12.2017
You can also put the variable from your gamemode into your filterscript and then load the variable info the same way that is used in your gamemode. This worked for me once. Best is to add everything to your gamemode.