The server says i'm not a admin yet I am?
#1

Ok so heres my code

pawn Код:
CMD:goto(playerid)
{
     if(PlayerInfo[playerid][pAdmin] >= 3) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You are not a admin.");
{
    //code
}
return 1;
}
If a admin higher than level 3 types this command it returns Syntax....

If a admin lower than 3 tpes the command it works.

Can anyone help me with this problem
Reply
#2

pawn Код:
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, "Error"); // So if player has admin level 3,2,1 or 0 it will return error
 if(PlayerInfo[playerid][pAdmin] >= 3) return SendClientMessage(playerid, COLOR_RED, "Error"); // Your problem is you return error to the admins higher/equal to level 3
Or actually you can do:
PHP код:
CMD:goto(playerid)
{
     if(!(
PlayerInfo[playerid][pAdmin] >= 3)) return SendClientMessage(playeridCOLOR_RED"Syntax Error: You are not a admin.");
{
    
//code
}
return 
1;

Reply
#3

PHP код:
if(PlayerInfo[playerid][pAdmin] >= 3
Replace it with

PHP код:
if(PlayerInfo[playerid][pAdmin] < 3
EDIT: Sorry, didn't quite see Jafet's post.
Reply
#4

Quote:
Originally Posted by SpankMe2
Посмотреть сообщение
Ok so heres my code

pawn Код:
CMD:goto(playerid)
{
     if(PlayerInfo[playerid][pAdmin] >= 3) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You are not a admin.");
{
    //code
}
return 1;
}
If a admin higher than level 3 types this command it returns Syntax....

If a admin lower than 3 tpes the command it works.

Can anyone help me with this problem

LoL, learn maths:

>, < and =
I learnt this at the second grade of the primary school -.-
Reply
#5

Quote:
Originally Posted by M4z
Посмотреть сообщение
What you're doing sounds very strange to me, however try this.
http://pastebin.com/iHFZxJ1z
That wont work and higher then admins lvl3 or higher will still get the message....

OT just do what GameOver or Jafet said
Reply
#6

Quote:
Originally Posted by =WoR=Bruno
Посмотреть сообщение
That wont work and higher then admins lvl3 or higher will still get the message....

OT just do what GameOver or Jafet said
Yea I just removed when I realised that it was wrong.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)