Difference between > < => =< -
420Scripter - 16.11.2013
For admin commands.
pawn Код:
if(PlayerInfo[playerid][pAdmin] > 5)
What's the difference between > < => =< ?
Re: Difference between > < => =< -
dominik523 - 16.11.2013
> - is bigger than
< - is lower then
=< - is lower or equal to
=> - is bigger or equal to
Example:
Код:
new a;
a = 5;
if(a > 5) // it will return 0
if(a => 5) // it will return 1
Re: Difference between > < => =< -
420Scripter - 16.11.2013
Okay thanks.
I get errors with this, what's the problem?
pawn Код:
case 4:
{
if(PlayerInfo[playerid][pAdmin] => 1); // Line 111
{
return SendClientMessage(playerid, -1, "You are not an admin!");
}
else
{
SetPlayerTeam(playerid, TEAM_ADMINS);
GameTextForPlayer(playerid, "~r~Admins", 1000, 3);
}
}
Код:
LGW.pwn(111) : warning 211: possibly unintended assignment
LGW.pwn(111) : error 029: invalid expression, assumed zero
LGW.pwn(111) : warning 215: expression has no effect
LGW.pwn(111) : error 001: expected token: ";", but found ")"
LGW.pwn(111) : error 029: invalid expression, assumed zero
LGW.pwn(111) : fatal error 107: too many error messages on one line
Re: Difference between > < => =< -
Joe_Goro - 16.11.2013
> bigger than
pawn Код:
mean in your code :
if(PlayerInfo[playerid][pAdmin] > 5) //mean his level must be more than 5
< - is lower then
<= - is lower or equal to
>= - is bigger or equal to
!= mean if not to
pawn Код:
if(PlayerInfo[playerid][pAdmin] != 5) // mean any admin level from 0 to 99999999 can use the cmd exccept level 5 cant use it
Код:
+rep if helped please
Re: Difference between > < => =< -
dominik523 - 16.11.2013
I'm sure it has to be like this
Код:
if(PlayerInfo[playerid][pAdmin] < 1) // Line 111
{
return SendClientMessage(playerid, -1, "You are not an admin!");
}
Re: Difference between > < => =< -
Joe_Goro - 16.11.2013
change to
pawn Код:
case 4:
{
if(PlayerInfo[playerid][pAdmin] >= 1) // Line 111
{
return SendClientMessage(playerid, -1, "You are not an admin!");
}
else
{
SetPlayerTeam(playerid, TEAM_ADMINS);
GameTextForPlayer(playerid, "~r~Admins", 1000, 3);
}
}
the edit is
pawn Код:
if (PlayerInfo[playerid][pAdmin] >= 1)
{
changes :
Код:
at the end of ** if (PlayerInfo[playerid][pAdmin] >= 1) ** dont type ;
problem replace => to >=
Код:
Dont Forgot the +rep if working
Re: Difference between > < => =< -
dominik523 - 16.11.2013
yes, make sure to change => to >=, besides ; at the end of the line, that is also causing the errors
Re: Difference between > < => =< -
Nourdin - 16.11.2013
> is higher than..
And < is lower than..
So your command means:
If the player is higher than level 5.
+rep is appreciated!