Raised This Month: $ Target: $400
 0% 

1st round no menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 10-08-2010 , 10:42   1st round no menu
Reply With Quote #1

How i Can do that my menu not pop up on first round, it's pop up only on 2nd round.
__________________
Still studying scripting...
zirualas is offline
Send a message via Skype™ to zirualas
reinert
Veteran Member
Join Date: Feb 2007
Old 10-08-2010 , 11:27   Re: 1st round no menu
Reply With Quote #2

create variable: round... then hook event round start, and check if(round > 1) then show menu else don't.
reinert is offline
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 10-08-2010 , 11:35   Re: 1st round no menu
Reply With Quote #3

Ok I trying to do something but i having error.
Code:
PHP Code:
#include <amxmodx> 
#include <amxconst>
#include <cstrike>
#include <fun> 
#include <hamsandwich> 
#include <colorchat>

#define AUTHOR <zirual>
#define VERSION <1.0>
#define PLUGIN <Vip menu>
 

public plugin_init()
{
    
register_plugin("Vipmenu","1.0","Zirual");
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);
    
RegisterHam(Ham_Spawn"player""runda"1)
    
register_logevent("event_new_round"2"1=Round_Start"
}
public 
runda(id)
{
    
set_user_rendering(idkRenderFxNone255255255kRenderTransAlpha255); 
}
public 
fwHamPlayerSpawnPost(id
{
    if(
get_user_flags(id) & ADMIN_LEVEL_H)
    {
        new 
menu menu_create("\gVipmenu:""menu_handler"); 
     
        
menu_additem(menu"\r +2500\w Dollars""1"0);
        
menu_additem(menu"\w Granades""2"0);
        
menu_additem(menu"\w Low Gravity""3"0);
        
menu_additem(menu"\w Tactical Shield""4"0);
        
menu_additem(menu"\w 75% Visibility""5"0);
     
        
menu_setprop(menuMPROP_EXITMEXIT_ALL
        
menu_display(idmenu0);
    }
    else
    {
    
ColorChat(idGREEN"^x03[V.I.P]^x01Wanna VIP? Say /vip")
    } 


public 
menu_handler(idmenuitem

    if( 
item == MENU_EXIT 
    { 
        
menu_destroy(menu); 
        return 
PLUGIN_HANDLED
    } 
     
    new 
data[6], iName[64]; 
    new 
acesscallback
     
    
menu_item_getinfo(menuitemacessdata,6iName63callback); 
    new 
key str_to_num(data); 
     
    switch(
key
    { 
        case 
:
        {
        
cs_set_user_money(id cs_get_user_money(id) + 25000)
    }
        case 

        {
        
give_item(id"weapon_smokegrenade")
        
give_item(id"weapon_flashbang")
        
give_item(id"weapon_flashbang")
        
give_item(id"weapon_hegrenade")
        } 
        case 

        {  
        
set_user_gravity(id0.7)
    }
        case 

    {
        
give_item(id"weapon_shield")
    }
    case 
:
    {
        
set_user_rendering(idkRenderFxNone255255255kRenderTransAlpha191);
    } 
    }

    
menu_destroy(menu); 
    return 
PLUGIN_HANDLED;
}


public 
event_new_round() 
Error:
PHP Code:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// vipmenu[pb].sma
// G:\Program Files\Valve\cstrike\addons\amxmodx\scripting\vipmenu[pb].sma(91) :
 
error 036: empty statement
//
// 1 Error.
// Could not locate output file G:\Program Files\Valve\cstrike\addons\amxmodx\sc
ripting\compiled\vipmenu[pb].amx (compile failed).
//
// Compilation Time: 0,17 sec
// ----------------------------------------

Press enter to exit ... 
__________________
Still studying scripting...
zirualas is offline
Send a message via Skype™ to zirualas
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 10-08-2010 , 12:20   Re: 1st round no menu
Reply With Quote #4

Quote:
RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1);
RegisterHam(Ham_Spawn, "player", "runda", 1)
Why do you define same thing twice?

And:
Code:
#include <amxmodx> #include <amxmisc> new bool:firstround = true; public plugin_init(){     register_plugin("plugin","1.0","naven")     register_event("HLTV", "Nowa_Runda", "a", "1=0", "2=0")     } public Nowa_Runda() {     if(firstround)     {     //do something(first round)     firstround = false; //set to false so it won't happen anymore     }else     {         //other rounds     }     }
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 10-08-2010 , 14:34   Re: 1st round no menu
Reply With Quote #5

I don't understand ;[
__________________
Still studying scripting...
zirualas is offline
Send a message via Skype™ to zirualas
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-08-2010 , 15:31   Re: 1st round no menu
Reply With Quote #6

Do they only spawn once per round? Do you want the menu to open on spawn or on new round?
__________________
fysiks is offline
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 10-09-2010 , 02:53   Re: 1st round no menu
Reply With Quote #7

I want what menu pop up only on round start and menu show up only on 2nd round
__________________
Still studying scripting...
zirualas is offline
Send a message via Skype™ to zirualas
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 10-09-2010 , 06:58   Re: 1st round no menu
Reply With Quote #8

Try this.

PHP Code:
#include <amxmodx> 
#include <amxconst>
#include <cstrike>
#include <fun> 
#include <hamsandwich> 
#include <colorchat>

new Rounds;

public 
plugin_init()
{
    
register_plugin("Vipmenu","1.0","Zirual");
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);
    
RegisterHam(Ham_Spawn"player""runda"1)
    
register_logevent("event_new_round"2"1=Round_Start"
}
public 
runda(id) {
    
set_user_rendering(idkRenderFxNone255255255kRenderTransAlpha255); 
}
public 
fwHamPlayerSpawnPost(id)  {
    if(
get_user_flags(id) & ADMIN_LEVEL_H && Rounds 1) {
        new 
menu menu_create("\gVipmenu:""menu_handler"); 
        
        
menu_additem(menu"\r +2500\w Dollars""1"0);
        
menu_additem(menu"\w Granades""2"0);
        
menu_additem(menu"\w Low Gravity""3"0);
        
menu_additem(menu"\w Tactical Shield""4"0);
        
menu_additem(menu"\w 75% Visibility""5"0);
        
        
menu_setprop(menuMPROP_EXITMEXIT_ALL
        
menu_display(idmenu0);
    } else {
        
ColorChat(idGREEN"^x03[V.I.P]^x01Wanna VIP? Say /vip")
    } 


public 
menu_handler(idmenuitem

    if( 
item == MENU_EXIT 
    { 
        
menu_destroy(menu); 
        return 
PLUGIN_HANDLED
    } 
    
    new 
data[6], iName[64]; 
    new 
acesscallback
    
    
menu_item_getinfo(menuitemacessdata,6iName63callback); 
    new 
key str_to_num(data); 
    
    switch(
key
    { 
        case 
:
        {
            
cs_set_user_money(id cs_get_user_money(id) + 25000)
        }
        case 

        {
            
give_item(id"weapon_smokegrenade")
            
give_item(id"weapon_flashbang")
            
give_item(id"weapon_flashbang")
            
give_item(id"weapon_hegrenade")
        } 
        case 

        {  
            
set_user_gravity(id0.7)
        }
        case 

        {
            
give_item(id"weapon_shield")
        }
        case 
:
        {
            
set_user_rendering(idkRenderFxNone255255255kRenderTransAlpha191);
        } 
    }
    
    
menu_destroy(menu); 
    return 
PLUGIN_HANDLED;
}


public 
event_new_round()
    
Rounds++; 
__________________
Retired.
Xalus is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 10-09-2010 , 07:00   Re: 1st round no menu
Reply With Quote #9

Try this:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun> 
#include <hamsandwich> 
#include <colorchat>

#define AUTHOR <zirual>
#define VERSION <1.0>
#define PLUGIN <Vip menu>
 
new g_Round;

public 
plugin_init()
{
    
register_plugin("Vipmenu","1.0","Zirual");
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);
    
register_event("HLTV","evRoundStart","a","1=0","2=0");
}

public 
evRoundStart()
{
    
g_Round += 1;
}

public 
fwHamPlayerSpawnPost(id
{
    
set_user_rendering(idkRenderFxNone255255255kRenderTransAlpha255);
    
    if( 
g_Round != )
    return 
PLUGIN_HANDLED;
    
    if(
get_user_flags(id) & ADMIN_LEVEL_H)
    {
        new 
menu menu_create("\gVipmenu:""menu_handler"); 
     
        
menu_additem(menu"\r +2500\w Dollars""1"0);
        
menu_additem(menu"\w Granades""2"0);
        
menu_additem(menu"\w Low Gravity""3"0);
        
menu_additem(menu"\w Tactical Shield""4"0);
        
menu_additem(menu"\w 75% Visibility""5"0);
     
        
menu_setprop(menuMPROP_EXITMEXIT_ALL
        
menu_display(idmenu0);
    }
    else
    {
        
ColorChat(idGREEN"^x03[V.I.P]^x01Wanna VIP? Say /vip")
    } 


public 
menu_handler(idmenuitem

    if( 
item == MENU_EXIT 
    { 
        
menu_destroy(menu); 
        return 
PLUGIN_HANDLED
    } 
     
    new 
data[6], iName[64]; 
    new 
acesscallback
     
    
menu_item_getinfo(menuitemacessdata,6iName63callback); 
    new 
key str_to_num(data); 
     
    switch(
key
    { 
        case 
:
        {
            
cs_set_user_money(id cs_get_user_money(id) + 25000)
        }
        case 

        {
            
give_item(id"weapon_smokegrenade")
            
give_item(id"weapon_flashbang")
            
give_item(id"weapon_flashbang")
            
give_item(id"weapon_hegrenade")
        } 
        case 

        {  
            
set_user_gravity(id0.7)
        }
        case 

        {
            
give_item(id"weapon_shield")
        }
        case 
:
        {
            
set_user_rendering(idkRenderFxNone255255255kRenderTransAlpha191);
        } 
    }

    
menu_destroy(menu); 
    return 
PLUGIN_HANDLED;

EDIT: So do you actually only want the menu to come up on the second round or the second round and every round after?
hornet is offline
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 10-09-2010 , 07:14   Re: 1st round no menu
Reply With Quote #10

Working, thx very much ;]
__________________
Still studying scripting...
zirualas is offline
Send a message via Skype™ to zirualas
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 10:23.


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