Raised This Month: $ Target: $400
 0% 

Set user gravity for long time and not closing menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cTn
Senior Member
Join Date: Oct 2005
Old 11-01-2005 , 11:33   Set user gravity for long time and not closing menu
Reply With Quote #1

there is one of m menu definitions
Code:
case 2: {
			set_user_gravity( id, 0.5) 
			set_hudmessage(100, 200, 0, 0.03, 0.24, 0, 0.0, 0.0, 4.0, 10.0,1)
			show_hudmessage(id,"cTn stuff: Gravity 50%" )
			console_cmd( id, "amx_ctnstuff2" )
			return PLUGIN_HANDLED
i can enable 50% gravity in game for me but in new round i have m old gravity so i must open menu and pres the button for getting gravity ... is any way to doo this just one time?

and problem numb 2

Code:
// Menu 2

public ShowMenu2( id ) { 
	if (!(get_user_flags(id)&ADMIN_LEVEL_A)) { 
		
		return PLUGIN_HANDLED 
	} 
	new szMenuBody[256] 
	new keys 
	
	new nLen = format( szMenuBody, 255, "\ySecond Menu:^n" ) 
	nLen += format( szMenuBody[nLen], 255-nLen, "^n\w1. Killing mix 1" ) 
	nLen += format( szMenuBody[nLen], 255-nLen, "^n\w2. Killing mix 2" ) 
	nLen += format( szMenuBody[nLen], 255-nLen, "^n\w3. Gravity 50%" ) 
	nLen += format( szMenuBody[nLen], 255-nLen, "^n\w4. Money 16000" ) 
	nLen += format( szMenuBody[nLen], 255-nLen, "^n\w5. GLOW OFF" ) 
	nLen += format( szMenuBody[nLen], 255-nLen, "^n\w6. Alien mode" ) 
	nLen += format( szMenuBody[nLen], 255-nLen, "^n\w7. Alpha render 5%" ) 
	nLen += format( szMenuBody[nLen], 255-nLen, "^n\w8. Alpha render 0" ) 
	nLen += format( szMenuBody[nLen], 255-nLen, "^n\w9. Back" ) 
	nLen += format( szMenuBody[nLen], 255-nLen, "^n^n\w0. Exit" ) 
	
	keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9) 
	
	show_menu( id, keys, szMenuBody, -1 ) 
	
	return PLUGIN_CONTINUE 
} 

