AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help me (https://forums.alliedmods.net/showthread.php?t=173145)

RuRuRu612754 12-01-2011 03:25

help me
 
Do I have wrong?

PHP Code:

#include <amxmodx>

public plugin_init()
{
    
register_plugin("PLUGIN""VERSION""AUTHOR")
}

public 
client_connectid )
{
    if(
is_user_bot && is_user_hltv)
    {
        
query_client_cvar(id"fps_max""check_cl_rate")
    }
}

public 
check_cl_rate(id, const cvar[], const value[])
{
    new 
iValue str_to_num(value)

    if(
iValue 100)
    {
        
set_task(30.0"fc_menu_set")
    }
}

public 
fc_menu_set(id)
{
    new 
menu menu_create("\FPS Checker Menu :""fc_menu")

    
menu_additem(menu"\wYes""1"0)
    
menu_additem(menu"\wNo""2"0)

    
menu_display(idmenu0)
}

public 
fc_menu(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
    }

    new 
data[6], szName[64]
    new 
accesscallback

    menu_item_getinfo
(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback)

    new 
key str_to_num(data)

    switch(
key)
    {
        case 
1:
        {
            
client_fps(id)
        }
        case 
2:
        {
            
client_kick(id)
        }
    }
    
menu_destroy(menu)
}

public 
client_fps(id)
{
    
client_cmd(id"fps_max 101")
}

public 
client_kick(id)
{
    
client_cmd(id"disconnect")



Devil259 12-01-2011 03:36

Re: help me
 
if(iValue > 100)

->

if(iValue > 101)



if(is_user_bot && is_user_hltv)

->

if( !is_user_bot( id ) && !is_user_hltv( id ) )



set_task(30.0, "fc_menu_set")

->

set_task(30.0, "fc_menu_set", id)

RuRuRu612754 12-01-2011 03:44

Re: help me
 
Devil259

thanks
To remove the exit of the menu is what will we do?

joshknifer 12-01-2011 12:15

Re: help me
 
The menu doesnt seem to be very clear...is the client being told what the yes and no are for?

RuRuRu612754 12-01-2011 20:46

Re: help me
 
"yes" and "no" and "exit" is not in the three selected
"yes" and "no" is just to set the menu?

RuRuRu612754 12-01-2011 20:47

Re: help me
 
FPS Checker Menu :
1. Yes
2. No

0.Exit

FPS Checker Menu :
1. Yes
2. No


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

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