Raised This Month: $ Target: $400
 0% 

A little help, please.


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
Versus1994
Senior Member
Join Date: Jan 2013
Old 02-03-2013 , 04:50   A little help, please.
#1

Hi, can someone make that this VIPmenu would jump out automaticly 10 sec after the round starts?

Here is the VIPmenu:

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN "HnS - VIP"
#define VERSION "2.0"
 
new bool:jaUsou[ 33 ]

public plugin_init()
{
    register_plugin( PLUGIN, VERSION, "pacheco" )
    register_logevent( "logevent_round_start", 2, "1=Round_Start" )
    register_clcmd( "say /vipmenu","cmdVipMenu" )
}

public logevent_round_start()
    arrayset( jaUsou, false, 33 );

public cmdVipMenu(id)
{
    switch ( jaUsou[id] )
    {
        case true:
        {
            client_print( id, print_center, "Tu jau naudojai VIPMENIU si rounda!" )
            return PLUGIN_CONTINUE;
        }
        
        case false:
        {
            switch ( cs_get_user_team(id) )
            {
                case CS_TEAM_CT: ctVipMenu(id);
                case CS_TEAM_T: ttVipMenu(id);
                default:
                {
                    client_print( id, print_center, "Negali naudot MENIU, jei nesi pasirinkes komandos." )
                    return PLUGIN_CONTINUE;
                }
            }
         jaUsou[id] = true;
        }
    }
    return PLUGIN_HANDLED;
}

public ttVipMenu(id)
{
    new menu = menu_create( "\r[ \yVIP - Terrorist Meniu \r]", "menu_handler" );
    
    menu_additem( menu,"Glock \d(1 kulka)","1", ADMIN_RESERVATION )
    menu_additem( menu,"Nematomumas \d(10sek)","2", ADMIN_RESERVATION )
    menu_additem( menu,"Granatos \d(He, Frost)","3", ADMIN_RESERVATION )
    menu_additem( menu,"HP ir Armoras \d(120HP, 120AP)","4", ADMIN_RESERVATION )
    
    menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
    menu_display( id, menu, 0 );
}

public ctVipMenu(id)
{
    new menu = menu_create( "\r[ \yVIP - CT Meniu \r]", "menu_handler2" );
    
    menu_additem( menu,"HP ir Armoras \d(120HP, 120AP)","1", ADMIN_RESERVATION )
    menu_additem( menu,"Frost Granata","2", ADMIN_RESERVATION )
    menu_additem( menu,"Scout \d(be kulku)","3", ADMIN_RESERVATION )

    menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
    menu_display( id, menu, 0 );
}

public menu_handler(id, menu, item)
{
    if( item == MENU_EXIT )
    {
        menu_destroy(menu);
        return PLUGIN_HANDLED;
    }
    
    new data[6], iName[64];
    new access, callback;
    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
    new key = str_to_num(data);
    
    switch (key)
    {
        case 1:
        {
            new iWeapon = give_item( id, "weapon_glock18" )
            cs_set_weapon_ammo( iWeapon, 1 )
            client_print( id, print_chat, "Tu gavai Glocka su 1 kulka." )
        }
        case 2:
        {
            set_user_rendering( id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 15 );
            set_task( 10.0, "Remover", id )
            client_print( id, print_chat, "Tu esi nematomas 10 sek." )
        }
        case 3:
        {
            give_item( id, "weapon_hegrenade" )
            give_item( id, "weapon_smokegrenade" );
            client_print( id, print_chat, "Tu gavai HE ir Frost granatas." )
        }
        case 4:
        {
            set_user_armor(id, 120)
            set_user_health(id, 120)
            client_print( id, print_chat, "Tu gavai 120HP ir 120AP." )
        }
    }
    
    menu_destroy(menu);
    return PLUGIN_HANDLED;
}

public menu_handler2(id, menu, item)
{
    if( item == MENU_EXIT )
    {
        menu_destroy(menu);
        return PLUGIN_HANDLED;
    }
    
    new data[6], iName[64];
    new access, callback;
    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
    new key = str_to_num(data);
    
    switch (key)
    {
        case 1:
        {
            set_user_health(id, 120)
            set_user_armor(id, 120)
            client_print( id, print_chat, "Tu gavai 120HP ir 120AP." )
        }
        case 2:
        {
            give_item( id, "weapon_smokegrenade" );
            client_print( id, print_chat, "Tu gavai Frost granata." )
        }
        case 3:
        {
            new iWeapon = give_item( id, "weapon_scout" )
            cs_set_weapon_ammo( iWeapon, 0 )
            client_print( id, print_chat, "Tu gavai Scout be kulku." )
        }

    }
    
    menu_destroy(menu);
    return PLUGIN_HANDLED;
}

public Remover(id)
{
    set_user_rendering( id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255 ); 
    client_print( id, print_center, "Tu ir vel matomas!" )
}
I really need it, I tried to do it myself but nothing worked.

Last edited by Versus1994; 02-03-2013 at 04:51.
Versus1994 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-03-2013 , 12:47   Re: A little help, please.
#2

In the round start function, set a task to execute a function that loops through all players and shows the appropriate menu to each.
__________________
fysiks is offline
Versus1994
Senior Member
Join Date: Jan 2013
Old 02-04-2013 , 06:17   Re: A little help, please.
#3

Quote:
Originally Posted by fysiks View Post
In the round start function, set a task to execute a function that loops through all players and shows the appropriate menu to each.
Didn't get that. i'm not good with codes.. when I tried to do it my self I took an other vipmenu that jumps out automaticly and tried to coppy the code.. But for you scripters I dont think that would be hard.

Last edited by Versus1994; 02-04-2013 at 06:18.
Versus1994 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-04-2013 , 21:05   Re: A little help, please.
#4

Nope, probably not hard for experienced scripters but since you posted in the Scripting Help section, you are writing it yourself.

The "new round function" part of my post should be obvious. Then, set_task(). Then use get_players() to loop through all the players and execute the menu's on players:

PHP Code:
            switch ( cs_get_user_team(id) )
            {
                case 
CS_TEAM_CTctVipMenu(id);
                case 
CS_TEAM_TttVipMenu(id);
            } 
__________________

Last edited by fysiks; 02-04-2013 at 21:05.
fysiks is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-06-2013 , 00:45   Re: A little help, please.
#5

@Versus1994
Read rules : https://forums.alliedmods.net/misc.php?do=showrules

Quote:
Use descriptive topic titles. People should know at a glance of the title what the thread is about.

Please change your topic title before you post again.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Versus1994
Senior Member
Join Date: Jan 2013
Old 02-06-2013 , 08:13   Re: A little help, please.
#6

Quote:
Originally Posted by ConnorMcLeod View Post
@Versus1994
Read rules : https://forums.alliedmods.net/misc.php?do=showrules




Please change your topic title before you post again.
okay, sorry.

Quote:
Nope, probably not hard for experienced scripters but since you posted in the Scripting Help section, you are writing it yourself.

The "new round function" part of my post should be obvious. Then, set_task(). Then use get_players() to loop through all the players and execute the menu's on players:

PHP Code:
switch ( cs_get_user_team(id) )
{
case
CS_TEAM_CT: ctVipMenu(id);
case
CS_TEAM_T: ttVipMenu(id);
}
Swisa helped me, I wouldnt made it myself.
Versus1994 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-06-2013 , 11:43   Re: A little help, please.
#7

Closed, you haven't changed title.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Closed Thread


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 20:34.


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