Raised This Month: $ Target: $400
 0% 

Set any id to each player connected?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CsIosefin
Senior Member
Join Date: Aug 2009
Old 08-25-2012 , 08:30   Set any id to each player connected?
Reply With Quote #1

Hello, set the id to each player connected? That is the first player to get connected to the server ID 1, and so on? If you set an id to each player how do I know?
CsIosefin is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 08-25-2012 , 08:31   Re: Set any id to each player connected?
Reply With Quote #2

What? Each player in the server has their own index starting from 1 and ending at 32.
Backstabnoob is offline
CsIosefin
Senior Member
Join Date: Aug 2009
Old 08-25-2012 , 09:45   Re: Set any id to each player connected?
Reply With Quote #3

Good, the number is set when you are connected to the server or connection before?
Code:
if(get_user_userid(id) == 1)
Should look like this, right?
CsIosefin is offline
Torge
Veteran Member
Join Date: Oct 2011
Old 08-25-2012 , 09:51   Re: Set any id to each player connected?
Reply With Quote #4

I think when you're connected.

That don't work:
PHP Code:
if(get_user_userid(id) == 1
Torge is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-25-2012 , 11:59   Re: Set any id to each player connected?
Reply With Quote #5

Quote:
Originally Posted by Torge View Post
I think when you're connected.

That don't work:
PHP Code:
if(get_user_userid(id) == 1
IIRC, when a player connects he is assigned the first available slot.

Code:
Connect, Slot 1 - Userid=1 Connect, Slot 2 - Userid=2 Connect, Slot 3 - Userid=3 Connect, Slot 4 - Userid=4 Disconnect, Slot 2 Connect, Slot 2 - Userid=5 Connect, Slot 5 - Userid=6

This is not the same as a userid - A userid is incremented on each connect to the server. It's not an index into an edict list, like a player index (from 1-32).
__________________

Last edited by Bugsy; 08-25-2012 at 12:01.
Bugsy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-25-2012 , 12:03   Re: Set any id to each player connected?
Reply With Quote #6

Quote:
Originally Posted by CsIosefin View Post
Hello, set the id to each player connected? That is the first player to get connected to the server ID 1, and so on? If you set an id to each player how do I know?
Your question makes very little sense. You can't set a player's ID. There are two different three different types of "ID"'s. One in the entity index, a value from 1 to <maxplayers>. The next is the "UserID" which is a number assigned to each player based on how many players have connected before since the server was first turned on. The third one is the SteamID which should be self explanatory.
__________________
fysiks is offline
CsIosefin
Senior Member
Join Date: Aug 2009
Old 08-25-2012 , 18:20   Re: Set any id to each player connected?
Reply With Quote #7

I want a simple thing ... id 1 player to be sent directly to a team.
So:
Code:
if(get_user_userid(id) == 1)
CsIosefin is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-25-2012 , 19:13   Re: Set any id to each player connected?
Reply With Quote #8

Quote:
Originally Posted by CsIosefin View Post
I want a simple thing ... id 1 player to be sent directly to a team.
So:
Code:
if(get_user_userid(id) == 1)
PHP Code:
//Player in slot 1
if ( id == )
{

}

//Player with userid 1 -- only will happen once for first player to connect to the server 
if ( get_user_useridid ) == )
{


__________________

Last edited by Bugsy; 08-26-2012 at 21:13.
Bugsy is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-25-2012 , 20:14   Re: Set any id to each player connected?
Reply With Quote #9

userid is not reset on new map !
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
CsIosefin
Senior Member
Join Date: Aug 2009
Old 08-26-2012 , 09:57   Re: Set any id to each player connected?
Reply With Quote #10

I was careful to Bugsy's explanation below with connections. So:
Code:
if(get_user_userid(id) == 1)
{
// If userid is 1
}else{
// If you have any other userid out of 1
}
Thanks for your time in this topic.
CsIosefin is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 05:43.


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