Questions about scripting and HL engine
Hi :wink:, I'm new to this plugin making thing :cry:. I started it maybe a week ago, learned from the funcwiki, the amxmodx doc and other plugins source code [and hlsdk for possibilities] . However I have some questions that i couldn't find answer by searching the forum (maybe lack of keywords) :rtfm:.
1 - Optimization I couldn't find the "basics" of Pawn language regarding the optimizing. I read that "very-frequent" (0.01s) tasks should be redone in server_frame; saw from source codes that i should use constants for regular expressions etc. But i would like to know more optimization. For example, should I use only one public function that can do two or more thing (IF/switch/etc) or write more public function and each will deal with that specific/unique event. Or the "perfect" number of used modules, what module-functions should I use for fast performance etc etc etc. Response by Bad_Bud: http://wiki.amxmodx.org/Optimizing_Plugins_(AMX_Mod_X_Scripting) 2 - Pev_button I made a little plugin, that allows me to control an entity with pev(id1, pev_origin, origin1) and set_pev(id2, pev_origin, origin1). And I tried to do a "real" control by pev_button, but pev(id1, pev_button, button1) set_pev(id2, pev_button, button1) doesn't seems to work. If you want, I'll post the code (the question is about the pev_button, not that what is the problem with my plugin). Here is the source code: https://forums.alliedmods.net/showpo...2&postcount=10 3 - Detailed informations about the constants I couldn't find anywhere that how should I get the name of the "being spectated" player, later I found it in the specinfo plugin. But why is not there in the *.inc files (I mean the purpose of that specific "value")? So is there any list with all of these constants? Even the HLSDK [not full] has these informations placed recklessly in random header files. 4 - Short and easy questions A: Is there a specific user message or an event that "fires" when someone fires/attacks/is about to deal damage? I would like to get that very moment, when someone is about to give a shot (:oops:) or slashing with knife [and maybe using a stationary gun]. I tried the AmmoX event, but it doesn't works. Response by ot_207: https://forums.alliedmods.net/showpo...92&postcount=9 B: Can I "disable" specific events/messages/functions? I read that there's a function that allows to "stop" it, or at least my plugin has the right to do the first steps and then the real event/message/function will be parsed/run, but I can't find it [lack of keywords]. Response by ot_207: https://forums.alliedmods.net/showpo...61&postcount=3 (end of post) This was my first post. Sorry for making it rather long. I just simply have many ideas that I would like to realize. I hope i didn't asked anything dumb or so noobish. |
Re: Questions about scripting and HL engine
|
Re: Questions about scripting and HL engine
#2 pev_button works this way. To get it.
PHP Code:
PHP Code:
You can check this out, hasn't all of them but most could come in handy -> http://www.amxmodx.org/funcwiki.php For the being spectated you should check out that plugin to understand the method. #4 A. Yes there is, you can use 2 methods. It really depends on what you want to do. One is to use the Hamsandwich module, and use or the Ham_TraceAttack or Ham_TakeDamage forward. Or you can use Damage event. PHP Code:
For the damage event more can be found here -> http://wiki.amxmodx.org/Half-Life_1_Game_Events For the Hamsandwich module you should check ham_const.inc B. Yes, there is a function although I would not recommend doing it on important messages, SVC_TEMPENTITY should be good but not all of them. register_message ( iMsgId, szFunction[] ) |
Re: Questions about scripting and HL engine
Quote:
|
Re: Questions about scripting and HL engine
Quote:
PHP Code:
PHP Code:
|
Re: Questions about scripting and HL engine
Quote:
|
Re: Questions about scripting and HL engine
Quote:
PHP Code:
PHP Code:
PHP Code:
And for angles it is correct. Angles must be a float vector. PHP Code:
I suggest using engine at least when you are a beginner at scripting because it is better when we talk about user friendly access. |
Re: Questions about scripting and HL engine
Quote:
B: Yes, I think this is I wanted. Overall: [+karma] |
Re: Questions about scripting and HL engine
Quote:
-> Ham_TraceAttack, Ham_TakeDamage, Ham_Weapon_PrimaryAttack, Ham_Weapon_SecondaryAttack |
Re: Questions about scripting and HL engine
1 Attachment(s)
Quote:
Quote:
I will try this tomorrow also. Some comments about the plugin: I used id 1 and id 2 for simplicity and fast-debug. I will use iuser2 and "if user is an admin" and other things. Also the "move" thing is works. And I think I will try it to move to the server_frame and hope for no netchan errors and other. |
| All times are GMT -4. The time now is 15:06. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.