AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Question about player id (https://forums.alliedmods.net/showthread.php?t=299588)

male_07 07-19-2017 12:02

Question about player id
 
the id of the players change when another disconnect or new player joins the server? I mean:

*Player 1 joins the server*
Player 1 have id 1.

*Player 2 joins the server*
Player 2 have id 2.

*Player 3 joins the server*
Player 3 have id 3.

*Player 1 left the server and player 4 joins it*
Player 4 have id ?

In this cases, all the ids of the players change? Player 2 have now id 1, Player 3 have id 2, etc etc.

The point of this question is, im trying to save certain players i select, so i have to store somewhere the id of those players, but if these ids change every time someone joins or leave the server i have to update the id of the players, right?

DjSoftero 07-19-2017 12:13

Re: Question about player id
 
Quote:

Originally Posted by male_07 (Post 2536376)
the id of the players change when another disconnect or new player joins the server? I mean:

*Player 1 joins the server*
Player 1 have id 1.

*Player 2 joins the server*
Player 2 have id 2.

*Player 3 joins the server*
Player 3 have id 3.

*Player 1 left the server and player 4 joins it*
Player 4 have id ?

In this cases, all the ids of the players change? Player 2 have now id 1, Player 3 have id 2, etc etc.

The point of this question is, im trying to save certain players i select, so i have to store somewhere the id of those players, but if these ids change every time someone joins or leave the server i have to update the id of the players, right?

it takes the lowest available space, when joining.

at least that`s how i always thought of it

PRoSToTeM@ 07-19-2017 14:14

Re: Question about player id
 
Quote:

Originally Posted by male_07 (Post 2536376)
*Player 1 joins the server*
Player 1 have id 1.

*Player 2 joins the server*
Player 2 have id 2.

*Player 3 joins the server*
Player 3 have id 3.

*Player 1 left the server and player 4 joins it*
Player 4 have id ?

In most cases should be 1.

klippy 07-19-2017 14:25

Re: Question about player id
 
If you need to keep track of players between sessions use Steam ID.


All times are GMT -4. The time now is 23:11.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.