[1]
When players vote for 2. RANDOM CAPTAIN, till the teams are set they must go to SPECTATOR, so this public will be:
PHP Code:
public RandomCpt() {
set_pcvar_num(cvar_mp_freezetime, 9999)
new players[32], pnum, tempid;
get_players(players, pnum, "ch");
new specialCount
for( new i; i<pnum; i++ ) {
tempid = players[i];
client_cmd(tempid, "kill")
if ( cs_get_user_team(tempid) != CS_TEAM_UNASSIGNED )
{
specialCount++
cs_set_user_team(tempid, CS_TEAM_SPECTATOR)
}
}
log_amx("RandomCpt stage 1")
if (specialCount < 2) {
if (g_CustomGame) {
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "LESS_PLAYERS_CUSTOM")
new taskId = scanForTaskID()
set_task(3.0, "RandomTeams", taskId)
}
else {
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "LESS_PLAYERS")
new taskId = scanForTaskID()
set_task(5.0, "EndMatch", taskId)
}
return;
}
log_amx("RandomCpt stage 2")
new z = random(pnum)
while (cs_get_user_team(players[z]) == CS_TEAM_UNASSIGNED)
z = random(pnum)
cs_set_user_team(players[z], CS_TEAM_T)
gCptT = players[z]
new q = random(pnum)
while ( (q == z) || cs_get_user_team(players[q]) == CS_TEAM_UNASSIGNED )
q = random(pnum)
log_amx("RandomCpt stage 3")
cs_set_user_team(players[q], CS_TEAM_CT)
gCptCT = players[q]
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "RANDOM_CAPTAINS_CHOSEN")
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "TERROR_CAPTAIN_FIRST")
g_bCpt = true
log_amx("RandomCpt stage 4")
moveT()
return;
}
--- >
PHP Code:
public RandomCpt() {
set_pcvar_num(cvar_mp_freezetime, 9999)
new players[32], pnum, tempid;
get_players(players, pnum, "ch");
new specialCount
for( new i; i<pnum; i++ ) {
tempid = players[i];
user_silentkill ( tempid );
cs_set_user_team ( tempid, 3 );
if ( cs_get_user_team(tempid) != CS_TEAM_UNASSIGNED )
{
specialCount++
cs_set_user_team(tempid, CS_TEAM_SPECTATOR)
}
}
log_amx("RandomCpt stage 1")
if (specialCount < 2) {
if (g_CustomGame) {
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "LESS_PLAYERS_CUSTOM")
new taskId = scanForTaskID()
set_task(3.0, "RandomTeams", taskId)
}
else {
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "LESS_PLAYERS")
new taskId = scanForTaskID()
set_task(5.0, "EndMatch", taskId)
}
return;
}
log_amx("RandomCpt stage 2")
new z = random(pnum)
while (cs_get_user_team(players[z]) == CS_TEAM_UNASSIGNED)
z = random(pnum)
cs_set_user_team(players[z], CS_TEAM_T)
gCptT = players[z]
new q = random(pnum)
while ( (q == z) || cs_get_user_team(players[q]) == CS_TEAM_UNASSIGNED )
q = random(pnum)
log_amx("RandomCpt stage 3")
cs_set_user_team(players[q], CS_TEAM_CT)
gCptCT = players[q]
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "RANDOM_CAPTAINS_CHOSEN")
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "TERROR_CAPTAIN_FIRST")
g_bCpt = true
log_amx("RandomCpt stage 4")
moveT()
return;
}
[2]
PHP Code:
Plugin called menu_display when item=MENU_EXIT
[AMXX] Run time error 10: native error (native "menu_display")
To solve this, replace these publics:
PHP Code:
public EndTeamsVote() {
show_menu(0, 0, "^n", 1);
new best = 0;
for(new i = 1; i < sizeof(g_rVotes); i++) {
if(g_rVotes[i] > g_rVotes[best])
best = i;
}
switch(best) {
case 0:
{
g_rVotes[0] = 0
g_rVotes[1] = 0
g_rVotes[2] = 0
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "TEAMS_WILL_BE_CAPTAINS")
new taskId = scanForTaskID()
set_task(5.0, "RandomCpt", taskId)
}
}
return PLUGIN_HANDLED
}
--- >
PHP Code:
public EndTeamsVote() {
new best = 0;
for(new i = 1; i < sizeof(g_rVotes); i++) {
if(g_rVotes[i] > g_rVotes[best])
best = i;
}
switch(best) {
case 0:
{
g_rVotes[0] = 0
g_rVotes[1] = 0
g_rVotes[2] = 0
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "TEAMS_WILL_BE_CAPTAINS")
new taskId = scanForTaskID()
set_task(5.0, "RandomCpt", taskId)
}
}
return PLUGIN_HANDLED
}
[3]
Votemap, when it's done I will edit this shit. AUTOMIX = Nr 1 + 2 already modified.