Raised This Month: $ Target: $400
 0% 

Cvar crash + auto show


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Legend
Member
Join Date: Mar 2010
Location: Denmark
Old 03-08-2010 , 10:12   Cvar crash + auto show
Reply With Quote #1

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
__________________
Legend is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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