Raised This Month: $ Target: $400
 0% 

Respawn Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EDUTz
Senior Member
Join Date: Jun 2010
Location: Dracula's Homeland
Old 11-12-2011 , 06:22   Respawn Problem
Reply With Quote #1

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 ?
EDUTz is offline
kotinha
Senior Member
Join Date: Jun 2009
Location: Alentejo, Portugal :)
Old 11-12-2011 , 08:57   Re: Respawn Problem
Reply With Quote #2

PHP Code:
get_playersplayersnumberofplayers" a" ); 

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.
__________________
"If God exists, I hope he has a good excuse." - Woody Allen
kotinha is offline
EDUTz
Senior Member
Join Date: Jun 2010
Location: Dracula's Homeland
Old 11-12-2011 , 09:39   Re: Respawn Problem
Reply With Quote #3

OMG i'm so blind

Thank's a lot, i wouldn't guess in a million years Thanks again mate
EDUTz is offline
Reply


Thread Tools
Display Modes

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 08:25.


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