AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Respawn Problem (https://forums.alliedmods.net/showthread.php?t=171880)

EDUTz 11-12-2011 06:22

Respawn Problem
 
Hi. I'm trying to respawn a player that is already dead when i kill someone. Part of the code doesn't work and i don't know why.

PHP Code:

                iTeam get_user_teamiAttacker );
                new 
players[32], numberofplayerscount 0;
                
get_playersplayersnumberofplayers"a" );
                for ( 
0numberofplayersi++ )
                {
                    
iTargetID players[i];
                    
                    
// Make sure player is on the same team
                    
if ( get_user_teamiTargetID ) == iTeam )
                    {
                        
                        if ( !
is_user_aliveiTargetID ) && iTargetID != iAttacker )
                        {
                        
count++
                        
                        }
                    
                    

                    }
                    if ( 
count <= )
                    {
                    
ExecuteHamB(Ham_CS_RoundRespawn,iTargetID);
                    }
                } 

if i delete -> if ( !is_user_alive( iTargetID ) it spawns only alive players on my team. What did i do wrong ?

kotinha 11-12-2011 08:57

Re: Respawn Problem
 
PHP Code:

get_playersplayersnumberofplayers" a" ); 

:arrow:
PHP Code:

get_playersplayersnumberofplayers"b" ); 

And you can remove the is_user_alive(id) now...

You had "a" flag wich means : don't return dead players. You should have flag "b" that means: don't return alive players. See here.

EDUTz 11-12-2011 09:39

Re: Respawn Problem
 
OMG i'm so blind :shock:

Thank's a lot, i wouldn't guess in a million years :shock: Thanks again mate :oops:


All times are GMT -4. The time now is 08:25.

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