AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Help me with code. (https://forums.alliedmods.net/showthread.php?t=168397)

kramesa 09-28-2011 13:55

[HELP] Help me with code.
 
Hello, I found this script a few commands are not recognized as moveCT ... Had some command to replace it?

PHP Code:

public RandomCpt()   
{   
    new 
players[32], pnumtempid;   
       
    
get_players(playerspnum"ch");   

    for( new 
ii<pnumi++ )   
    {   
        
tempid players[i];   
        
cs_set_user_team(tempidCS_TEAM_SPECTATOR)   
    }                   
           
    new 
random_num(0pnum)   
       
    
cs_set_user_team(players[z], CS_TEAM_T)   
       
    new 
random_num(0pnum)   
       
    while (
== z)   
    {   
        
random_num(0pnum)   
    }   
       
    
cs_set_user_team(players[q], CS_TEAM_CT)   
       
    
client_print(0print_chat"%s Random captains were chosen, The captains will now choose their teammates.")   
    
client_print(0print_chat"%s Terrorists's Captain, please choose first.")   
       
     
Tpick() 
}   

public 
Tpick()   
{   
       
    new 
players[10], pnumtempid;   
           
    
get_players(playerspnum"ch");   
       
    for( new 
ii<pnumi++ )   
    {   
        
tempid players[i];   
        if (
cs_get_user_team(tempid) == CS_TEAM_T)   
        {   
            
cptT tempid   
        
}   
           
        else if (
cs_get_user_team(tempid) == CS_TEAM_CT)   
        {   
            
cptCT tempid   
        
}   
    }   
       
           
     
moveCT() 
}   

public 
moveT(cptT)   
{   
    
    new 
menu menu_create("Choose a Player to move to your team:""moveT_menu");    
    new 
players[32], pnumtempid;    
    new 
szName[32], szTempid[10];    
    new 
pickisdone   
    
    get_players
(playerspnum"ch");    
           
    for( new 
ii<pnumi++ )    
    {    
        
tempid players[i];   
           
        if (
cs_get_user_team == CS_TEAM_SPECTATOR)   
        {   
            
get_user_name(tempidszName31);    
            
num_to_str(tempidszTempid9);    
            
menu_additem(menuszNameszTempid0);   
            
pickisdone++   
        }   
    }    
       
    if (
pickisdone == 0)   
    {   
        
set_task(0.1"StartMatch")   
    }   
    
    
menu_display(cptTmenu);    
    return 
PLUGIN_HANDLED;    
}   

public 
moveT_menu(idmenuitem)    
{    
    if( 
item == MENU_EXIT )    
    {    
        
moveT()   
        return 
PLUGIN_HANDLED;    
    }    
    
    new 
data[6], iName[64];    
    new 
accesscallback;    
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);    
    
    new 
tempid str_to_num(data);   
    new 
name[32]   
       
    
get_user_name(tempidname31)   
       
    
cs_set_user_team(tempidCS_TEAM_T)   
    
    
client_print(0print_chat"%s %s was chosen to be in Terrorists Team by the Terrorists's Captain."name)   
    
menu_destroy(menu);   
    
moveCT() 
    return 
PLUGIN_HANDLED   
}    


public 
moveCT(cptCT)   
{   
    
    new 
menu menu_create("Choose a Player to move to your team:""moveCT_menu");    
    new 
players[32], pnumtempid;    
    new 
szName[32], szTempid[10];    
       
    
get_players(playerspnum"ch");    
           
    for( new 
ii<pnumi++ )    
    {    
        
tempid players[i];   
           
        if(
cs_get_user_team(tempid) == CS_TEAM_SPECTATOR)   
        {   
            
get_user_name(tempidszName31);    
            
num_to_str(tempidszTempid9);    
            
menu_additem(menuszNameszTempid0);   
        }   
    }    
    
    
menu_display(cptCTmenu);    
    return 
PLUGIN_HANDLED;    
}   

public 
moveCT_menu(idmenuitem)    
{    
    if( 
item == MENU_EXIT )    
    {    
        
moveCT()
        return 
PLUGIN_HANDLED;    
    }    
    
    new 
data[6], iName[64];    
    new 
accesscallback;    
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);    
    
    new 
tempid str_to_num(data);   
    new 
name[32]   
       
    
get_user_name(tempidname31)   
       
    
cs_set_user_team(tempidCS_TEAM_T)   
    
    
client_print(0print_chat"%s %s was chosen to be in Counter-Terrorists Team by the Counter-Terrorists's Captain."name)   
    
menu_destroy(menu);   
    
set_task(0.1"move_t")   
    return 
PLUGIN_HANDLED 


fysiks 09-28-2011 18:20

Re: [HELP] Help me with code.
 
Did you even read any of that code? moveCT() is right there. If it's a compiler error saying that it's undefined then you likely have an error with parentheses or braces.

kramesa 09-28-2011 19:58

Re: [HELP] Help me with code.
 
the moveCT is changing player for ct

fysiks 09-29-2011 02:35

Re: [HELP] Help me with code.
 
Quote:

Originally Posted by kramesa (Post 1565008)
the moveCT is changing player for ct

O . k . . . and?


All times are GMT -4. The time now is 19:44.

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