Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » scripts.dll - get all players?
scripts.dll - get all players? [message #241876] Sun, 28 January 2007 14:41 Go to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
is it possible in scripts.dll (3.1.2) to get all the player names in the server. as a char ** or GameObject **?

this would be really helpfull.
Re: scripts.dll - get all players? [message #241895 is a reply to message #241876] Sun, 28 January 2007 15:04 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
the only idea i had was to make a array of GameObjects.
make a player join hook.
make a player leave hook

when someone joins, it puts their GameObject in the array. where their ID would be the index of the array.

whe someone leaves it uses their ID as an index in the array to set it to null.

when i want to see all the players just call Get_Player_Count() and loop that many times through the array.
Re: scripts.dll - get all players? [message #241910 is a reply to message #241876] Sun, 28 January 2007 16:08 Go to previous messageGo to next message
Renx is currently offline  Renx
Messages: 2321
Registered: April 2003
Location: Canada
Karma: 0
General (2 Stars)
Category Moderator
Isn't their name attached to their ID?

~Canucck

http://www.sloganizer.net/en/style7,Espion.png

Blazer

...RG made me ugly
Re: scripts.dll - get all players? [message #241921 is a reply to message #241876] Sun, 28 January 2007 16:40 Go to previous messageGo to next message
Zion is currently offline  Zion
Messages: 2722
Registered: April 2006
Karma: 1
General (2 Stars)
It is in pinfo right?
Re: scripts.dll - get all players? [message #241924 is a reply to message #241876] Sun, 28 January 2007 16:42 Go to previous messageGo to next message
Whitedragon is currently offline  Whitedragon
Messages: 832
Registered: February 2003
Location: California
Karma: 1
Colonel
Look at how the Get_GameObj_By_Player_Name function in engine.cpp does it.

Black-Cell.net
Network Administrator (2003 - )

DragonServ, Renegade's first IRC interface bot
Creator and lead coder (2002 - )

Dragonade, Renegade's first server side modification
Lead coder (2005 - )
Re: scripts.dll - get all players? [message #241927 is a reply to message #241876] Sun, 28 January 2007 16:52 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
thanks
Re: scripts.dll - get all players? [message #241931 is a reply to message #241876] Sun, 28 January 2007 17:11 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

In scripts.dll 3.2, I will be looking into providing some things to iterate over the player list.

I am also considering rewriting a few engine calls such as Get_Team_Player_Count, Steal_Team_Credits and others to use this new player list iteration.


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: scripts.dll - get all players? [message #241932 is a reply to message #241876] Sun, 28 January 2007 17:13 Go to previous message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
nice one. Wink
Previous Topic: Sounds
Next Topic: Animating Models
Goto Forum:
  


Current Time: Sat Jan 11 05:06:35 MST 2025

Total time taken to generate the page: 0.00624 seconds