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()
{
register_plugin("My first shop", "1.0", "RayCodeCSC")
register_clcmd("say /test", "test_function")
RegisterHam(Ham_TakeDamage, "player", "isDamaged")
}
public test_function(id)
{
//What exactly do I write in brackets?
isDamaged(victim, attacker, inflictor, Float:damage, damagebits)
}
public isDamaged(victim, attacker, inflictor, Float:damage, damagebits)
{
if(get_user_weapon(attacker) == CSW_KNIFE)
{
SetHamParamFloat(4, damage = 30.0)
}
}
But I can't work enough to call a function.
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)
So what do I write in brackets isDamaged() to make it public isDamaged()?
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 :-).