Raised This Month: $ Target: $400
 0% 

disable CurWeapon event?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Belsebub
Senior Member
Join Date: Feb 2005
Location: Sweden
Old 05-06-2005 , 10:35   disable CurWeapon event?
Reply With Quote #1

is it possible to disable the CurWeapon event during freezetime?
Belsebub is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-07-2005 , 11:48  
Reply With Quote #2

What are you trying to do?
__________________
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
Belsebub
Senior Member
Join Date: Feb 2005
Location: Sweden
Old 05-07-2005 , 12:47  
Reply With Quote #3

lets say i have a code that sets the players speed to 400 if he uses a knife, and i use the CurWeapon event to set his speed to 400 when he equip the knife.

and if he equip the knife during the freezetime, he can move.

and i wanna disable the CurWeapon event so he cant move if he equip the knife during freezetime
Belsebub is offline
Ced
Member
Join Date: Oct 2004
Old 05-07-2005 , 15:11  
Reply With Quote #4

you don't want to remove the event, you just want to check if he's in freezetime. But currently, I do not remember how to do it, youo would get the server freezetime cvar and then other things that I don't remember.
Ced is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 05-07-2005 , 21:23  
Reply With Quote #5

You can disable events using register_event. Look it up in the wiki
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Belsebub
Senior Member
Join Date: Feb 2005
Location: Sweden
Old 05-08-2005 , 04:05  
Reply With Quote #6

thanks Suzuka, but i didnt find anything, can you show me how to do?
Belsebub is offline
Belsebub
Senior Member
Join Date: Feb 2005
Location: Sweden
Old 05-13-2005 , 08:47  
Reply With Quote #7

bump
Belsebub is offline
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 05-13-2005 , 10:23  
Reply With Quote #8

Just watch for the freezetime, and during freezetime set a global variable to True, and after freezetime set it to False..
Then, in your CurWeapon event function, just check if the variable is True, and if so then exit the function immediately..

kinda like:
Code:
public Event_CurWeapon( id ) {     if( bFreezeTime ) return PLUGIN_CONTINUE     // do the rest of your code here.. }

That way you don't affect other plugins by removing a commonly used event..
xeroblood is offline
Send a message via MSN to xeroblood
sambro
Member
Join Date: May 2005
Old 05-13-2005 , 11:21  
Reply With Quote #9

Xero, how would you check freezetime?

I dunno what the situation is in AMXX, but back at AMX, you had to register_logevent the round start, but it was only called after freezetime?

I've noticed people using ResetHUD, is this the one that gets called as soon as a round starts?
sambro is offline
Send a message via MSN to sambro
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 05-13-2005 , 15:32  
Reply With Quote #10

Well, there are a couple ways to check.. not sure which is the most effecient though.. maybe it depends on what you are doing exactly..

Anyway, you could just catch the Round End event and then make the flag variable 'bFreezeTime' equal True. And then catch the Round Start event which is fired after freezetime, and set the flag variable back to False..

Or, you could catch the first ResetHUD event setting the flag to True, and then set a task for the length of the mp_freezetime cvar, which then sets the flag back to False..
xeroblood is offline
Send a message via MSN to xeroblood
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 16:49.


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