AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Cvar crash + auto show (https://forums.alliedmods.net/showthread.php?t=120820)

Legend 03-08-2010 10:12

Cvar crash + auto show
 
Okay, when I change the cvar that gives health. And I press on the menu I changed the health value to it crashes :S code:

PHP Code:

if( get_pcvar_num(Flashbang_on) == 1) {
new 
health get_pcvar_num(flashhealth);
give_itemid"weapon_flashbang" )
give_itemid"weapon_flashbang" )
set_user_health(idhealth)
g_AlreadyUsed[id] = true
ColorChat
(idRED"[NadeSelector] ^x04You received 2 flashbangs and "get_pcvar_num(flashhealth), " health"); 

I also want to do my plugin so that the menu show up when the round start.

PHP Code:

public round_start(id)
{
    
ColorChat(0RED"[NadeSelector] ^x04Type /grenades to choose your grenades!");
}    


public 
cmdSelectItem(id)
{
    
menu menu_create("\rChoose Item:""playerMenu_ShowSelectionHandler");
    
    
menu_additem(menu"\wFrostnade""1"0);
    
menu_additem(menu"\w2 Flashbangs +50 Health""2"0);
    
menu_additem(menu"\wHE grenade +75 Health""3"0);
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
    if( 
get_user_team(id) == )
        
    if(!
g_AlreadyUsed[id])
        
menu_display(idmenu0);
    
    else
        
    
ColorChat(idRED"[NadeSelector] ^x04You already choosed a grenade this round.")
    
    else
        
    
ColorChat(idRED"[NadeSelector] ^x04You need to be a hider, to choose grenades!")
    return 
PLUGIN_CONTINUE;
    


The menu shall only auto open for terrorist


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

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