How does INVALID_PLAYER_ID actually work?
#1

Now, this may seem a bit silly but I am basically curious about how INVALID_PLAYER_ID works. Let's start with this example:

pawn Код:
public OnPlayerUpdate(playerid)
{
     if(playerid != INVALID_PLAYER_ID)
     {
            .///
     }
     return 1;
}
This would allow the code to go through if the player is connected. But my question is what exactly is INVALID_PLAYER_ID? A function? If it's a constant value then this would make zero sense.

This is what the compiler sees this as:

if(0 !=

So, playerID obviously can be anything, but what about INVALID_PLAYER_ID? If it's a constant then it certainly can't be 0,1,2,3,4,5,6... How does this work?

Is it basically just a marco for a native function like IsPlayerConnected?

Thanks.

EDIT: In a_samp it's defined as
pawn Код:
#define INVALID_PLAYER_ID                       (0xFFFF)
This makes zero sense, is this like a memory address? Or is it basically something to do with bits?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)