Making a command for two ranks.
#1

Okay, So i've got a helper rank (tester) and then my administrator ranks.
I've got commands like /goto etc, that i want both to be able access, But can't seem to figure it.
Heres the basic code that i use for tester commands.
Код:
if(Player[playerid][Tester] >= 1)
I've tried.
Код:
if(Player[playerid][Tester] >= 1)
if(Player[playerid] [AdminLevel] >=1)
And
Код:
if(Player[playerid][Tester] >= 1) && (player[playerid][AdminLevel] >= 1))
Anyone got a code that'd work?
Reply
#2

Didnt you get errors?
Reply
#3

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/goto", cmdtext, true, 10) == 0)
    {
        if(Player[playerid][Tester] >= 1) || (player[playerid][AdminLevel] >= 1))
                {
                 // ur code here
                }
        return 1;
    }
    return 0;
}
Reply
#4

pawn Код:
if(Player[playerid][Tester] >= 1) || (player[playerid][AdminLevel] >= 1))
Reply
#5

Tried those codes, Got errors.
Quote:

C:\Users\Josh\Desktop\FCSLRP\gamemodes\Roleplay.pw n(24347) : error 029: invalid expression, assumed zero
C:\Users\Josh\Desktop\FCSLRP\gamemodes\Roleplay.pw n(24347) : warning 215: expression has no effect
C:\Users\Josh\Desktop\FCSLRP\gamemodes\Roleplay.pw n(24347) : error 001: expected token: ";", but found ")"
C:\Users\Josh\Desktop\FCSLRP\gamemodes\Roleplay.pw n(24347) : error 029: invalid expression, assumed zero
C:\Users\Josh\Desktop\FCSLRP\gamemodes\Roleplay.pw n(24347) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Reply
#6

Quote:
Originally Posted by Glad2BeHere
Посмотреть сообщение
pawn Код:
if(Player[playerid][Tester] >= 1) || (player[playerid][AdminLevel] >= 1))
It's a forum rule to not post untested code.

Quote:
Originally Posted by Joshswag
Посмотреть сообщение
Tried those codes, Got errors.
pawn Код:
if(Player[playerid][Tester] >= 1 || Player[playerid][AdminLevel] >= 1)
{
    //code here
}
Here are some operators for future reference. https://sampwiki.blast.hk/wiki/Control_Structures#Operators
Reply
#7

pawn Код:
if(Player[playerid][Tester] >= 1) || (Player[playerid][AdminLevel] >= 1)
fixed ur errors in the first place this it what u showed so this is what im using
Reply
#8

Worked thanks.
Reply
#9

Quote:
Originally Posted by Glad2BeHere
Посмотреть сообщение
pawn Код:
if(Player[playerid][Tester] >= 1) || (Player[playerid][AdminLevel] >= 1)
fixed ur errors in the first place this it what u showed so this is what im using
https://sampforum.blast.hk/showthread.php?tid=355296
Quote:

8. Do not post untested code.

Reply
#10

how u want me to test it im using what he gave me and its not the whole code but (Y) any way
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)