AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   script vote interfearing with joining (https://forums.alliedmods.net/showthread.php?t=49163)

One shot dont miss! 12-28-2006 23:25

script vote interfearing with joining
 
1 Attachment(s)
ok its joltpug ported to amxx well whenever someone joins the server and they press 1 or 2 for a team it says "SoandSo has voted to leave teams normal" or its says "SoandSo has voted to random teams" and then the person cant join a team i looked through the code but couldnt find a problem i debug too please someone help me.

One shot dont miss! 12-29-2006 14:31

Re: hey ppl cant join it just votes
 
the only part that is screwing up is this

Code:

}


public vote_teams() {
    new menu_msg[256]
    format(menu_msg,255,"\yTeam type?")
    add(menu_msg,255,"^n^n\y1.\w Leave normal")
    add(menu_msg,255,"^n\y2.\w Random")
    new Float:votetime = get_cvar_float("pug_vote_time") + 10.0
    set_cvar_float("pug_last_voting", get_gametime() + votetime)
    show_menu(0,(1<<0)|(1<<1),menu_msg,floatround(votetime),"Team")
    set_task(votetime,"check_teamvotes",task_teamvote)
    showsay(0,v_team_started)
    //client_print(0,print_chat,v_team_started)
    teamchoice[0]=teamchoice[1]=0
    return PLUGIN_CONTINUE
}

public count_teamvotes(id,key) {
    if(get_cvar_num("pug_vote_answers")==1) {
        new player_name[32]
        get_user_name(id,player_name,31)
        client_print(0,print_chat,"%s voted for %s",player_name,key ?"random teams":"leaving normal")
    }
    ++teamchoice[key]
    return PLUGIN_HANDLED
}

public check_teamvotes() {
    new ms[300]
    if(teamchoice[0] > teamchoice[1]) {
        format(ms,299,v_normal_succes,teamchoice[0])
        showsay(0,ms)
        //client_print(0,print_chat,v_normal_succes, teamchoice[0])
        roundcount=0
        ct_score=0
        t_score=0
        swap_teams=0
        pug_fase=1
        pug_start_fase=1
        set_task(2.0,"start_pug",task_start)
    } else {
        format(ms,299,v_random_succes,teamchoice[1])
        showsay(0,ms)
        //client_print(0,print_chat,v_random_succes, teamchoice[1])
        set_task(1.0,"shuffle_teams",task_shuffle)
    }
    return PLUGIN_HANDLED



All times are GMT -4. The time now is 22:28.

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