public MenuCommand2( id, key ) { 
	
	switch( key ) { 
		
		case 0: {
			strip_user_weapons( id )
			give_item( id, "weapon_m4a1" )
			give_item( id, "weapon_m4a1" ) 
			give_item( id, "weapon_m4a1" )
			give_item( id, "weapon_deagle" )
			give_item( id, "weapon_deagle" )
			give_item( id, "weapon_deagle" )
			give_item( id, "weapon_deagle" )
			give_item( id, "weapon_hegrenade" )
			give_item( id, "weapon_smokegrenade" )
			give_item( id, "weapon_flashbang" )
			give_item( id, "weapon_flashbang" )
			give_item( id, "weapon_knife" )
			set_user_armor( id, 100 )
			set_hudmessage(100, 200, 0, 0.03, 0.24, 0, 0.0, 0.0, 4.0, 10.0,1)
			show_hudmessage(id,"cTn stuff: Killing mix1" )
			console_cmd( id, "amx_ctnstuff2" )
			return PLUGIN_HANDLED 
		}
		case 1: {
			strip_user_weapons( id )
			give_item( id, "weapon_ak47" )
			give_item( id, "weapon_ak47" ) 
			give_item( id, "weapon_ak47" )
			give_item( id, "weapon_deagle" )
			give_item( id, "weapon_deagle" )
			give_item( id, "weapon_deagle" )
			give_item( id, "weapon_deagle" )
			give_item( id, "weapon_hegrenade" )
			give_item( id, "weapon_smokegrenade" )
			give_item( id, "weapon_flashbang" )
			give_item( id, "weapon_flashbang" )
			give_item( id, "weapon_knife" )
			set_user_armor( id, 100 )
			set_hudmessage(100, 200, 0, 0.03, 0.24, 0, 0.0, 0.0, 4.0, 10.0,1)
			show_hudmessage(id,"cTn stuff: Killing mix2" )
			console_cmd( id, "amx_ctnstuff2" )
			return PLUGIN_HANDLED 
		}
		case 2: {
			set_user_gravity( id, 0.5) 
			set_hudmessage(100, 200, 0, 0.03, 0.24, 0, 0.0, 0.0, 4.0, 10.0,1)
			show_hudmessage(id,"cTn stuff: Gravity 50%" )
			console_cmd( id, "amx_ctnstuff2" )
			return PLUGIN_HANDLED 
		}
		case 3: {
			cs_set_user_money( id, 16000, 1 )
			set_hudmessage(100, 200, 0, 0.03, 0.24, 0, 0.0, 0.0, 4.0, 10.0,1)
			show_hudmessage(id,"cTn stuff: Money 16000" )
			console_cmd( id, "amx_ctnstuff2" )
			return PLUGIN_HANDLED 
		}
		case 4: {
			set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderNormal,25)
			set_hudmessage(255, 0, 0, 0.03, 0.24, 0, 0.0, 0.0, 4.0, 10.0,1)
			show_hudmessage(id,"cTn stuff: Glow OFF") 
			console_cmd( id, "amx_ctnstuff2" )
			return PLUGIN_HANDLED 
		}
		case 5: {
			set_user_rendering(id,kRenderFxGlowShell,0,255,0, kRenderTransAlpha,25)
			set_hudmessage(0, 255, 0, 0.03, 0.24, 0, 0.0, 0.0, 4.0, 10.0,1)
			show_hudmessage(id,"cTn stuff: Alien mode") 
			console_cmd( id, "amx_ctnstuff2" )
			return PLUGIN_HANDLED 
		}
		case 6: {
			set_user_rendering(id,kRenderFxGlowShell,0,0,0, kRenderTransAlpha,5)
			set_hudmessage(0, 255, 0, 0.03, 0.24, 0, 0.0, 0.0, 4.0, 10.0,1)
			show_hudmessage(id,"cTn stuff: 95% invisible") 
			console_cmd( id, "amx_ctnstuff2" )
			return PLUGIN_HANDLED 
		}
		case 7: {
			set_user_rendering(id,kRenderFxGlowShell,0,0,0, kRenderTransAlpha,0)
			set_hudmessage(0, 255, 0, 0.03, 0.24, 0, 0.0, 0.0, 4.0, 10.0,1)
			show_hudmessage(id,"cTn stuff: 100% invisible") 
			console_cmd( id, "amx_ctnstuff2" )
			return PLUGIN_HANDLED 
		}
		case 8: ShowMenu(id)
		
		//case 9: client_print( id, print_chat, "Menu Option EXIT" ) 
	} 
	
	return PLUGIN_HANDLED 
}
is any way to let menu opened without reopening it ?
Code:
console_cmd( id, "amx_ctnstuff2" )
__________________
cTn is offline
Send a message via ICQ to cTn Send a message via MSN to cTn
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 11-01-2005 , 11:44  
Reply With Quote #2

Code:
if(key != 9) {   ShowMenu2(id); }
Put that at the end of the function with the switch statement in it.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
cTn
Senior Member
Join Date: Oct 2005
Old 11-01-2005 , 12:20  
Reply With Quote #3

coool dont undestand :dDD
__________________
cTn is offline
Send a message via ICQ to cTn Send a message via MSN to cTn
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 11-02-2005 , 10:33  
Reply With Quote #4

You also need to remove all the return PLUGIN_HANDLED lines from all the cases.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 11-02-2005 , 11:26  
Reply With Quote #5

