Issue with custom damage system (pistolwhipping)
#5

Код:
// 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.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)