View Single Post
andrept4
Senior Member
Join Date: Dec 2012
Location: Portugal
Old 07-13-2018 , 18:09   Re: [CS:GO] Respawn Players Menu
Reply With Quote #3

Quote:
Originally Posted by Kailo View Post
My notes:
1) This is menus.inc and adminmenu.inc are included by sourcemod.inc
sourcemod.inc are included by compiler by default
2) Don't mix syntax
Code:
public OnPluginStart() // Old syntax
public void OnPluginStart()
3) Menus have exitbutton true by default
Code:
menu.ExitButton = true;
4) Remove it?
Code:
case MenuAction_Start:{}
5) Just use menu.SetTitle(), but for that you need to update it? You can just set it on creation like you did.
Code:
case MenuAction_Display:
{
    Panel panel = view_as<Panel>(param2);
    panel.SetTitle("Reviver Jogador");
}
6) This will cause error (invalid handle) when menu canceled.
Close menu only in End action.
PHP Code:
case MenuAction_Cancel:
{
    
delete menu;
}
case 
MenuAction_End:
{
    
delete menu;

7) you can pass NULL_STRING and 0 for info buffer. (Again, why you use this callback action and why 'MENU_ACTIONS_ALL', may be just remove?)
PHP Code:
case MenuAction_DrawItem:
{
    
int style;
    
menu.GetItem(param2NULL_STRING0style);

    return 
style;

Thank you alot for the help
__________________
andrept4 is offline