SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 25/07/2019, 03:46 PM   #831
Jeroen52
Gangsta
 
Jeroen52's Avatar
 
Join Date: Oct 2008
Location: The Netherlands
Posts: 882
Reputation: 74
Default Re: weapon-config.inc - Damage system with many features

Quote:
Originally Posted by kukboy View Post
SetWeaponDamage(weaponid, damage_type, Float:amount, Float:...);

Can i use this in the gamemode under OnPlayerDamage?
No, you can't use this function in OnPlayerDamage. You need to call it before OnPlayerDamage.

However we could look at OnPlayerDamage.
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
You could change the damage in OnPlayerDamage, this has the float value of "amount".
__________________
Jeroen52 is offline   Reply With Quote
Old 27/07/2019, 11:12 AM   #832
kukboy
Big Clucker
 
kukboy's Avatar
 
Join Date: Nov 2018
Posts: 57
Reputation: 6
Default Re: weapon-config.inc - Damage system with many features

Quote:
Originally Posted by Jeroen52 View Post
No, you can't use this function in OnPlayerDamage. You need to call it before OnPlayerDamage.

However we could look at OnPlayerDamage.
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
You could change the damage in OnPlayerDamage, this has the float value of "amount".
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;
			}
		}
What if we change the amounts of bullets
__________________
Paradise City Roleplay

IP: samp.paradisecityroleplay:7777
Discord: https://discord.gg/fC8srfw[/



-----------------------------------
kukboy is offline   Reply With Quote
Old 27/07/2019, 04:43 PM   #833
Jeroen52
Gangsta
 
Jeroen52's Avatar
 
Join Date: Oct 2008
Location: The Netherlands
Posts: 882
Reputation: 74
Default Re: weapon-config.inc - Damage system with many features

Quote:
Originally Posted by kukboy View Post
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;
			}
		}
What if we change the amounts of bullets
I wouldn't edit that value if I were you.

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 
Please read my previous posts once more and the documentation at https://github.com/oscar-broman/samp-weapon-config

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);
.
__________________
Jeroen52 is offline   Reply With Quote
Old 31/07/2019, 07:04 PM   #834
kukboy
Big Clucker
 
kukboy's Avatar
 
Join Date: Nov 2018
Posts: 57
Reputation: 6
Default Re: weapon-config.inc - Damage system with many features

Quote:
Originally Posted by Crayder View Post
Is SKY compiled? Where are the binaries... I can't build right now...
Quote:
Originally Posted by Jeroen52 View Post
I wouldn't edit that value if I were you.

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 
Please read my previous posts once more and the documentation at https://github.com/oscar-broman/samp-weapon-config

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);
.

Thanks, mate I like the idea +Reps
__________________
Paradise City Roleplay

IP: samp.paradisecityroleplay:7777
Discord: https://discord.gg/fC8srfw[/



-----------------------------------
kukboy is offline   Reply With Quote
Old 31/07/2019, 07:16 PM   #835
Jeroen52
Gangsta
 
Jeroen52's Avatar
 
Join Date: Oct 2008
Location: The Netherlands
Posts: 882
Reputation: 74
Default Re: weapon-config.inc - Damage system with many features

Quote:
Originally Posted by kukboy View Post
Thanks, mate I like the idea +Reps
Which SKY binaries do you need?
I could compile it for you.
__________________
Jeroen52 is offline   Reply With Quote
Old 06/08/2019, 05:24 PM   #836
israelStaff
Little Clucker
 
Join Date: Aug 2017
Posts: 36
Reputation: 0
Default Re: weapon-config.inc - Damage system with many features

When play fall from high his not die.
How to remove it?
israelStaff is offline   Reply With Quote
Old 07/08/2019, 01:36 AM   #837
Jeroen52
Gangsta
 
Jeroen52's Avatar
 
Join Date: Oct 2008
Location: The Netherlands
Posts: 882
Reputation: 74
Default Re: weapon-config.inc - Damage system with many features

Quote:
Originally Posted by israelStaff View Post
When play fall from high his not die.
How to remove it?
Did you change the custom fall damage?
__________________
Jeroen52 is offline   Reply With Quote
Old 07/08/2019, 12:45 PM   #838
israelStaff
Little Clucker
 
Join Date: Aug 2017
Posts: 36
Reputation: 0
Default Re: weapon-config.inc - Damage system with many features

Quote:
Originally Posted by Jeroen52 View Post
Did you change the custom fall damage?
Not.
israelStaff is offline   Reply With Quote
Old 07/08/2019, 02:57 PM   #839
Jeroen52
Gangsta
 
Jeroen52's Avatar
 
Join Date: Oct 2008
Location: The Netherlands
Posts: 882
Reputation: 74
Default Re: weapon-config.inc - Damage system with many features

Quote:
Originally Posted by israelStaff View Post
Not.
Can you show any relevant pieces of code or changes you've made?
__________________
Jeroen52 is offline   Reply With Quote
Old 31/08/2019, 10:15 PM   #840
Admireal
Big Clucker
 
Join Date: Sep 2016
Posts: 119
Reputation: 5
Default Re: weapon-config.inc - Damage system with many features

It is bugging CreateVehicle function.
Admireal is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with weapon damage system thanks JessThompson Scripting Help 7 15/07/2014 01:01 PM
[FilterScript] New Weapon Damage System [0.3z] RenSoprano Filterscripts 6 17/01/2014 06:03 AM
[FilterScript] Weapon damage system [v1.0] Darnell Filterscripts 74 21/10/2013 08:53 PM
[FilterScript] Weapon Damage System Donicans Filterscripts 14 06/11/2012 01:22 PM
[FilterScript] Realistic Weapon Damage And Death System [V1.0][New Cool FS] Nirzor Filterscripts 6 08/08/2012 05:34 AM


All times are GMT. The time now is 10:41 PM.


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