PDA

View Full Version : Auto-Mix Plugin Bug, PLEASE HELP.


Tivity
01-03-2017, 20:34
Hello, I've now tried numerous variations of the Auto-Mix plugin and still get the same error:

L 01/03/2017 - 19:56:15: Start of error session.
L 01/03/2017 - 19:56:15: Info (map "de_mirage") (file "addons/amxmodx/logs/error_20170103.log")
L 01/03/2017 - 19:56:15: Plugin called menu_display when item=MENU_EXIT
L 01/03/2017 - 19:56:15: [AMXX] Displaying debug trace (plugin "automix.amxx")
L 01/03/2017 - 19:56:15: [AMXX] Run time error 10: native error (native "menu_display")
L 01/03/2017 - 19:56:15: [AMXX] [0] automix.sma::EndTeamsVote (line 2994)

It seems the problem is that when the Team Organization Vote comes up, if EVERYONE DOES NOT vote, the plugin breaks. Everyone has to vote for some odd reason, I don't understand why.

Here is the section in the .sma that the debug trace found (line 2994 is "show_menu(0, 0, "^n", 1);"):
public EndTeamsVote() {
show_menu(0, 0, "^n", 1); // <--- THIS IS LINE 2994
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:
{
new playersT[32] , numT , playersCt[32] , numCt
get_players( playersT , numT , "che" , "TERRORIST" )
get_players( playersCt , numCt , "che" , "CT" )
g_rVotes[0] = 0
g_rVotes[1] = 0
g_rVotes[2] = 0

if (numT != numCt)
{
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "TEAMS_NOT_BALANCED")
new taskId = scanForTaskID()
set_task(10.0, "RandomTeams", taskId)
return PLUGIN_HANDLED
}

chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "TEAMS_WILL_REMAIN_SAME")
new taskId = scanForTaskID()
set_task(10.0, "CurrentTeams", taskId)
}
case 1:
{
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(10.0, "RandomCpt", taskId)
}
case 2:
{
g_rVotes[0] = 0
g_rVotes[1] = 0
g_rVotes[2] = 0
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "TEAMS_WILL_BE_RANDOM")
new taskId = scanForTaskID()
set_task(10.0, "RandomTeams", taskId)
}
}

return PLUGIN_HANDLED
}



Also, for some strange reason, when I do "Extend Map" the plugin decides to change to a different map.


