Making a command for two ranks. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Making a command for two ranks. (
/showthread.php?tid=390612)
Making a command for two ranks. -
Joshswag - 07.11.2012
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?
Re: Making a command for two ranks. -
Laure - 07.11.2012
Didnt you get errors?
Re: Making a command for two ranks. -
Camorra - 07.11.2012
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;
}
Re: Making a command for two ranks. -
Glad2BeHere - 07.11.2012
pawn Код:
if(Player[playerid][Tester] >= 1) || (player[playerid][AdminLevel] >= 1))
Re: Making a command for two ranks. -
Joshswag - 07.11.2012
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.
|
Re: Making a command for two ranks. -
DBan - 07.11.2012
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
Re: Making a command for two ranks. -
Glad2BeHere - 07.11.2012
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
Re: Making a command for two ranks. -
Joshswag - 07.11.2012
Worked thanks.
Re: Making a command for two ranks. -
DBan - 07.11.2012
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.
|
Re: Making a command for two ranks. -
Glad2BeHere - 07.11.2012
how u want me to test it im using what he gave me and its not the whole code but (Y) any way