AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Function doesnt get called (https://forums.alliedmods.net/showthread.php?t=162861)

Diegorkable 07-23-2011 21:06

Function doesnt get called
 
Hey, I built a function that is called, but for some wierd reason after it is called (and im sure it is called cuz i did a client_print to see if it reaches there) it never calls the function StartMatch(), why is that??
Here is the code:

PHP Code:

public CurrentTeams()
{
    new 
players[32], pnumtempid;  
      
    
get_players(playerspnum"ch"); 
        
    for( new 
ii<pnumi++ )  
    {  
        if (
cs_get_user_team(tempid) == CS_TEAM_SPECTATOR)
        {
            
MoveFromSpec(tempid)
        }
    }
    
    
StartMatch()
}


public 
MoveFromSpec(id)
{
    new 
players[32], pnumtempid;  
    new 
tteamctteam
      
    get_players
(playerspnum"ch"); 
        
    for( new 
ii<pnumi++ )  
    {  
        
tempid players[i];  
        if (
cs_get_user_team(tempid) == CS_TEAM_T
        { 
            
tteam++
        }
        
        else if(
cs_get_user_team(tempid) == CS_TEAM_CT)
        {
            
ctteam++
        }
    } 
    
    if (
tteam ctteam)
    {
        
cs_set_user_team(idCS_TEAM_CT)
    }
    
    else if (
ctteam >= tteam)
    {
        
cs_set_user_team(idCS_TEAM_T)
    }



wrecked_ 07-23-2011 21:08

Re: Function doesnt get called
 
Show us your StartMatch() function and re-place the client_print() messages that you had.

Diegorkable 07-24-2011 06:06

Re: Function doesnt get called
 
All that StartMatch does is print 3 messages then set task to another function. It isnt something wrong with StartMatch() since i would have seen the messages getting printed, can you tell me if you see anything wrong in the code i posted?

Diegorkable 07-24-2011 06:19

Re: Function doesnt get called
 
Nvm, it works i fixed it.


All times are GMT -4. The time now is 01:10.

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