AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved set user info not setting user's info (https://forums.alliedmods.net/showthread.php?t=334661)

AnimalMonster 10-11-2021 09:51

set user info not setting user's info
 
Nvm, the problem is other
that i put somewhere to set info of the user "_vgui_menus" 0 and then "_vgui_menus" 1 after they pressed one of the buttons but for some reason it doesn't change.

Edit: More info, so, the plugin i told you about is a gender chooser which on putinserver displays a menu where you choose your gender, after you change it you are automatically put in a team and setted class and sets your info "_vgui_menus" to 1 but i see it doesn't set, why?

Code:

public client_putinserver(id)
{
        if(is_user_bot(id))
                g_iGender[id] = random_num(1, 2)
        else {
                set_user_info(id, "_vgui_menus", "0")
                set_task(0.1, "joined", TASK_JOIN+id)
        }
}

public ask(id)
{
        new text[200]
       
        format(text, charsmax(text), "\yChoose \wyour \rgender\w!^n^n\r1. \yMale^n\r2. \yFemale")
       
        show_menu(id, keys, text, _, "gendermenu")
}

public heheok(id, item)
{
        switch(item)
        {
                case 0:{
                        g_iGender[id] = 1
                        set_task(0.1, "jointeam", id)
                }
                case 1:{
                        g_iGender[id] = 2
                        set_task(0.1, "jointeam", id)
                }
        }
}

public jointeam(id)
{
        new randnum = cso_round_started()
       
        //engclient_cmd(id, "jointeam", randnum ? "1" : "2")
        //rg_set_user_team(id, , randnum ? MODEL_CT_GIGN : MODEL_T_GUERILLA, true, false)
        rg_join_team(id, randnum ? TEAM_CT : TEAM_TERRORIST)
        show_menu(id, 0, "")
        engclient_cmd(id, "joinclass", "1")
        set_user_info(id, "_vgui_menus", "1")
       
        set_task(1.0, "respawn", id)
}

public joined(id)
{
        id -= TASK_JOIN
        ask(id)
}

Solved: hooked "buy" and put the function of my buymenu in then returned PLUGIN_HANDLED;


All times are GMT -4. The time now is 03:08.

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