Little help with stock and cmd
#1

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

Try this:
pawn Код:
stock IsPlayerAAdmin(playerid)
{
    if(PlayerInfo[playerid][pAdmin] >= 4)
        return 1;
    else
        return 0;
}
Reply
#3

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 ?
Reply
#4

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

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

Then the problem is most likely in your Include. Try to use crashdetect to check if it prints any error.
Reply
#7

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
Reply
#8

Show us the command.
Reply
#9

Quote:
Originally Posted by Stanford
Посмотреть сообщение
Show us the command.
Its not about the command but that it wont read that line.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)