Raised This Month: $ Target: $400
 0% 

[SOLVED]gain problem with random player ;)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 10-23-2009 , 08:36   [SOLVED]gain problem with random player ;)
Reply With Quote #1

PHP Code:
register_logevent("round_end"2"1=Round_End"
PHP Code:
public round_end()
{
    if(
g_spieler_anzahl_checked == && g_first_round == 1)
    {
        new 
survivor
        
new user_is_suvivor[33]
        new 
user_was_CT[33]
        for(new 
id 1;id <= g_MaxPlayers;id++)
        {
            if(
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T)
            {
                
survivor++
            }
            if(
survivor == && is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T)
            {
                
user_is_suvivor[id] = 1
                
if(is_user_alive(id))
                {
                    
cs_set_user_team(user_is_suvivor[id],CS_TEAM_CT)
                }
            }
            if(
survivor >= 2)
            {
                if(
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT)
                {
                    
cs_set_user_team(id,CS_TEAM_T)
                    
user_was_CT[id] = 1
                
}
                if(
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T && user_was_CT[id] == 0)
                {
                    new 
name[33]
                    new 
iPlayers32 ], iNumiPlayer;
                    
get_playersiPlayersiNum );
    
                    
iPlayer iPlayersrandomiNum ) ];
                    if(
is_user_alive(iPlayer))
                    {
                        
get_user_name(iPlayer,name,32)
                        
cs_set_user_team(iPlayer,CS_TEAM_CT)
                        
client_print(0,print_chat,"tranfered  %s to CT",name)
                    }
                }
            }
        }
    }
            

what i want do to =
@ round end i want check all alive T's !
if is there only 1 T. then transfer the T to CT & all players to T. ( 1 CT vs. all Terrors )

if are there more Terrors alive, then set a random terror of alive terror to CT & all CTs to Terror. ( again 1 CT vs all Terrors. )

the game playe =

first round will one user tranfered to CT & he has to player vs. all Terrors. @ round end if he could kill all Terrors, he willbe stay CT & the same game agin. if 1 or more Terrors survive the round, 1 of em willbe CT & he has the chance to kill all Terrors.



i hope anyone can help me.
__________________

Last edited by One; 10-23-2009 at 11:44.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
 



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 17:34.


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