Invalid ID`s.
#1

I still cant understand what `INVALID_PLAYER_ID | INVALID_VEHICLE_ID` stand for... I though its only a fukin blue color but as i see everybody uses that in their scripts.

It realy checks if vehicle/player is connected or only it wont let go over 500/1000 ?
btw. Fukin blue color.. ---_---

I tested that, i just changed all ISPlayerConnected(blabla) to balbal != INVALID_PLAYER_ID and it only fuked up my server, just freezed it and thats all.. .,0
Reply
#2

i use INVALID_PLAYER_ID to detect if the player died in explosion, splat or suicide or if he was killed b ysomebody else. if INVALID_PLAYER_ID true maybe he got killed in a suicide or a splat.

althought there are hundred of more usages, this is a valid one.
Reply
#3

Thats the only usage.. you still could use
pawn Код:
if(killerid == -1 || killerid > max slots)
i dont know any usega for it maybe some BETA Testers could explane me.. ?
Reply
#4

pawn Код:
if(killerid == -1 || killerid > max slots)
If killer id is any player, or if killerid is bigger than max server slots.
Reply
#5

They're just constant numbers used to symbolize a player/vehicle/whatever that's NOT possible (impossible) to exist.

The SA:MP server sends these numbers in events like OnPlayerDeath and OnVehicleDeath, which is why they're defined for us. They're are defined because you cannot change what the SA:MP server sends into your Pawn script and because SA:MP developers decided to use those numbers in the SA:MP source.

INVALID_PLAYER_ID is not a replacement for IsPlayerConnected, the usages you know of are pretty much the only usages available.. except for when creating your own "logic".

It looks like you may be over-analysing it, hopefully this clarifies.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)