[k7 Bros'] k7.msi voted to extend the current map.
[k7 Bros'] aTAKA voted to extend the current map.
[k7 Bros'] The current map will be extended for this PUG.
[k7 Bros'] Team organization vote will be started in 10 seconds.
[k7 Bros'] The map will be changed within 10 seconds. Nextmap: de_tuscan.
[k7 Bros'] The map will be changed within 10 seconds. Nextmap: de_tuscan.

Any idea why?

I know I'm asking for a lot of help here, but PLEASE help me. I beg you. I've been trying to fix my server for such a long time now without any luck.

Thank you as always.


Kind regards,
Tivity

Napoleon_be
01-03-2017, 20:58
show entire code pls.

Tivity
01-04-2017, 20:17
Still in need of help! Got a lot fixed, just have one small problem with the Votemap function now. If anyone would like to help, please post below or PM me.

Thanks as always!

EFFx
01-04-2017, 20:23
You can tell us the problem here for we fix it. Because if someone has the same problem, we can give for him/she this thread's link instead of saying the same sh*t.

Tivity
01-04-2017, 20:42
You can tell us the problem here for we fix it. Because if someone has the same problem, we can give for him/she this thread's link instead of saying the same sh*t.

So what I recommended to the original editor of the plugin was to completely remove the Same Teams and Random Teams features from the Team-Organization Vote, so it would automatically go to Random Captains.

We were able to successfully do that, however we are still having problems with the Votemap feature.

For some strange reason, it cannot choose the correct map people voted for.
[k7 Bros'] k7.msi voted for de_dust2.
[k7 Bros'] aTAKA voted for de_dust2.
[k7 Bros'] The map will be changed within 10 seconds. Nextmap: de_dust2.
[k7 Bros'] The map will be changed within 10 seconds. Nextmap: de_tuscan.
[k7 Bros'] The map will be changed within 10 seconds. Nextmap: de_tuscan.

As you can see, the first line correctly chooses the map (de_dust2), but then the next two lines choose a different map from the list (de_tuscan).



Anyone willing to take a shot at fixing the Votemap function?

Here is the code for it below (if you need to see the full .sma, please PM me or add me on Steam (k7og), or view Post #7 (https://forums.alliedmods.net/showthread.php?t=292345#7) (PasteBin)):
public StartVote() {
getmaps()
new rnd
while (g_DoneMaps != 4 && g_MapsCounter > 0) {
rnd = random(g_MapsCounter)
copy(g_MapsChosen[g_DoneMaps++], 19, g_MapsAvailable[rnd])
g_MapsAvailable[rnd] = g_MapsAvailable[--g_MapsCounter]
}

new title[64], extend[64]
formatex(title, charsmax(title), "\r%L", LANG_PLAYER, "CHANGE_MAP")
formatex(extend, charsmax(extend), "\y%L", LANG_PLAYER, "EXTEND_MAP")
g_gVoteMenu = menu_create(title, "votemap");

new num[11]
for(new i = 0; i < g_DoneMaps; i++) {
num_to_str(i, num, 10)
menu_additem(g_gVoteMenu, g_MapsChosen[i], num, 0)
}
menu_additem(g_gVoteMenu, extend, "4", 0)
menu_setprop(g_gVoteMenu, MPROP_EXIT, MEXIT_NEVER)

new players[32], pnum, tempid;
get_players(players, pnum, "ch");
for( new i; i<pnum; i++ ) {
tempid = players[i];
if ( !g_bIsViewingMenu[ tempid ] )
{
menu_display(tempid, g_gVoteMenu)
g_bIsViewingMenu[ tempid ] = true;
}
}
new taskId = scanForTaskID()
set_task(10.0, "EndVote", taskId);
return PLUGIN_HANDLED;
}

public votemap(id, menu, item) {

if ( item == MENU_EXIT || !g_gVoteMenu )
{
return PLUGIN_HANDLED;
}

new data[6], szName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
new voteid = str_to_num(data);
new playerna[32]
get_user_name(id, playerna, 31)

if (voteid != 4)
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "VOTED_MAP", playerna, g_MapsChosen[voteid])
else
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "VOTED_EXTEND", playerna)

g_gVotes[voteid]++;
g_bIsViewingMenu[ id ] = false;
return PLUGIN_HANDLED;
}

public getmaps() {
new mapsfile = fopen(g_Maps_Ini_File, "r")
new linefortest[50]

while (g_MapsCounter < sizeof(g_MapsAvailable) && !feof(mapsfile)) {
fgets(mapsfile, linefortest, 49)
trim(linefortest)

new getcurrentmap[32]
get_mapname(getcurrentmap, 31)

if ((is_map_valid(linefortest)) && (!equali(linefortest, getcurrentmap)))
copy(g_MapsAvailable[g_MapsCounter++], 24, linefortest)
}

fclose(mapsfile)
}

public EndVote() {
show_menu(0, 0, "^n", 1);
new best = 0;
for(new i = 1; i < sizeof(g_gVotes); i++) {
if(g_gVotes[i] > g_gVotes[best])
best = i;
}

g_gVotes[0] = 0
g_gVotes[1] = 0
g_gVotes[2] = 0
g_gVotes[3] = 0
g_gVotes[4] = 0

if(best == 4) {
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "EXTEND_FINAL");
TeamsVote()
}
else {
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "MAP_FINAL", g_MapsChosen[best]);
g_ChangeMapTo = best;

if ( g_CustomGame )
set_pug_state(2)
else
set_pug_state(1)

set_pcvar_string(cvar_sv_password, "")
new taskId = scanForTaskID()
set_task(10.0, "ChangeMap", taskId);
}

return PLUGIN_HANDLED
}

public ChangeMap() {
new maptochangeto[25]

copy(maptochangeto, 24, g_MapsChosen[g_ChangeMapTo])
server_cmd("changelevel %s", maptochangeto)
return PLUGIN_CONTINUE
}

EFFx
01-04-2017, 21:01
Can you upload the automix source code?

Tivity
01-04-2017, 21:08
Can you upload the automix source code?

I've uploaded it to PasteBin.

Here are the two links for it:

Regular Paste - http://pastebin.com/fUTeAnvG
RAW Paste (if Regular is too laggy for you) - http://pastebin.com/raw/fUTeAnvG

EFFx
01-04-2017, 21:13
I don't have any idea what can fix that problem, the best way is wait any scripter better than me.


if(best == 4)
{
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "EXTEND_FINAL");
TeamsVote()
}
else if(best >= 5)
{
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "MAP_FINAL", g_MapsChosen[best]);
g_ChangeMapTo = best;

if ( g_CustomGame )
set_pug_state(2)
else
set_pug_state(1)

set_pcvar_string(cvar_sv_password, "")
new taskId = scanForTaskID()
set_task(10.0, "ChangeMap", taskId);
}
else
{
client_print(0,print_chat,"Your current map will extend");
set_task(10.0,"YourWarmupFunctionNameHere");
best = 0;
}

Have u tried it?

Tivity
01-04-2017, 21:25
I don't have any idea what can fix that problem, the best way is wait any scripter better than me.


if(best == 4)
{
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "EXTEND_FINAL");
TeamsVote()
}
else if(best >= 5)
{
chat_color(0, "!g%s %L", PREFIX, LANG_PLAYER, "MAP_FINAL", g_MapsChosen[best]);
g_ChangeMapTo = best;

if ( g_CustomGame )
set_pug_state(2)
else
set_pug_state(1)

set_pcvar_string(cvar_sv_password, "")
new taskId = scanForTaskID()
set_task(10.0, "ChangeMap", taskId);
}
else
{
client_print(0,print_chat,"Your current map will extend");
set_task(10.0,"YourWarmupFunctionNameHere");
best = 0;
}

Have u tried it?

I personally have very minimal scripting knowledge, I only got in contact with the editor of the plugin and suggested these changes. We are both now having problems with the Votemap function. On his server, players only like to use Extend Map and he would like to change that habit- on my server, however, players always prefer to vote on a map they would like to play. This is why we both need help with this.

EFFx
01-04-2017, 21:36
I have this votemap code here too, I re-made him, you can use him instead of yours.


#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new gMapsIniFile[64],gMapsDisponiveis[30][20],gMapsChosen[4][20],ggVotes[5]
new gMapsCounter,gDoneMaps,gChangeMapTo,ggVoteMen u

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_clcmd("say .votemap","ServerVoteMap")
}
public ServerVoteMap(id)
{
if(access(id,ADMIN_CFG))
{
new szName[33]
get_user_name(id,szName,sizeof(szName))
client_print(0,print_chat,"%s: Votemap executed!",szName)
VoteMap()
}
else
{
client_print(id,print_console,"You have not access to this command!")
}
return PLUGIN_HANDLED
}
public VoteMap()
{
getmaps()
new rnd
while (gDoneMaps != 4 && gMapsCounter > 0)
{
rnd = random(gMapsCounter)
copy(gMapsChosen[gDoneMaps++], 19, gMapsDisponiveis[rnd])
gMapsDisponiveis[rnd] = gMapsDisponiveis[--gMapsCounter]
}

ggVoteMenu = menu_create("Choose your map:","votethemap")

new num[11]
for(new i = 0; i < gDoneMaps; i++)
{
num_to_str(i, num, 10)
menu_additem(ggVoteMenu, gMapsChosen[i], num, 0)
}
menu_additem(ggVoteMenu, "\yExtend the current map", "4", 0)
new players[32], pnum, tempid
get_players(players, pnum, "ch")
for( new i; i<pnum; i++ )
{
tempid = players[i]
menu_display(tempid, ggVoteMenu)
}
set_task(10.0, "EndVote")
return PLUGIN_HANDLED
}


public votethemap(id,menu,item)
{
if(item == MENU_EXIT)
{
menu_display(id, ggVoteMenu)
return PLUGIN_HANDLED
}

new data[6], szName[64]
new access, callback
menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback)
new voteid = str_to_num(data)
new playerna[32]
get_user_name(id, playerna, 31)

if (voteid != 4)
client_print(0,print_chat,"%s has choosed %s for the next map.",playerna,gMapsChosen[voteid])
else
client_print(0,print_chat,"%s has chosed for extend the current map.",playerna)

ggVotes[voteid]++
return PLUGIN_HANDLED
}

public getmaps()
{
get_configsdir(gMapsIniFile, 63)
format(gMapsIniFile, 63, "%s/maps.ini", gMapsIniFile)

new mapsfile = fopen(gMapsIniFile, "r")
new linefortest[50]

while (gMapsCounter < sizeof(gMapsDisponiveis) && !feof(mapsfile))
{
fgets(mapsfile, linefortest, 49)
trim(linefortest)

new getcurrentmap[32]
get_mapname(getcurrentmap, 31)

if ((is_map_valid(linefortest)) && (!equali(linefortest, getcurrentmap)))
copy(gMapsDisponiveis[gMapsCounter++], 24, linefortest)
}

fclose(mapsfile)
}

public EndVote()
{
show_menu(0, 0, "^n", 1)
new best = 0
for(new i = 1; i < sizeof(ggVotes); i++)
{
if(ggVotes[i] > ggVotes[best])
best = i
}

ggVotes[0] = 0
ggVotes[1] = 0
ggVotes[2] = 0
ggVotes[3] = 0
ggVotes[4] = 0

if(best == 4)
{
client_print(0,print_chat,"A new vote will re-run in 10 seconds.")
set_task(10.0,"VoteMap")
}
else if(best >= 5)
{
client_print(0,print_chat,"Votemap finished! The next map will be %s",gMapsChosen[best])
gChangeMapTo = best
}
if(best <= 3)
{
client_print(0,print_chat,"The current map will be extended!")
set_task(10.0,"YourWarmupFunctionNameHere")
best = 0
}
return PLUGIN_HANDLED
}

public ChangeMap()
{
new maptochangeto[25]

remove_task()
copy(maptochangeto, 24, gMapsChosen[gChangeMapTo])
server_cmd("changelevel %s", maptochangeto)
return PLUGIN_CONTINUE
}

EFFx
01-04-2017, 21:46
Wait, this format


if(best == 4)
{
client_print(0,print_chat,"A new vote will re-run in 10 seconds.")
set_task(10.0,"VoteMap")
}
else if(best >= 5)
{
client_print(0,print_chat,"Votemap finished! The next map will be %s",gMapsChosen[best])
gChangeMapTo = best
}
if(best <= 3)
{
client_print(0,print_chat,"The current map will be extended!")
set_task(10.0,"YourWarmupFunctionNameHere")
best = 0
}


Should be


if(best == 4)
{
client_print(0,print_chat,"The current map will be extended!")
set_task(10.0,"YourWarmupFunctionNameHere")
best = 0
}
else
{
client_print(0,print_chat,"Votemap finished! The next map will be %s",gMapsChosen[best])
gChangeMapTo = best
set_task(2.0,"ChangeMap")
}

iNdio
01-06-2017, 11:09
[1]
When players vote for 2. RANDOM CAPTAIN, till the teams are set they must go to SPECTATOR, so this public will be:
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;
}
--- >
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]
Plugin called menu_display when item=MENU_EXIT
[AMXX] Run time error 10: native error (native "menu_display")
To solve this, replace these publics:
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
}
--- >
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. :grrr:

Tivity
01-07-2017, 05:59
[1]
When players vote for 2. RANDOM CAPTAIN, till the teams are set they must go to SPECTATOR, so this public will be:
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;
}
--- >
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]
Plugin called menu_display when item=MENU_EXIT
[AMXX] Run time error 10: native error (native "menu_display")
To solve this, replace these publics:
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
}
--- >
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. :grrr:

You're a legend, thank you! And to you as well EFFx!

EFFx
01-07-2017, 15:15
client_cmd(tempid, "kill")

->


user_sillentkill(tempid)