I have a question [important]
can i create my own events?
i mean there is "ResetHUD" and "DeathMsg" and i want to know if i can create 1 of my own like "IsUsingKnife" example: register_event("IsUsingKnife","func_knifepowe r","a") and please if the answer is yes.. give me an example .. thanks alot :) |
no you can't create your own events but if you want a function to be called whenever someone uses a knife then you probably want to register the "CurWeapon" event then check to see if they switched to a knife using read_data(2) and comparing it to CSW_KNIFE
Example: Code:
new wpn = read_data(2) |
and if i have a Variable like
new isgod[33] and i want an event to give a "god" player his status (speed, gravity and so on) so i need an event register_event("isgod","func_godstatus","a") . . . //here i set the god status everytime event isgod is on public func_godstatus(id) { . . } i mean as long as he is a god (isgod[id]=1) i want the function "func_godstatus" to run on him.. and when he isnt a god anymore (isgod[id]=0) i dont want it to run (all this to prevent the server from lag cuz it lags when a function starts looping all the time) |
client_PreThink? Or run it in ResetHUD?
|
You can't create your own events.
|
whats client_PreThink? how i use it? :\
|
|
You just make a function called "public client_PreThink(id)". You need to have Engine included.
It's called every client frame. |
Eh, isn't it called more than once every frame?
|
No.
|
| All times are GMT -4. The time now is 23:42. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.