Little help with stock and cmd -
devil shill - 01.08.2014
Hey guys i got a command and stock but it returns as Unknown Command everytime (Doesnt check if im admin)
This is under the command line to check if im admin
Код:
if(!IsPlayerAAdmin(playerid)) return 0;
This is the stock for the line ^
Код:
stock IsPlayerAAdmin(playerid)
{
{
if(PlayerInfo[playerid][pAdmin] >= 4) return 1;
}
return 0;
}
Re: Little help with stock and cmd -
Drago987 - 01.08.2014
Try this:
pawn Код:
stock IsPlayerAAdmin(playerid)
{
if(PlayerInfo[playerid][pAdmin] >= 4)
return 1;
else
return 0;
}
Re: Little help with stock and cmd -
devil shill - 01.08.2014
Tried it doesnt work still returns as unknown command, but when is do it on the rcon one it works
if(!IsPlayerAdmin(playerid)) return 0;
Could it be that it doesnt work in a filterscript ?
Re: Little help with stock and cmd -
]Rafaellos[ - 01.08.2014
Quote:
Originally Posted by Drago987
Try this:
pawn Код:
stock IsPlayerAAdmin(playerid) { if(PlayerInfo[playerid][pAdmin] >= 4) return 1; else return 0; }
|
It's still the same thing.
@devil shill: What's the point of using stock for this instead of just:
pawn Код:
if(PlayerInfo[playerid][pAdmin] < 4) return 0;
Also, try to comment the admin check in case that the problem is somewhere else.
Re: Little help with stock and cmd -
devil shill - 01.08.2014
Quote:
|
Originally Posted by '
@devil shill: What's the point of using stock for this instead of just:
pawn Код:
if(PlayerInfo[playerid][pAdmin] < 4) return 0;
Also, try to comment the admin check in case that the problem is somewhere else.
|
Wel the filterscript and GM points to a include that contains the PlayerInfo data
but when i do the
pawn Код:
if(PlayerInfo[playerid][pAdmin] < 4) return 0;
it wont work but when the
pawn Код:
if(!IsPlayerAdmin(playerid)) return 0;
is inserted it works but i dont want admins to login trough the rcon so thats why i need to use the playerinfo.
Re: Little help with stock and cmd -
]Rafaellos[ - 01.08.2014
Then the problem is most likely in your Include. Try to use crashdetect to check if it prints any error.
Re: Little help with stock and cmd -
devil shill - 01.08.2014
Quote:
Originally Posted by ]Rafaellos[
Then the problem is most likely in your Include. Try to use crashdetect to check if it prints any error.
|
Not really cause the GM uses that include as well and the GM commands works like a charm so if there was something wrong with it then the GM command shouldnt work as well
Re: Little help with stock and cmd -
Stanford - 01.08.2014
Show us the command.
Re: Little help with stock and cmd -
devil shill - 01.08.2014
Quote:
Originally Posted by Stanford
Show us the command.
|
Its not about the command but that it wont read that line.