Issue with custom damage system (pistolwhipping)
#6

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Why are you even trying to make a system like this? There is a lot of considerations you need to take into account clearly you are not qualified for as you are unable to even solve the most simplistic considerations involved in this type of system. Just use weap-config and build your system around it doing this will save you countless hours of frustration and forum posts trying to figure out what is going on.
Hey Pottus,

I appreciate your concern and I am well aware that what I am doing is very time consuming and comes with a lot of issues I cannot solve on my own. I am very aware of the fact that I lack the experience required to make complex yet effective systems. I know I would probably be better off doing what you've stated. But this doesn't stop me from trying myself anyway. I've found that this is how I learn the best, and I actually enjoy it too. The satisfaction I feel when I solve an issue, regardless of if it's as effective as it can or should be is amazing. I much prefer this rather than just downloading a file and not understanding how it works at all. Regardless, the way you've worded what you wrote was quite demotivating, but I thank you for your input anyway.

Quote:
Originally Posted by raydx
Посмотреть сообщение
Код:
// Check for pistol whip
	switch (weaponid) {
		case WEAPON_COLT45 .. WEAPON_SNIPER,
		     WEAPON_MINIGUN, WEAPON_SPRAYCAN, WEAPON_FIREEXTINGUISHER: {
			// A pistol whip inflicts 2.64 damage
			if (_:amount == _:2.6400001049041748046875) {
				// Save the weapon in the bodypart argument (it's always BODY_PART_TORSO)
				bodypart = weaponid;
				weaponid = WEAPON_PISTOLWHIP;
			}
		}
	}
Credits for Slice (weapon-config). Just add pistolwhip = true and check above bodypart code.


And about that:
Код:
[debug] Run time error 4: "Array index out of bounds" 
[debug]  Attempted to read/write array element at index 65535 in array of size 47 
[debug] AMX backtrace: 
[debug] #0 0005f9d8 in public OnPlayerTakeDamage (1, 65535, 1079194420, 54, 3)
You have to check - if(issuerid != INVALID_PLAYER_ID) before using issuerid in array.
Thanks a lot, this solved my issues. It's much appreciated. I'm only left with the knife's special ability not working now, because players are in the same team. I guess I'll sacrifice the knife until I am more familiar with scripting and know how to get around it.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)