Raised This Month: $ Target: $400
 0% 

[HELP] Player_TakeDamage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Id0x.
Junior Member
Join Date: Dec 2020
Old 12-20-2020 , 11:35   [HELP] Player_TakeDamage
Reply With Quote #1

HTML Code:
L 12/20/2020 - 16:19:00: [AMXX] Displaying debug trace (plugin "furien_shop.amxx", version "1.1")
L 12/20/2020 - 16:19:00: [AMXX] Run time error 4: index out of bounds 
L 12/20/2020 - 16:19:00: [AMXX]    [0] phpQLXWlj.sma::Player_TakeDamage (line 454)

PHP Code:
public Player_TakeDamage (iVictimiInflictoriAttackerFloat:DamageiDamageBits)
{
   if(
iInflictor == iAttacker && HaveKnife1[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE && cs_get_user_team(iAttacker) == CS_TEAM_T)
   {
      
SetHamParamFloat(4Damage 1.1);
      return 
HAM_HANDLED;
   }
   
   return 
HAM_IGNORED;

Id0x. is offline
Th3822
Member
Join Date: Jan 2013
Location: Venezuela
Old 12-20-2020 , 11:49   Re: [HELP] Player_TakeDamage
Reply With Quote #2

PHP Code:
 && HaveKnife1[iAttacker] && is_user_alive(iAttacker
invert the order of those:
PHP Code:
 && is_user_alive(iAttacker) && HaveKnife1[iAttacker
Th3822 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 12-20-2020 , 18:18   Re: [HELP] Player_TakeDamage
Reply With Quote #3

Quote:
Originally Posted by Th3822 View Post
PHP Code:
 && HaveKnife1[iAttacker] && is_user_alive(iAttacker
invert the order of those:
PHP Code:
 && is_user_alive(iAttacker) && HaveKnife1[iAttacker
And why do you think that would matter or even change the error in the first place?

Show the declaration of your HaveKnife1[] bool
__________________

Last edited by Napoleon_be; 12-20-2020 at 18:19.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Th3822
Member
Join Date: Jan 2013
Location: Venezuela
Old 12-20-2020 , 19:26   Re: [HELP] Player_TakeDamage
Reply With Quote #4

Quote:
Originally Posted by Napoleon_be View Post
And why do you think that would matter or even change the error in the first place?

Show the declaration of your HaveKnife1[] bool
iAttacker may be a non-player entity, so by using the is_user_alive first, it does check if it's a player before using the array, if it happens again then it's the array size too.
Th3822 is offline
Id0x.
Junior Member
Join Date: Dec 2020
Old 12-21-2020 , 07:24   Re: [HELP] Player_TakeDamage
Reply With Quote #5

Quote:
Originally Posted by Th3822 View Post
PHP Code:
 && HaveKnife1[iAttacker] && is_user_alive(iAttacker
invert the order of those:
PHP Code:
 && is_user_alive(iAttacker) && HaveKnife1[iAttacker
Thanks, have been solved ❤
Id0x. is offline
Reply



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 13:12.


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