I am attempting to write a simple joke script at the request of a friend that sets the damage of the welder to absurd levels. After a billion different tries I've come to the conclusion that either ns_set_weap_dmg and ns_get_weap_dmg are completely non working or I am an idiot and I'm hoping someone can tell me which is the case. Here is the last script I tried
Code:
#include <amxmodx>
#include <ns>
#include <amxmisc>
new PLUGIN[]="Turbowelder"
new AUTHOR[]="Onlysolution"
new VERSION[]="1.00"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_turboweld", "cmd_turboweld", ADMIN_RCON, "")
}
public cmd_turboweld(id, level, cid)
{
if (!cmd_access(id, level, cid, 0)) {
return PLUGIN_HANDLED
}
new wep = WEAPON_WELDER
new Float:dmg = 6000.00
new Float:olddmg = ns_get_weap_dmg(WEAPON_WELDER)
ns_set_weap_dmg(WEAPON_WELDER, dmg)
server_print ("Weapon %d set to %f damage.", wep, dmg)
server_print ("Original damage was %f", olddmg)
server_print ("welder is %d", WEAPON_WELDER)
return PLUGIN_HANDLED
}
the output of the command is something like (i.e. same number, different number of trailing zeroes) :
Code:
Weapon 18 set to 6000.0 damage
Original damage was 0.0
welder is 18
and the welder does the same amount of damage.
I'm guessing I can't properly program in small and I screwed up a data type or 12 in here.
Thanks in advance!
-Onlysolution