27.09.2017, 00:56
cool thing thanks a lot !
public OnPlayerHeadshot(Float:Ax, Float:Ay, Float:Az, playerid) { KillTimer(HeadshotTimer[playerid]); DestroyObject(blood[playerid]); SetPLayerHealth(playerid,0); return 1; }
public OnPlayerHeadshot(Float:Ax, Float:Ay, Float:Az, playerid,Float:amount) { KillTimer(HeadshotTimer[playerid]); DestroyObject(blood[playerid]); amount = 0.0; return 1; }
How to delay the death of the player who got headshooted ?
I'm using the 2 sec Timer to set his health to 0 using SetPlayerHealth(playerid,0); but the problem is in deathlist it showing he got killed by no one like he did /kill . I'm doing this right now. this was working fine with OnPlayerTakeDamage before but after changing it to OnPlayerDamage it's not working like it was. Код:
public OnPlayerHeadshot(Float:Ax, Float:Ay, Float:Az, playerid) { KillTimer(HeadshotTimer[playerid]); DestroyObject(blood[playerid]); SetPLayerHealth(playerid,0); return 1; } Код:
public OnPlayerHeadshot(Float:Ax, Float:Ay, Float:Az, playerid,Float:amount) { KillTimer(HeadshotTimer[playerid]); DestroyObject(blood[playerid]); amount = 0.0; return 1; } |
Why isn't OnPlayerGiveDamage and OnPlayerTakeDamage hooked while all other callbacks/functions are hooked?
I'm using BustAim and when I include weapon-config before BustAim it gives me this error: Code:
symbol already defined: "OnPlayerGiveDamage" |
Weapon Config my forked version 0.3.DL https://github.com/MaxAndolini/samp-weapon-config
SKY Plugin 0.3.DL version http://forum.sa-mp.com/showpost.php?...&postcount=137 |
I included weapon-config.inc and when i shoot someone he isn't losing health, also when he shoots me same problem.. i got this from crashdetect
Код:
[19:05:04] [debug] Run time error 11: "Divide by zero" [19:05:04] [debug] AMX backtrace: [19:05:04] [debug] #0 00000f78 in AverageShootRate (playerid=0, shots=1, &multiple_weapons=@00000000 0) at C:\Users\stefan\Desktop\Fusion Gaming NEW\Compiler\include\weapon-config.inc:981 [19:05:04] [debug] #1 00012b10 in public OnPlayerWeaponShot (playerid=0, weaponid=24, hittype=1, hitid=1, Float:fX=-0.19580, Float:fY=0.07214, Float:fZ=0.47790) at C:\Users\stefan\Desktop\Fusion Gaming NEW\Compiler\include\weapon-config.inc:3450 [19:05:06] [debug] Run time error 11: "Divide by zero" [19:05:06] [debug] AMX backtrace: [19:05:06] [debug] #0 00000f78 in AverageShootRate (playerid=0, shots=1, &multiple_weapons=@00000000 0) at C:\Users\stefan\Desktop\Fusion Gaming NEW\Compiler\include\weapon-config.inc:981 [19:05:06] [debug] #1 00012b10 in public OnPlayerWeaponShot (playerid=0, weaponid=24, hittype=1, hitid=1, Float:fX=-0.01489, Float:fY=0.11218, Float:fZ=0.68402) at C:\Users\stefan\Desktop\Fusion Gaming NEW\Compiler\include\weapon-config.inc:3450 [19:05:06] [debug] Run time error 11: "Divide by zero" |
What is the difference between this and the existing one except, as I see, only my pull request and lots of space added after for and if.
Can you compile the gamemode with -d3 flag? create a pawn.cfg file in `pawno` folder and re-compile the gamemode EDIT: nvm, found why. |
How to remove the death animation so its default is it possible?
|
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart) { if (weapon == WEAPON_CARPARK || weapon == WEAPON_HELIBLADES) // Disable helikill and carpark return false; new avg_rate = AverageShootRate(issuerid, 2); // Lower rapid fire damage if (avg_rate != -1) { if (weapon == WEAPON_DEAGLE && avg_rate < 500) { amount /= 1.4; } else if (weapon == WEAPON_SHOTGSPA && avg_rate < 250) { amount /= 1.4; } } // Silencer headshot if (weapon == WEAPON_SILENCED && bodypart == 9) { amount = 30.0; } // Rifle headshot if (weapon == WEAPON_RIFLE && bodypart == 9) { amount /= 0.75; } // Sniper headshot if (weapon == WEAPON_SNIPER && bodypart == 9) { if (amount == 30.0) { amount = 40.0; } else if (amount == 35.0) { amount = 40.0; } else if (amount == 45.0) { amount = 50.0; } } return true; }