SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 02/02/2020, 01:08 PM   #1
gmstrikker
Huge Clucker
 
Join Date: Aug 2013
Posts: 374
Reputation: 0
Default Zero fall/fire damage/underwater breathless

How to set damage to zero on:
fire damage and or fall damage and or underwater breathless?

obs:
1 i cant use SetPlayerHealth(playerid, INFINITY);
2 i cant use weapon-config.inc https://forum.sa-mp.com/showthread.php?t=563387 i want to make a full custom script, cause my server is not normal

if someone knows the answer to at least one of these it would help a lot
gmstrikker is offline   Reply With Quote
Old 15/02/2020, 12:54 PM   #2
gmstrikker
Huge Clucker
 
Join Date: Aug 2013
Posts: 374
Reputation: 0
Default Re: Zero fall/fire damage/underwater breathless

bump
gmstrikker is offline   Reply With Quote
Old 22/02/2020, 10:35 AM   #3
gmstrikker
Huge Clucker
 
Join Date: Aug 2013
Posts: 374
Reputation: 0
Default Re: Zero fall/fire damage/underwater breathless

bump
gmstrikker is offline   Reply With Quote
Old 22/02/2020, 03:40 PM   #4
algorhitmically
Little Clucker
 
Join Date: Feb 2020
Posts: 18
Reputation: 8
Default Re: Zero fall/fire damage/underwater breathless

You can actually do it with weapon-config.
Here is list of weapon ids: https://wiki.sa-mp.com/wiki/Weapons

pawn Code:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
Called when damage is about to be inflicted on a player Most arguments can be modified (e.g. the damage could be adjusted)

    playerid - The player who is about to get damaged
    amount - The amount of damage about to get inflicted (0.0 means all HP) This will not always be the same in OnPlayerDamageDone, for example: if amount is 50.0 and you have 10.0, only 10.0 will be reported in OnPlayerDamageDone
    weapon - The weapon used to inflict the damage
    bodypart - The bodypart

Return 0 to prevent the damage from being inflicted

So you can check weapon id in OnPlayerDamage and if it is equal to let's say drowning id - just return 0!
algorhitmically 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
Make actor fall when take damage S3DOx Scripting Help 1 26/07/2019 08:37 AM
Detect damage (fire,explosion,fall) weex Scripting Help 4 03/02/2017 06:52 PM
Remove fall damage GoldenLion Scripting Help 8 26/08/2016 07:14 AM
Fall Damage not calling OnPlayerDeath Aerotactics Scripting Help 2 14/12/2014 08:44 AM
[AJUDA] NO FALL DAMAGE makino PortuguÍs/Portuguese 10 31/01/2012 10:53 PM


All times are GMT. The time now is 10:57 AM.


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