Detect related
I have a few simple questions.
How would you detect If a user Is already using a certain function? Such as telling them that, "You are already using this." or whatever. Also, how would you detect If the player Is hit while using a function, then do a new function. |
Well for detecting if they are already performing an action, you can use a bool.
|
Quote:
|
Code:
|
I am not so sure about detecting if a player is hit, but you can try this http://www.amxmodx.org/doc/source/fu...r_hitzones.htm
|
Rewritten ever so slightly to follow the rule that you should place the most likely condition at the top of a list of conditionals. Also took of the second condition as a boolean only has two values so you don't need to check it twice. Also added semicolons because that's what I do. Also added a space after each if because damn it, that's how God intended it to be (He also intended programmers to use tabs instead of spaces but I didn't fix that).
Code:
|
Brad can you help me with my problem?
|
Code:
|
Quote:
You shouldn't be hijacking people thread. If you want to know when a player is hit. use register_event and Damage event. That will give you the person who is getting hit. But if you are trying to get where they are hit it different. |
Unless the function is a forward or you are using the return value elsewhere, you don't need to return anything.
Edit: I didn't not know that the return value also matters when a function is called from a menu (or something like that). Thank you, teame06, for enlightening me. |
| All times are GMT -4. The time now is 16:10. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.