SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 01/05/2016, 07:58 PM   #31
Manyula
Huge Clucker
 
Join Date: Jan 2012
Location: Germany
Posts: 282
Reputation: 43
Default Re: Custom Playerdamage system

Quote:
Originally Posted by CalvinC View Post
Armour is just the same as health, just that you put it under "default" in the switch, as i explained in the last line.
I am not exactly sure if your implementation accounts for the transition from health to armor, like if a player gets hit with 30 damage and is only left with 15 armor. Do you mind elaborating a little bit on that? I don't know if I'm missing something.

Quote:
Originally Posted by CalvinC View Post
And infact i think he would be left with 0.99 health in your example, since GetPlayerHealth rounds the health, while SetPlayerHealth does not.
Atleast that's what it said on the wiki, but even if SetPlayerHealth rounds too, the player would need to receive 49.5 damage to round up to 50.

But if you want to be that accurate you can, it wouldn't differ more than 0.5 at most though.
Well, I once had a timer that was supposed to reduce the player's health by 0.1 and ended up reducing it 1.0 per tick. That leads to the assumption that as long as there is ANY decimal number, even if it is really really small, SetPlayerHealth rounds up to the next integer.
__________________
Manyula is offline   Reply With Quote
Old 15/08/2016, 10:26 PM   #32
oSAINTo
Huge Clucker
 
oSAINTo's Avatar
 
Join Date: Aug 2015
Posts: 220
Reputation: 35
Default Re: Custom Playerdamage system

Whenever I use this code, removing the player health works. Yet, when I try and remove the armor, it crashes the server.
oSAINTo is offline   Reply With Quote
Old 16/08/2016, 02:28 AM   #33
oSAINTo
Huge Clucker
 
oSAINTo's Avatar
 
Join Date: Aug 2015
Posts: 220
Reputation: 35
Default Re: Custom Playerdamage system

Quote:
Originally Posted by oSAINTo View Post
Whenever I use this code, removing the player health works. Yet, when I try and remove the armor, it crashes the server.
Bump
oSAINTo is offline   Reply With Quote
Old 18/06/2018, 03:55 PM   #34
GameOvr
Big Clucker
 
Join Date: Jun 2018
Posts: 101
Reputation: 0
Default Re: Custom Playerdamage system

Thank u very much nice tutorial , I was looking for this damage shit
GameOvr 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
[GameMode] ---Basic Deathmatch Script - Custom classes - Score System - Full Admin System - [0.3z]--- Irektyou11 Gamemode Scripts 14 02/01/2015 11:14 PM
[FilterScript] Radio System Custom San1 Filterscripts 5 03/01/2013 04:27 AM
Playerdamage? Chrillzen Scripting Help 3 10/02/2012 08:52 PM
XML custom menu system. aralmo Filterscripts 6 27/06/2009 08:35 AM


All times are GMT. The time now is 05:12 AM.


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