Whats the difference between "!IsPlayerAdmin(playerid))" and "IsPlayerAdmin(playerid))"
#1

Whats the difference between "!IsPlayerAdmin(playerid))" and "IsPlayerAdmin(playerid))"

Thanks
Reply
#2

pawn Code:
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are NOT an admin! ");
if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are an admin! ");
So practicly with the first one it will check if youre not an admin, and with the second it will check if youre an admin
Reply
#3

The first one means the opposite, that they're not administrators.
Reply
#4

Thanks.
Reply
#5

An exclamation mark ( ! ) in any pawn code means NOT.

pawn Code:
if(!IsPlayerConnected(playerid)) // is player NOT connected
if(!IsPlayerNPC(playerid)) // is player NOT an NPC
if(!IsPlayerInRangeOfPoint(playerid)) // is player NOT in range of point
Read the Operators section for more info:

https://sampwiki.blast.hk/wiki/Control_Structures#Operators
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)