16.02.2015, 01:11
You need to type continue (or c) when you attach gdb. Look on GitHub in a few minutes, there will be an update which will fix the crashes.
/* native public OnPlayerPrepareDeath(playerid, animlib[32], animname[32], &anim_lock, &respawn_time) native public OnRejectedHit(playerid, hit[E_REJECTED_HIT]) native public OnPlayerDeathFinished(playerid) native public OnInvalidWeaponDamage(playerid, damagedid, Float:amount, weaponid, bodypart, error, bool:given) native public OnPlayerDamageDone(playerid, Float:amount, issuerid, weapon, bodypart) native public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart) native stock IsBulletWeapon(weaponid) native stock IsHighRateWeapon(weaponid) native stock IsMeleeWeapon(weaponid) native stock IsPlayerSpawned(playerid) native stock AverageShootRate(playerid, shots, &multiple_weapons = 0) native stock AverageHitRate(playerid, hits, &multiple_weapons = 0) native stock SetRespawnTime(ms) native stock GetRespawnTime() native stock ReturnWeaponName(weaponid) native stock SetWeaponDamage(weaponid, damage_type, Float:amount, Float:...) native stock SetDamageSounds(taken, given) native stock SetCustomFallDamage(bool:toggle, Float:damage_multiplier = 25.0, Float:death_velocity = -0.6) native stock SetCustomVendingMachines(bool:toggle) native stock SetVehiclePassengerDamage(bool:toggle) native stock SetDamageFeed(bool:toggle) native stock SetWeaponShootRate(weaponid, max_rate) native stock IsPlayerDying(playerid) native stock SetWeaponMaxRange(weaponid, Float:range) native stock DamagePlayer(playerid, Float:amount, issuerid = INVALID_PLAYER_ID, weaponid = WEAPON_UNKNOWN, bodypart = BODY_PART_UNKNOWN) native stock GetRejectedHit(playerid, idx, output[], maxlength = sizeof(output)) native static UpdatePlayerVirtualWorld(playerid) native static HasSameTeam(playerid, otherid) native static IsPlayerPaused(playerid) native static UpdateHealthBar(playerid, bool:force = false) native static SetHealthBarVisible(playerid, bool:toggle) native static PosInFront(playerid, Float:distance, &Float:x, &Float:y, &Float:z) native static UpdateSyncData(playerid) native static RemoveDefaultVendingMachines(playerid) native static CreateVendingMachines() native static DestroyVendingMachines() native static ProcessDamage(&playerid, &issuerid, &Float:amount, &weaponid, &bodypart, &Float:bullets) native static InflictDamage(playerid, Float:amount, issuerid = INVALID_PLAYER_ID, weaponid = WEAPON_UNKNOWN, bodypart = BODY_PART_UNKNOWN) native static PlayerDeath(playerid, animlib[32], animname[32], anim_lock = 1, respawn_time = -1, bool:freeze_sync = true) native static DamageFeedUpdate(playerid, bool:modified = false) native static DamageFeedUpdateText(playerid) native static DamageFeedAddHitGiven(playerid, issuerid, Float:amount, weapon) native static DamageFeedAddHitTaken(playerid, issuerid, Float:amount, weapon) native static DamageFeedAddHit(arr[WC_FEED_HEIGHT][E_DAMAGE_FEED_HIT], playerid, issuerid, Float:amount, weapon) native static DamageFeedRemoveHit(arr[WC_FEED_HEIGHT][E_DAMAGE_FEED_HIT], idx) native static ResyncPlayer(playerid) native static Float:AngleBetweenPoints(Float:x1, Float:y1, Float:x2, Float:y2) native static MakePlayerFacePlayer(playerid, targetid, opposite = false, forcesync = true) native static IsPlayerBehindPlayer(playerid, targetid, Float:diff = 90.0) native static AddRejectedHit(playerid, damagedid, reason, weapon, i1 = 0, i2 = 0, i3 = 0) */
Also (considering my last comment and the vehicle branch of this library) I suggest you should add separate damage for the armoured vehicles. Like instead of shotguns taking 120 they would take 60 health from a rhino and hunter. I made a pull request too, adding unoccupied vehicle damage which works the exact same way as passenger damages, but without the passenger part.
|
Well it`s seems nice to me. But I have guestion. This inc can be used like anticheat and optimization for our scripts?
|
SetDamageFeed(false);
SetDamageSounds(0, 0);
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart) {
if (bodypart == BODY_PART_BLABLA) {
amount = amount / 2.0; // 50% damage
}
return 1;
}
public OnPlayerDamage(playerid, &Float:amount, &issuerid, &weapon, &bodypart) {
// Disable helikill and carpark
if (weapon == WEAPON_CARPARK || weapon == WEAPON_HELIBLADES)
{
return 0;
}
// Ignore low fall damage
if (weapon == WEAPON_COLLISION && amount < 10.0)
{
return 0;
}
// the time in milliseconds between the last 3 shots
// SHOT - time - SHOT - time - SHOT
new avg_rate = AverageShootRate(issuerid, 2);
// Lower rapid fire damage (C-bug fast shooting)
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;
}
}
// Increase headshot damage
if (IsBulletWeapon(weapon) && bodypart == 9) {
amount *= 1.25;
}
return 1;
}
static CreateVendingMachines()
{
DestroyVendingMachines();
for (new i = 0; i < sizeof(sc_VendingMachines); i++) {
#if WC_USE_STREAMER
s_VendingMachineObject[i] = CreateDynamicObject(
sc_VendingMachines[i][e_Model],
sc_VendingMachines[i][e_PosX],
sc_VendingMachines[i][e_PosY],
sc_VendingMachines[i][e_PosZ],
sc_VendingMachines[i][e_RotX],
sc_VendingMachines[i][e_RotY],
sc_VendingMachines[i][e_RotZ],
.interiorid = sc_VendingMachines[i][e_Interior]
);
#else
s_VendingMachineObject[i] = CreateObject(
sc_VendingMachines[i][e_Model],
sc_VendingMachines[i][e_PosX],
sc_VendingMachines[i][e_PosY],
sc_VendingMachines[i][e_PosZ],
sc_VendingMachines[i][e_RotX],
sc_VendingMachines[i][e_RotY],
sc_VendingMachines[i][e_RotZ]
);
#endif
}
}
As you can see at .interiorid = sc_VendingMachines[i][e_Interior]
|