SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Includes (https://forum.sa-mp.com/forumdisplay.php?f=83)
-   -   [Include] weapon-config.inc - Damage system with many features (https://forum.sa-mp.com/showthread.php?t=563387)

Crayder 16/02/2015 01:06 AM

Re: weapon-config.inc - Damage system with many features
 
Quote:

Originally Posted by Slice (Post 3372417)
0.3.7 is not supported by SKY yet. I'll deal with it as fast as I can.

Could you attach gdb to the process and print a backtrace of the crash?

It only crashes when I'm in game, and I can't connect to the server (or even query it) while gdb is attached. Lol, alternative?


EDIT: ALso, I can't run the server from the gdb console. It says server.cfg could not be run (and I get the intro stuff).

Slice 16/02/2015 01:11 AM

Re: weapon-config.inc - Damage system with many features
 
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.

Crayder 16/02/2015 01:32 AM

Re: weapon-config.inc - Damage system with many features
 
http://i.imgur.com/gQcevBS.jpg

Slice 16/02/2015 01:34 AM

Re: weapon-config.inc - Damage system with many features
 
Try with this one: https://github.com/oscar-broman/SKY/...-BETA-0.3.7RC1

Crayder 16/02/2015 01:40 AM

Re: weapon-config.inc - Damage system with many features
 
It seems to be working... Now about that health bar... :P
Should it be this large?

1024x768 http://i.imgur.com/MtqhCmW.png

Also, would you consider adding custom colors? (Possibly the fading color array I provided above :3)





EDIT: You could also consider adding damage to unoccupied vehicles (I made a pull request to do so), and damage when falling into water (this would be awesome).
EDIT2:For pawns function list: (retrieved using regex on include)
Code:

/*
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)
*/

Ps. I like how I can still move my head when I'm dead... :P (I usually keep /headmove on though, so it doesn't bother me)

Excel™ 16/02/2015 02:46 AM

Re: weapon-config.inc - Damage system with many features
 
Could you explain syncing part for knives?

thaKing 16/02/2015 05:31 AM

Re: weapon-config.inc - Damage system with many features
 
Really useful, especially for role play servers. Thanks.
(I'll still check the code later.)

Crayder 16/02/2015 05:34 AM

Re: weapon-config.inc - Damage system with many features
 
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.

JeaSon 16/02/2015 06:19 AM

Re: weapon-config.inc - Damage system with many features
 
its really great

Slice 16/02/2015 07:39 AM

Re: weapon-config.inc - Damage system with many features
 
Quote:

Originally Posted by Excel™ (Post 3372789)
Could you explain syncing part for knives?

lagcomp
The syncing of the aim key is disabled, which means you will never see anyone hold their knife up and stealth knife you.
The reason I did this is if you get knifed and OnPlayerTakeDamage is called, your game will be bugged until you respawn.
Instead, when you knife someone with OnPlayerGiveDamage, an animation is applied (foresync) and a death message is sent.
This removes all issues related to knives causing players to get desynced.

non-lagcomp
When someone does a stealth knife with OnPlayerGiveDamage, a timer is set that checks if the player you knifed will get knifed "on his screen". If not, that player will be respawned for you to get out of the death state.

Quote:

Originally Posted by Crayder (Post 3373081)
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.

I'm looking into a nice way to make vehicle damage server-side. The damage should be processed and friendly fire should be toggleable. There are some quirks I need to work around, such as recognizing collision damage.
One little idea I have is make the health sync just like with other stuff and attach custom smoke particles to the vehicles.


All times are GMT. The time now is 06:01 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.