16.11.2013, 17:22
For admin commands.
What's the difference between > < => =< ?
pawn Код:
if(PlayerInfo[playerid][pAdmin] > 5)
if(PlayerInfo[playerid][pAdmin] > 5)
new a; a = 5; if(a > 5) // it will return 0 if(a => 5) // it will return 1
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
mean in your code :
if(PlayerInfo[playerid][pAdmin] > 5) //mean his level must be more than 5
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
if(PlayerInfo[playerid][pAdmin] < 1) // Line 111 { return SendClientMessage(playerid, -1, "You are not an admin!"); }
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);
}
}
if (PlayerInfo[playerid][pAdmin] >= 1)
{
at the end of ** if (PlayerInfo[playerid][pAdmin] >= 1) ** dont type ; problem replace => to >=
Dont Forgot the +rep if working