Raised This Month: $ Target: $400
 0% 

NS and weapon damage - not working?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
onlysolution
New Member
Join Date: Mar 2005
Old 04-07-2005 , 22:18   NS and weapon damage - not working?
Reply With Quote #1

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
onlysolution is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode