Raised This Month: $12 Target: $400
 3% 

[HELP] Vipmenu spamming


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dookie1995
Junior Member
Join Date: Feb 2012
Old 03-08-2012 , 13:59   [HELP] Vipmenu spamming
Reply With Quote #1

So i have the vipmenu, which has to work once in round when you write /vipmenu, but it works every second and i can choose those functions again and again, for e.x. Health & Armor, if someone shoots me i can just press the button again and again, the health will be coming, so i want some script which will allow /vipmenu appear only once in round, here's the script.

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"


public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_clcmd("say /vipmenu", "CmdVip")
    register_clcmd("say_team /vipmenu", "CmdVip")
    
    set_task(50.0, "Advertise")
}

public CmdVip(id)
{
    if(get_user_flags(id) & ADMIN_CFG)
    {
        if(is_user_alive(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(menu, MPROP_EXIT, MEXIT_ALL)
            menu_display(id, menu, 0)
        }
    }
    else ColorChat(id, GREY, "[^4VIP^3]You need to be ^4VIP^3 to enter!")
}

public vip_handler(id, menu, item)
{
    new data[6], szName[64];
    new access, callback;
    menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
    new key = str_to_num(data);
    switch(key)
    {
        case 1: GiveHealth(id)
            
        case 2: GiveGravity(id)
            
        case 3: GiveInvis(id)
        
        case 4: GiveSpeed(id)
        
    }
    menu_destroy(menu);
    return PLUGIN_HANDLED
}

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

public GiveGravity(id)
{
    new iName[33]
    get_user_name(id, iName, 31)
    
    if(is_user_alive(id))
    {
        set_user_gravity(id, 0.4)     
        ColorChat(0, GREY, "[^4VIP^3] ^4%s^3 used the ^4VIP^3 to get ^4Gravity^3!")
    }
    else ColorChat(id, GREY, "[^4VIP^3]You need to be ^4alive^3 to use this!")
}

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

public GiveSpeed(id)
{
    new iName[33]
    get_user_name(id, iName, 31)
    
    if(is_user_alive(id))
    {
        set_user_maxspeed(id, 520.0)
        ColorChat(0, GREY, "[^4VIP^3] ^4%s^3 used the ^4VIP^3 to get ^4Speed^3!")
    }
    else ColorChat(id, GREY, "[^4VIP^3]You need to be ^4alive^3 to use this!")
}
Dookie1995 is offline
Ex1ne
Senior Member
Join Date: Oct 2011
Location: Norway
Old 03-08-2012 , 14:50   Re: [HELP] Vipmenu spamming
Reply With Quote #2

Untested
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("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_CFG)
    {
        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(id520.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!")

__________________
Ex1ne is offline
Zer0Cool
Member
Join Date: Sep 2011
Location: Belgium
Old 03-09-2012 , 05:33   Re: [HELP] Vipmenu spamming
Reply With Quote #3

PHP Code:
#define AUTHOR "Pancakez & Ex1ne :3" 
Damn you take author credits for that small easy code -_-
__________________
- Ol' Dirty Bastard - Brooklyn Zoo -

This style, I'm mastered in
Niggas catchin' headaches, what, what? You need Aspirin?
This type of pain, you couldn't even kill with Midol
Fuck around, get sprayed with Lysol
in your face like a can of mace, baby
Is it burnin'? Well, fuck it, now you're learnin'


Last edited by Zer0Cool; 03-09-2012 at 05:36.
Zer0Cool 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 22:03.


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