AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Team Random Class (https://forums.alliedmods.net/showthread.php?t=317775)

MayroN 07-29-2019 12:00

Team Random Class
 
I noticed that the shotgun menu selection doesn't work with this code.

That is, press B 2 and immediately written in the center of the screen-now this message remains unavailable

What happened?

PHP Code:

#include <amxmodx>

public plugin_init()
{
    
register_message(get_user_msgid("VGUIMenu"), "message_vgui_menu")
    
register_message(get_user_msgid("ShowMenu"), "message_show_menu")
}
public 
message_vgui_menu(msgiddestid)
{
    switch(
get_msg_arg_int(1))
    {
        case 
2627:
        {
            
set_task(0.0"random_class"id__"a"1)
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_CONTINUE
}
public 
message_show_menu(msgiddestid)
{
    static 
text[6]; get_msg_arg_string(4textcharsmax(text))
    switch(
text[4])
    {
        case 
'r''S':
        {
            
set_task(0.0"random_class"id__"a"1)
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_CONTINUE
}
public 
random_class(id)
{
    switch(
random_num(14))
    {
        case 
1engclient_cmd(id"joinclass""1")
        case 
2engclient_cmd(id"joinclass""2")
        case 
3engclient_cmd(id"joinclass""3")
        case 
4engclient_cmd(id"joinclass""4")
    }




All times are GMT -4. The time now is 17:25.

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