/makeadmin problem
#1

Problem with return that shows when trying to make myself admin in-game.
PHP код:
if(PlayerInfo[playerid][pAdmin] >= || IsPlayerAdmin(playerid)) 
return 
SendErrorMessage(playerid"ERROR: You are not able to access this command"); 
I wanna make the command to be able to make myself admin when even I'm logged in as RCON.
but I did it,everything fine in the gamemode success to compile but in-game it shows the error message I've put in the return string.

+rep for helpers
Reply
#2

pawn Код:
if (PlayerInfo[playerid][pAdmin] < 6 && !IsPlayerAdmin(playerid)) return SendClientMessage( playerid, -1, "ERROR: You are not able to access this command");
try this
Reply
#3

pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 6 || !IsPlayerAdmin(playerid))
Edit: late.
Reply
#4

It should be
pawn Код:
if(PlayerInfo[playerid][pAdmin] < 6 || !IsPlayerAdmin(playerid))
    return SendErrorMessage(playerid, "ERROR: You are not able to access this command.");
EDIT: Late.. You should read this https://sampwiki.blast.hk/wiki/Control_Structures#Operators
Reply
#5

All wrong, lol.

pawn Код:
if(PlayerInfo[playerid][pAdmin] < 6 && !IsPlayerAdmin(playerid))
    return SendErrorMessage(playerid, "ERROR: You are not able to access this command.");
Reply
#6

Made a false statement - Deleted.
Reply
#7

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
All wrong, lol.

pawn Код:
if(PlayerInfo[playerid][pAdmin] < 6 && !IsPlayerAdmin(playerid))
    return SendErrorMessage(playerid, "ERROR: You are not able to access this command.");
lol he means a command that should also work with rcon and the normal too so it should be
pawn Код:
if(PlayerInfo[playerid][pAdmin] < 6 || !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid, "ERROR: You are not able to access this command.");
Reply
#8

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
All wrong, lol.

pawn Код:
if(PlayerInfo[playerid][pAdmin] < 6 && !IsPlayerAdmin(playerid))
    return SendErrorMessage(playerid, "ERROR: You are not able to access this command.");
yes, haha, i do && but i see many ppl use || so i edit it to it || because i think i wrong, lol
Reply
#9

PHP код:
if(PlayerInfo[playerid][pAdmin] < && !IsPlayerAdmin(playerid))
    return 
SendErrorMessage(playerid"ERROR: You are not able to access this command."); 
This is
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)