Is there any way of finding out what a player's ID is in a server by using scripts?
Let's say if I went into a server, can I find out my player number by using a script?
I've tried searching for a solution to this but with no luck![]()
I know if you go sv_players, then count from the bottom of the list starting at 0 to the player you want, then that's the players list number you can use with unit_ commands, etc. If you're in a server by yourself, the number will be 0. If you use a number that's higher than the number of players minus 1, then you will exception because there is no such player.
Well for what I'd like to do, the sv_players wouldn't be ideal because I don't want to know the values myself, I just want the script to know (if you get what I mean).
I'm trying to get an effect to work on every player except for mine, and I could achieve that by getting my own player's number and disabling the effect. I'm using effect_new_on_object_marker btw, I would use the biped's functions but it's not adequate for what I'm trying to do.
Also, lol wtf at your unit_ commands image?
The only way to control players with scripts is (unit (list_get (players) # ) ) where # is between 0 and 15. Using a script on a non-existent player won't exception you. The only problem is that when a player joins, leaves, or dies the list changes. So you can't keep track of a specific player.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks