This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Need help in ipmenu for hns.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iPro
Junior Member
Join Date: Jun 2012
Old 06-24-2012 , 08:28   Need help in ipmenu for hns.
Reply With Quote #1

I want to add a weapon chance with 1ammo like usp/p228/dual berettas/glock/deagle.(it will pick one and give the weapon to vip).but dont know how /: im starter scipter, and i dont even know how to change ammo, becoz when i add a weapon_usp it gives the usp 12 ammo.
This is my code where i need help: PHP Code:
PHP Code:
#include <amxmodx>
#include <fun> 
#include <cstrike> 
#include <engine> 


#define PLUGIN "HNS VIPMenu"
#define VERSION "1.0"
#define AUTHOR "iPro"


new bool:has_used[33]


public 
plugin_init() 

    
register_clcmd"say /vipmenu""VIPMenu" ); 
    
register_clcmd"say_team /vipmenu""VIPMenu" ); 
    
    
    
register_logevent("event_new_round"2"1=Round_Start"



public 
VIPMenuid 

    if(!
has_used[id]) 
    { 
        if(
get_user_flags(id) & ADMIN_LEVEL_H
        { 
            new 
vip_menu menu_create"\VIP Menu""menu_handler" ); 
            
menu_additemvip_menu"\ 150 HP""1"); 
            
menu_additemvip_menu"\ Granaadid""2"); 
            
menu_additemvip_menu"\ Weapon""3"0); 
            
menu_additemvip_menu"\ Kiirus""4"0); 
            
menu_additemvip_menu"\ Kilp""5"0);  
            
            
menu_setpropvip_menuMPROP_EXITMEXIT_ALL ); 
            
menu_displayidvip_menu); 
        } 
        else 
        { 
            
client_print(idprint_chat"[EstFinHNS] You need to be a vip in order to use this cmd!"
        } 
    } 
    else 
    { 
        
client_print(idprint_chat"[EstFinHNS] You already used vipmenu this round!"
    } 



public 
menu_handleridmenuitem 
{
    if( 
item == MENU_EXIT 
    { 
        
menu_destroymenu ); 
        return 
PLUGIN_HANDLED
    } 
    new 
data[6], iName[64]; 
    new 
accesscallback
    
    
menu_item_getinfomenuitemaccessdata,5iName63callback ); 
    new 
key str_to_numdata ); 
    switch( 
key 
    {
        case 
1
        { 
            if( 
is_user_aliveid ) ) 
            { 
                
set_user_healthid150 ); //Sets health of id to 150 
            

        } 
        case 
2
        { 
            if( 
is_user_aliveid ) ) 
            { 
                
give_itemid"weapon_hegrenade" )
                
            } 
        } 
        case 
3
        { 
            if( 
is_user_aliveid ) ) 
            { 
                
give_itemid"weapon_usp" ); 
            } 
        } 
        case 
4
        { 
            if(
is_user_alive(id)) 
            { 
                
set_user_maxspeed(id320.0);
            }     
        }    
        
        case 
5
        { 
            if(
is_user_alive(id)) 
            { 
                
give_itemid"weapon_flashgrenade" );
            }     
        }
    }
    
    
has_used[id] = true;
    
menu_destroymenu );
    
    return 
PLUGIN_HANDLED;
}


public 
event_new_round() 
    
arrayset(has_usedfalse33

BTW! When i write /vipmenu then it doesn't show me first letters like instead of Weapons, eapons and so on...

Last edited by iPro; 06-24-2012 at 08:55.
iPro is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 06-24-2012 , 08:49   Re: Need help in ipmenu for hns.
Reply With Quote #2

cs_set_weapon_ammo()
cs_set_user_bpammo()
Erox902 is offline
iPro
Junior Member
Join Date: Jun 2012
Old 06-24-2012 , 08:56   Re: Need help in ipmenu for hns.
Reply With Quote #3

Thanks! What about percentage, like respawn chance? Or making so that when you choose case "weapon" you get on of these: usp/p228/dual berettas/glock/deagle. And thank you again for helping.

Last edited by iPro; 06-24-2012 at 08:57.
iPro is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 06-25-2012 , 09:32   Re: Need help in ipmenu for hns.
Reply With Quote #4

Quote:
Originally Posted by iPro View Post
Or making so that when you choose case "weapon" you get on of these: usp/p228/dual berettas/glock/deagle.
You might want to give a link so that I would know what "usp/p228/dual berettas/glock/deagle" is... a .mdl file (guessing)?

the percentage stuff I'm not quite sure you could probably use one of these functions to look like percentage.
random()
random_float()
random_num()
Erox902 is offline
Reply



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 13:12.


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