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], pnum, tempid;
get_players(players, pnum, "ch");
for( new i; i<pnum; i++ )
{
tempid = players[i];
cs_set_user_team(tempid, CS_TEAM_SPECTATOR)
}
new z = random_num(0, pnum)
cs_set_user_team(players[z], CS_TEAM_T)
new q = random_num(0, pnum)
while (q == z)
{
q = random_num(0, pnum)
}
cs_set_user_team(players[q], CS_TEAM_CT)
client_print(0, print_chat, "%s Random captains were chosen, The captains will now choose their teammates.")
client_print(0, print_chat, "%s Terrorists's Captain, please choose first.")
Tpick()
}
public Tpick()
{
new players[10], pnum, tempid;
get_players(players, pnum, "ch");
for( new i; i<pnum; i++ )
{
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], pnum, tempid;
new szName[32], szTempid[10];
new pickisdone
get_players(players, pnum, "ch");
for( new i; i<pnum; i++ )
{
tempid = players[i];
if (cs_get_user_team == CS_TEAM_SPECTATOR)
{
get_user_name(tempid, szName, 31);
num_to_str(tempid, szTempid, 9);
menu_additem(menu, szName, szTempid, 0);
pickisdone++
}
}
if (pickisdone == 0)
{
set_task(0.1, "StartMatch")
}
menu_display(cptT, menu);
return PLUGIN_HANDLED;
}
public moveT_menu(id, menu, item)
{
if( item == MENU_EXIT )
{
moveT()
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new tempid = str_to_num(data);
new name[32]
get_user_name(tempid, name, 31)
cs_set_user_team(tempid, CS_TEAM_T)
client_print(0, print_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], pnum, tempid;
new szName[32], szTempid[10];
get_players(players, pnum, "ch");
for( new i; i<pnum; i++ )
{
tempid = players[i];
if(cs_get_user_team(tempid) == CS_TEAM_SPECTATOR)
{
get_user_name(tempid, szName, 31);
num_to_str(tempid, szTempid, 9);
menu_additem(menu, szName, szTempid, 0);
}
}
menu_display(cptCT, menu);
return PLUGIN_HANDLED;
}
public moveCT_menu(id, menu, item)
{
if( item == MENU_EXIT )
{
moveCT()
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new tempid = str_to_num(data);
new name[32]
get_user_name(tempid, name, 31)
cs_set_user_team(tempid, CS_TEAM_T)
client_print(0, print_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