AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get_players alternative (https://forums.alliedmods.net/showthread.php?t=95487)

Mlk27 06-24-2009 03:43

get_players alternative
 
Any idea how I can replace get_players to get accurate players team? In some mods that often switch players team, get_players always fail to return their current team correctly

Code:
stock show_chat(iClient, szMsg[]) {     if (msgSayText == -1)         msgSayText = get_user_msgid("SayText")     if (msgSayText)     {         new iNum, iPlayers[32], iPlayer         if (is_user_alive(iClient))             get_players(iPlayers, iNum, "ch")         else             get_players(iPlayers, iNum, "bch")         for (new i=0; i < iNum; i++)         {             iPlayer = iPlayers[i]             message_begin(MSG_ONE, msgSayText, {0, 0, 0}, iPlayer)             write_byte(iPlayer)             write_string(szMsg)             message_end()         }     } }

Arkshine 06-24-2009 03:55

Re: get_players alternative
 
Loop through all players and use cs_get_user_team().

Mlk27 06-24-2009 04:11

Re: get_players alternative
 
I want to make this work with CZ too

Arkshine 06-24-2009 04:34

Re: get_players alternative
 
CS = CZ. It's the same game.

SnoW 06-24-2009 05:02

Re: get_players alternative
 
Quote:

Originally Posted by arkshine (Post 855686)
CS = CZ. It's the same game.

Wrong. Counter Strike is different game than Condition Zero, but obviously cs_get_user_team works on both games. :mrgreen:

Arkshine 06-24-2009 05:31

Re: get_players alternative
 
It's the same dll and engine. It's the same.

SnoW 06-24-2009 06:32

Re: get_players alternative
 
Quote:

Originally Posted by arkshine (Post 855701)
It's the same dll and engine. It's the same.

There's much same in them like dll and engine, but it's a different game. Valve kind of just made some new skins, bots, changed the name and sells the same game, somehow it's still different. At least I'd say that. Well it doesn't matter.

Arkshine 06-24-2009 06:36

Re: get_players alternative
 
It does matter and it's the same game. I don't talking about trivial stuff like skins and such, but the engine, how it works, it's the same as CS. ( Except some things are disabled in CS )

SnoW 06-24-2009 06:41

Re: get_players alternative
 
Okay, so you mean with a game engine, dll and basic stuff. I mean with a game the whole CD you buy from a store or the packet you buy from steam. Obviously there's different things in them and for me it's different, but for you if the engine and dll is the same the game is same.

fysiks 06-24-2009 19:04

Re: get_players alternative
 
Quote:

Originally Posted by SnoW (Post 855730)
Okay, so you mean with a game engine, dll and basic stuff. I mean with a game the whole CD you buy from a store or the packet you buy from steam. Obviously there's different things in them and for me it's different, but for you if the engine and dll is the same the game is same.

He's a coder, he doesn't care about the superficial things lol :).


All times are GMT -4. The time now is 15:29.

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