I need help with my plugin
Hi, I need help with my plugin. I have created a store in which I have a list with items such as "Power 1", "Power 2", etc.
and I need to do that when a player presses, for example, "Power 1", it sets the damage to 50.0. I'd like to do it through hamsandwich. Originally I wanted to do this as follows: Code:
public plugin_init()So the question is: How do I call a function? When I tried it like this, it doesn't work for me: Code:
isDamaged(victim, attacker, inflictor, Float:damage, damagebits)In a nutshell: I just want to explain how a function call works and possibly correct my code. I apologize for my English, perhaps you'll understand what I want from you :-). |
Re: I need help with my plugin
Between the brackets are called parameters you have to pass digits or string depends on the parameter data type You either can pass them as numeric values or as variables that holds a value. As you Registered a hook to the damage event of a player through ham module and provided the callfunction which is (isDamaged), every time the player gets damaged the isDamaged function will be called. So calling it within the plugin won't make any changes. |
Re: I need help with my plugin
Yup, you can call those functions/hooks via ExecuteHam[B] native. For more information about ham hooks check ham_const header, which tells you how to execute or register them.
|
Re: I need help with my plugin
Quote:
:oops: |
Re: I need help with my plugin
I don't understand how to use those variables. I tried it as follows and wrote these errors (when I tried to compile it)
Code:
test.sma(21) : error 088: number of arguments does not match definitionCode:
#include <amxmodx> |
Re: I need help with my plugin
Sorry this section is not do for me but tell me how.
|
Re: I need help with my plugin
What? I do not understand you. What am I supposed to tell you?
I just need to explain how variables work. Respectively how they are used in functions. |
Re: I need help with my plugin
Sorry but can you be more serious please? Read carefully what I said above.
|
Re: I need help with my plugin
So I tried ExecuteHamB(), but it writes me the following errors:
Code:
test.sma(37) : error 029: invalid expression, assumed zeroCode:
ExecuteHamB(tkDamage1, victim)Code:
#include <amxmodx> |
Re: I need help with my plugin
You don't need ExecuteHamB, its used only when you want to apply a custom damage for new weapon / effect, you just want to edit the current weapon damage,
First you need to create a variable to hold player power level and then based on that level change the damage in the forward something like this : PHP Code:
|
| All times are GMT -4. The time now is 17:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.