SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 30/09/2010, 04:16 AM   #1
willsuckformoney
High-roller
 
willsuckformoney's Avatar
 
Join Date: Dec 2009
Posts: 1,505
Reputation: 65
Default Invalid Playerid

I never thought I ask this or even use this but

pawn Code:
!= INVALID_PLAYER_ID

That mean Player is NOT connected?
__________________
Fuck the system.
willsuckformoney is offline  
Old 30/09/2010, 04:18 AM   #2
Las Venturas CNR
Gangsta
 
Join Date: Feb 2010
Posts: 593
Reputation: 42
Default Re: Invalid Playerid

Compiles fine

But why simply not use IsPlayerConnected
Las Venturas CNR is offline  
Old 30/09/2010, 04:34 AM   #3
Simon
Gangsta
 
Join Date: Jan 2006
Location: New Zealand
Posts: 530
Reputation: 54
Default Re: Invalid Playerid

No it doesn't. It's just checking if a variable is equal to INVALID_PLAYER_ID (a number), which is never connected because a player can never have that ID.

It does not mean a valid player ID is connected if it passes the check.

How it's interpreted or supposed to be interpreted is up to the function that provides it.
Simon is offline  
Old 30/09/2010, 04:35 AM   #4
willsuckformoney
High-roller
 
willsuckformoney's Avatar
 
Join Date: Dec 2009
Posts: 1,505
Reputation: 65
Default Re: Invalid Playerid

Well yeah, I just seen that piece a lot and I never found out what it meant. Does anyone know what it means?
__________________
Fuck the system.
willsuckformoney is offline  
Old 30/09/2010, 04:39 AM   #5
Simon
Gangsta
 
Join Date: Jan 2006
Location: New Zealand
Posts: 530
Reputation: 54
Default Re: Invalid Playerid

It depends on the context it's used.

It's a number that is supposed to represent a player ID that players cannot have. This is why it's used in callbacks such as OnPlayerDeath, you know that there is no killer if the killerid is INVALID_PLAYER_ID because the SA:MP server is designed to do that so it's predictable. It's done like that so you know there's no killer associated with the event and it wouldn't get confused with all valid playerid's.

The meaning of a check like that can change from function to function.
Simon is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What's wrong with skins? GetPlayerSkin(playerid) & SetPlayerSkin(playerid, skin) McSquizzy Help Archive 7 16/04/2010 02:27 PM
Help with if(MedicBill[playerid] == 1 && PlayerInfo[playerid][pJailed] == 0 && Keeboo13 Help Archive 0 11/04/2010 05:38 AM
WG40[playerid] = 1; For everyone not only playerid? pawelf94 Help Archive 4 23/12/2009 04:31 PM
help with invalid id aaronishello Help Archive 4 10/05/2009 08:59 PM


All times are GMT. The time now is 04:15 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.