Raised This Month: $ Target: $400
 0% 

[HELP] Adding feature to VIPmenu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dookie1995
Junior Member
Join Date: Feb 2012
Old 03-10-2012 , 09:18   [HELP] Adding feature to VIPmenu
Reply With Quote #1

I want to add Grenade,2Flashbangs and smoke to the vipmenu as the case 5(fifth function), could you do it for me

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <fun>
#include <cstrike>

#define PLUGIN "VIP Plugin"
#define VERSION "1.0"
#define AUTHOR "Pancakez & Ex1ne :3"


new bool:aOnePrRound[33]
public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("amx_vipmenu""CmdVip")
    
register_clcmd("say /vipmenu""CmdVip")
    
register_clcmd("say_team /vipmenu""CmdVip")
    
register_logevent"eRoundStart"2"1=Round_Start" );
    
set_task(50.0"Advertise")
}
public 
eRoundStart()
{
    new 
iPlayers[32], iNum
    get_players
(iPlayersiNum)
    for(new 
i;iNum;i++)
    {
        
aOnePrRound[iPlayers[i]] = false
    
}
}
public 
CmdVip(id)
{
    if(
get_user_flags(id) & ADMIN_RESERVATION)
    {
        if(
is_user_alive(id))
        {
            if(!
aOnePrRound[id])
            {
                new 
menu menu_create("[\rJailbreak\w] \yVIP:""vip_handler")
                
menu_additem(menu"Health & Armor""1"0)
                
menu_additem(menu"Gravity""2"0)
                
menu_additem(menu"Invisibility""3"0)
                
menu_additem(menu"Speed""4"0)
                
menu_setprop(menuMPROP_EXITMEXIT_ALL)
                
menu_display(idmenu0)
            }
            else 
ColorChat(idGREY"[^4VIP^3] You have allready used your vipmenu for this round.")
        }
    }
    else 
ColorChat(idGREY"[^4VIP^3]You need to be ^4VIP^3 to enter!")
}

public 
vip_handler(idmenuitem)
{
    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 
1GiveHealth(id)
            
        case 
2GiveGravity(id)
            
        case 
3GiveInvis(id)
            
        case 
4GiveSpeed(id)
            
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED
}

public 
GiveHealth(id)
{
    new 
iName[33]
    
get_user_name(idiName31)
    
    if(
is_user_alive(id))
    {
        
set_user_health(id255)
        
set_user_armor(id255)
        
aOnePrRound[id] = true
        ColorChat
(0GREY"[^4VIP^3] ^4%s^3 used the ^4VIP^3 to get ^4Health & Armor^3!")
    }
    else 
ColorChat(idGREY"[^4VIP^3]You need to be ^4alive^3 to use this!")
}

public 
GiveGravity(id)
{
    new 
iName[33]
    
get_user_name(idiName31)
    
    if(
is_user_alive(id))
    {
        
set_user_gravity(id0.4)   
        
aOnePrRound[id] = true
        ColorChat
(0GREY"[^4VIP^3] ^4%s^3 used the ^4VIP^3 to get ^4Gravity^3!")
    }
    else 
ColorChat(idGREY"[^4VIP^3]You need to be ^4alive^3 to use this!")
}

public 
GiveInvis(id)
{
    new 
iName[33]
    
get_user_name(idiName31)
    
    if(
is_user_alive(id))
    {
        
set_user_rendering(id,kRenderFxGlowShell,0,00,kRenderTransAlpha30);
        
aOnePrRound[id] = true
        ColorChat
(0GREY"[^4VIP^3] ^4%s^3 used the ^4VIP^3 to get ^4Invisibility^3!")
    }
    else 
ColorChat(idGREY"[^4VIP^3]You need to be ^4alive^3 to use this!")
}

public 
GiveSpeed(id)
{
    new 
iName[33]
    
get_user_name(idiName31)
    
    if(
is_user_alive(id))
    {
        
set_user_maxspeed(id450.0)
        
aOnePrRound[id] = true
        ColorChat
(0GREY"[^4VIP^3] ^4%s^3 used the ^4VIP^3 to get ^4Speed^3!")
    }
    else 
ColorChat(idGREY"[^4VIP^3]You need to be ^4alive^3 to use this!")

Dookie1995 is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 03-10-2012 , 09:54   Re: [HELP] Adding feature to VIPmenu
Reply With Quote #2

1.menu_additem(menu, "Nades", "5", 0)
2.case 5: GiveNades(id)
3.public GiveNades(id)
Check if player is alive , then give him what ever you want
EpicMonkey is offline
Dookie1995
Junior Member
Join Date: Feb 2012
Old 03-10-2012 , 12:25   Re: [HELP] Adding feature to VIPmenu
Reply With Quote #3

Dude, i don't know jack about doing those codes, and how/where to place them, could you please make it for me ?
Dookie1995 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 03-10-2012 , 13:26   Re: [HELP] Adding feature to VIPmenu
Reply With Quote #4

Since you don't know how to code, post in the request section.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
demon81
Member
Join Date: Sep 2010
Location: Portugal
Old 03-10-2012 , 14:00   Re: [HELP] Adding feature to VIPmenu
Reply With Quote #5

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <fun>
#include <cstrike>

#define PLUGIN "VIP Plugin"
#define VERSION "1.0"
#define AUTHOR "Pancakez & Ex1ne :3"


new bool:aOnePrRound[33]
public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("amx_vipmenu""CmdVip")
    
register_clcmd("say /vipmenu""CmdVip")
    
register_clcmd("say_team /vipmenu""CmdVip")
    
register_logevent"eRoundStart"2"1=Round_Start" );
    
