View Single Post
Author Message
AnimalMonster
Senior Member
Join Date: May 2020
Old 10-11-2021 , 09:51   set user info not setting user's info
Reply With Quote #1

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;

Last edited by AnimalMonster; 10-11-2021 at 12:21.
AnimalMonster is offline