Raised This Month: $ Target: $400
 0% 

Index out of bounds


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
egbertjan
Senior Member
Join Date: Mar 2007
Location: The Netherlands
Old 05-13-2014 , 17:02   Index out of bounds
Reply With Quote #1

I would like to know why the following code is out of bounds.


Code:
public fw_TakeDamage(victim, inflictor, attacker, Float:damage) {
	
	if (is_user_connected(victim) && is_user_connected(attacker)) {
	
	new Float:extradmg = 1 + (player_power[attacker]*0.01)

	if (is_user_connected(attacker) && is_user_alive(attacker) && player_power[attacker] > 0) {
			SetHamParamFloat(4, damage * extradmg)
		} else {
			SetHamParamFloat(4, damage)
		}
	}
}


Also I've read something of returning the HAM function, however there is no return value. How is it possible to get this?

Code:
if (!is_user_connected(victim) || !is_user_connected(attacker)) return HAM_IGNORED

Thanks in advance.
egbertjan 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 09:40.


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