set_task(50.0"Advertise")
}
public 
eRoundStart()
{
    new 
iPlayers[32], iNum
    get_players
(iPlayersiNum)
    for(new 
i;iNum;i++)
    {
        
aOnePrRound[iPlayers[i]] = false
    
}
}
public 
CmdVip(id)
{
    if(
get_user_flags(id) & ADMIN_RESERVATION)
    {
        if(
is_user_alive(id))
        {
            if(!
aOnePrRound[id])
            {
                new 
menu menu_create("[\rJailbreak\w] \yVIP:""vip_handler")
                
menu_additem(menu"Health & Armor""1"0)
                
menu_additem(menu"Gravity""2"0)
                
menu_additem(menu"Invisibility""3"0)
                
menu_additem(menu"Speed""4"0)
           
menu_additem(menu"Nades""5"0)
                
menu_setprop(menuMPROP_EXITMEXIT_ALL)
                
menu_display(idmenu0)
            }
            else 
ColorChat(idGREY"[^4VIP^3] You have allready used your vipmenu for this round.")
        }
    }
    else 
ColorChat(idGREY"[^4VIP^3]You need to be ^4VIP^3 to enter!")
}

public 
vip_handler(idmenuitem)
{
    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 
1GiveHealth(id)
            
        case 
2GiveGravity(id)
            
        case 
3GiveInvis(id)
            
        case 
4GiveSpeed(id)
        
    case 
5GiveNades(id)
            
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED
}

public 
GiveHealth(id)
{
    new 
iName[33]
    
get_user_name(idiName31)
    
    if(
is_user_alive(id))
    {
        
set_user_health(id255)
        
set_user_armor(id255)
        
aOnePrRound[id] = true
        ColorChat
(0GREY"[^4VIP^3] ^4%s^3 used the ^4VIP^3 to get ^4Health & Armor^3!")
    }
    else 
ColorChat(idGREY"[^4VIP^3]You need to be ^4alive^3 to use this!")
}

public 
GiveGravity(id)
{
    new 
iName[33]
    
get_user_name(idiName31)
    
    if(
is_user_alive(id))
    {
        
set_user_gravity(id0.4)   
        
aOnePrRound[id] = true
        ColorChat
(0GREY"[^4VIP^3] ^4%s^3 used the ^4VIP^3 to get ^4Gravity^3!")
    }
    else 
ColorChat(idGREY"[^4VIP^3]You need to be ^4alive^3 to use this!")
}

public 
GiveInvis(id)
{
    new 
iName[33]
    
get_user_name(idiName31)
    
    if(
is_user_alive(id))
    {
        
set_user_rendering(id,kRenderFxGlowShell,0,00,kRenderTransAlpha30);
        
aOnePrRound[id] = true
        ColorChat
(0GREY"[^4VIP^3] ^4%s^3 used the ^4VIP^3 to get ^4Invisibility^3!")
    }
    else 
ColorChat(idGREY"[^4VIP^3]You need to be ^4alive^3 to use this!")
}

public 
GiveSpeed(id)
{
    new 
iName[33]
    
get_user_name(idiName31)
    
    if(
is_user_alive(id))
    {
        
set_user_maxspeed(id450.0)
        
aOnePrRound[id] = true
        ColorChat
(0GREY"[^4VIP^3] ^4%s^3 used the ^4VIP^3 to get ^4Speed^3!")
    }
    else 
ColorChat(idGREY"[^4VIP^3]You need to be ^4alive^3 to use this!")

public 
GiveNades(id)
{
    new 
iName[33]
    
get_user_name(idiName31)
    
    if(
is_user_alive(id))
    {
        
give_itemid"weapon_flashbang")
        
give_itemid"weapon_hegrenade")
        
give_itemid"weapon_smokegrenade")
        
aOnePrRound[id] = true
        ColorChat
(0GREY"[^4VIP^3] ^4%s^3 used the ^4VIP^3 to get ^4Nades^3!")
    }
    else 
ColorChat(idGREY"[^4VIP^3]You need to be ^4alive^3 to use this!")

demon81 is offline
WarZ
Member
Join Date: Aug 2006
Old 03-10-2012 , 17:18   Re: [HELP] Adding feature to VIPmenu
Reply With Quote #6

Dont you need to add how many flashbangs you gonna give?
__________________
WarZ is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 03-10-2012 , 22:27   Re: [HELP] Adding feature to VIPmenu
Reply With Quote #7

PHP Code:
        give_itemid"weapon_flashbang"
        
give_itemid"weapon_hegrenade"
        
give_itemid"weapon_smokegrenade")               
        
cs_set_user_bpammo(idCSW_FLASHBANG2)
        
cs_set_user_bpammo(idCSW_HEGRENADE1)         
        
cs_set_user_bpammo(idCSW_SMOKEGRENADE1
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd 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 01:40.


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