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 definition
test.sma(28) : error 017: undefined symbol "damage"
test.sma(28) : warning 221: label name "float" shadows tag name
test.sma(28) : warning 215: expression has no effect
test.sma(28) : error 001: expected token: ";", but found ")"
test.sma(28) : error 029: invalid expression, assumed zero
test.sma(28) : fatal error 107: too many error messages on one line
Here's the script code:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <hamsandwich>
new float:dmgSet = 30.0
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(float:dmgSet)
}
public isDamaged(victim, attacker, inflictor, float:dmgSet)
{
if(get_user_weapon(attacker) == CSW_KNIFE)
{
SetHamParamFloat(4, damage * float:dmgSet)
}
}
Can you please modify the code so that it is correct?