SA-MP Forums Archive
Invalid ID`s. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Invalid ID`s. (/showthread.php?tid=200292)



Invalid ID`s. - GaGlets(R) - 18.12.2010

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


Re: Invalid ID`s. - admantis - 18.12.2010

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.


Re: Invalid ID`s. - GaGlets(R) - 18.12.2010

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.. ?


Re: Invalid ID`s. - blackwave - 18.12.2010

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


Re: Invalid ID`s. - Simon - 18.12.2010

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.