27.07.2019, 16:43
Quote:
Code:
switch (weaponid) { // The spas shotguns shoot 8 bullets, each inflicting 4.95 damage case WEAPON_SHOTGSPA: { bullets = amount / 4.950000286102294921875; if (8.0 - bullets < -0.05) { return WC_INVALID_DAMAGE; } } |
The only things you should edit in weapon-config.inc are the following lines at the top of the file:
PHP Code:
// Print debug messages in the chat and server log
#if !defined WC_DEBUG
#define WC_DEBUG false
#endif
// Print debug messages to the console but not the chat
#if !defined WC_DEBUG_SILENT
#define WC_DEBUG_SILENT false
#endif
// Max number of rejected hits (GetRejectedHit)
#if !defined WC_MAX_REJECTED_HITS
#define WC_MAX_REJECTED_HITS 15
#endif
// Max ranges for DAMAGE_TYPE_RANGE(_MULTIPLIER)
#if !defined WC_MAX_DAMAGE_RANGES
#define WC_MAX_DAMAGE_RANGES 5
#endif
// The world a player has after the death animation finished until he respawns or enters class selection
#if !defined WC_DEATH_WORLD
#define WC_DEATH_WORLD 0x00DEAD00
#endif
// The max number of entries in the damage feeds
#if !defined WC_FEED_HEIGHT
#define WC_FEED_HEIGHT 5
#endif
// Use Incognito's streamer for custom vending machines
#if !defined WC_USE_STREAMER
#define WC_USE_STREAMER false
#endif
// For SetWeaponName
#if !defined WC_MAX_WEAPON_NAME
#define WC_MAX_WEAPON_NAME 21
#endif
// For modes that always have negative cash
#if !defined WC_CUSTOM_VENDING_MACHINES
#define WC_CUSTOM_VENDING_MACHINES true
#endif
I recommend setting SetWeaponDamage(weaponid, damage_type, Float:amount, Float:...); in OnGamemodeInit or by manipulating the amount float in public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart);
.