Code:
// Menu 2 public ShowMenu2( id ) {    if (!(get_user_flags(id)&ADMIN_LEVEL_A)) {             return PLUGIN_HANDLED    }    new szMenuBody[256]    new keys        new nLen = format( szMenuBody, 255, "\ySecond Menu:^n" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w1. Killing mix 1" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w2. Killing mix 2" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w3. Gravity 50%" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w4. Money 16000" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w5. GLOW OFF" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w6. Alien mode" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w7. Alpha render 5%" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w8. Alpha render 0" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w9. Back" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n^n\w0. Exit" )        keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)        show_menu( id, keys, szMenuBody, -1 )        return PLUGIN_HANDLED } public MenuCommand2( id, key ) {        switch( key ) {             case 0: {          strip_user_weapons( id )          give_item( id, "weapon_m4a1" )          give_item( id, "weapon_m4a1" )          give_item( id, "weapon_m4a1" )          give_item( id, "weapon_deagle" )          give_item( id, "weapon_deagle" )          give_item( id, "weapon_deagle" )          give_item( id, "weapon_deagle" )          give_item( id, "weapon_hegrenade" )          give_item( id, "weapon_smokegrenade" )          give_item( id, "weapon_flashbang" )          give_item( id, "weapon_flashbang" )          give_item( id, "weapon_knife" )          set_user_armor( id, 100 )          set_hudmessage(100, 200, 0, 0.03, 0.24, 0, 0.0, 0.0, 4.0, 10.0,1)          show_hudmessage(id,"cTn stuff: Killing mix1" )          console_cmd( id, "amx_ctnstuff2" )       }       case 1: {          strip_user_weapons( id )          give_item( id, "weapon_ak47" )          give_item( id, "weapon_ak47" )          give_item( id, "weapon_ak47" )          give_item( id, "weapon_deagle" )          give_item( id, "weapon_deagle" )          give_item( id, "weapon_deagle" )          give_item( id, "weapon_deagle" )          give_item( id, "weapon_hegrenade" )          give_item( id, "weapon_smokegrenade" )          give_item( id, "weapon_flashbang" )          give_item( id, "weapon_flashbang" )          give_item( id, "weapon_knife" )          set_user_armor( id, 100 )          set_hudmessage(100, 200, 0, 0.03, 0.24, 0, 0.0, 0.0, 4.0, 10.0,1)          show_hudmessage(id,"cTn stuff: Killing mix2" )          console_cmd( id, "amx_ctnstuff2" )       }       case 2: {          set_user_gravity( id, 0.5)          set_hudmessage(100, 200, 0, 0.03, 0.24, 0, 0.0, 0.0, 4.0, 10.0,1)          show_hudmessage(id,"cTn stuff: Gravity 50%" )          console_cmd( id, "amx_ctnstuff2" )       }       case 3: {          cs_set_user_money( id, 16000, 1 )          set_hudmessage(100, 200, 0, 0.03, 0.24, 0, 0.0, 0.0, 4.0, 10.0,1)          show_hudmessage(id,"cTn stuff: Money 16000" )          console_cmd( id, "amx_ctnstuff2" )       }       case 4: {          set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderNormal,25)          set_hudmessage(255, 0, 0, 0.03, 0.24, 0, 0.0, 0.0, 4.0, 10.0,1)          show_hudmessage(id,"cTn stuff: Glow OFF")          console_cmd( id, "amx_ctnstuff2" )       }       case 5: {          set_user_rendering(id,kRenderFxGlowShell,0,255,0, kRenderTransAlpha,25)          set_hudmessage(0, 255, 0, 0.03, 0.24, 0, 0.0, 0.0, 4.0, 10.0,1)          show_hudmessage(id,"cTn stuff: Alien mode")          console_cmd( id, "amx_ctnstuff2" )       }       case 6: {          set_user_rendering(id,kRenderFxGlowShell,0,0,0, kRenderTransAlpha,5)          set_hudmessage(0, 255, 0, 0.03, 0.24, 0, 0.0, 0.0, 4.0, 10.0,1)          show_hudmessage(id,"cTn stuff: 95% invisible")          console_cmd( id, "amx_ctnstuff2" )       }       case 7: {          set_user_rendering(id,kRenderFxGlowShell,0,0,0, kRenderTransAlpha,0)          set_hudmessage(0, 255, 0, 0.03, 0.24, 0, 0.0, 0.0, 4.0, 10.0,1)          show_hudmessage(id,"cTn stuff: 100% invisible")          console_cmd( id, "amx_ctnstuff2" )       }       case 8: ShowMenu(id)             //case 9: client_print( id, print_chat, "Menu Option EXIT" )    }    // This    if(key != 9) {       ShowMenu2(id)    }        return PLUGIN_HANDLED }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
cTn
Senior Member
Join Date: Oct 2005
Old 11-02-2005 , 11:42  
Reply With Quote #6

ok thx.. and this fix the gravity problem too?
__________________
cTn is offline
Send a message via ICQ to cTn Send a message via MSN to cTn
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 11-02-2005 , 11:44  
Reply With Quote #7

Look in your other topic, I solved that too
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
cTn
Senior Member
Join Date: Oct 2005
Old 11-02-2005 , 11:47  
Reply With Quote #8

thank uu i loove people like u
__________________
cTn is offline
Send a message via ICQ to cTn Send a message via MSN to cTn
cTn
Senior Member
Join Date: Oct 2005
Old 11-02-2005 , 11:51  
Reply With Quote #9

v3x can i ask u .. if u now how to give admin no block ? give him special for gowing true team players ? is this posible?
__________________
cTn is offline
Send a message via ICQ to cTn Send a message via MSN to cTn
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 11-02-2005 , 11:52  
Reply With Quote #10

Code:
set_user_noclip(id, 1);
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x 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 00:05.


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