SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 12/06/2017, 07:47 PM   #41
Whatname
Big Clucker
 
Join Date: Aug 2016
Posts: 178
Reputation: 12
Default Re: givehp gethp?

Shot the functions
Whatname is offline   Reply With Quote
Old 12/06/2017, 07:48 PM   #42
Crystallize
Banned
 
Join Date: Aug 2013
Posts: 1,504
Reputation: 314
Default Re: givehp gethp?

Code:
new currenthealth = pInfo[i][pHealth];
		new newhealth = 1500;
		currenthealth += newhealth;
		pInfo[i][pHealth] += newhealth;
and
Code:
GetHealth(playerid) return pInfo[playerid][pHealth];
Crystallize is offline   Reply With Quote
Old 12/06/2017, 07:49 PM   #43
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,140
Reputation: 445
Default Re: givehp gethp?

You need to use float variables, e.g:
new Float: currenthealth, Float: newhealth = 1500.0;
Abagail is offline   Reply With Quote
Old 12/06/2017, 07:52 PM   #44
Crystallize
Banned
 
Join Date: Aug 2013
Posts: 1,504
Reputation: 314
Default Re: givehp gethp?

Quote:
Originally Posted by Abagail View Post
You need to use float variables, e.g:
new Float: currenthealth, Float: newhealth = 1500.0;
C:\Users\xc0de\Desktop\tst\gamemodes\zm1.pwn(2006) : warning 221: label name "Float" shadows tag name
C:\Users\xc0de\Desktop\tst\gamemodes\zm1.pwn(2006) : warning 203: symbol is never used: "Float"
Crystallize is offline   Reply With Quote
Old 12/06/2017, 07:57 PM   #45
Bolex_
Gangsta
 
Bolex_'s Avatar
 
Join Date: Aug 2015
Location: Croatia.
Posts: 592
Reputation: 117
Default Re: givehp gethp?

As example, just do it on own way!

Code:
new Float: Health = GetPlayerHealth(player);
new Float: Armour = GetPlayerArmour(player);
Bolex_ is offline   Reply With Quote
Old 12/06/2017, 08:05 PM   #46
Whatname
Big Clucker
 
Join Date: Aug 2016
Posts: 178
Reputation: 12
Default Re: givehp gethp?

You need to use float if not can use floatround wich converts float to int
Whatname is offline   Reply With Quote
Old 13/06/2017, 02:03 PM   #47
Crystallize
Banned
 
Join Date: Aug 2013
Posts: 1,504
Reputation: 314
Default Re: givehp gethp?

Players are still getting 51903509310 hp wtf...
the function doctorshield is called onplayerupdate.
Crystallize is offline   Reply With Quote
Old 13/06/2017, 02:19 PM   #48
Whatname
Big Clucker
 
Join Date: Aug 2016
Posts: 178
Reputation: 12
Default Re: givehp gethp?

i pm'd you
Whatname is offline   Reply With Quote
Old 13/06/2017, 02:23 PM   #49
renatog
Huge Clucker
 
Join Date: Mar 2016
Posts: 328
Reputation: 48
Default Re: givehp gethp?

How do you know you're getting 51903509310 hp? Show me the code you're using to print the values.
renatog 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
/gethp DerickClark Scripting Help 14 07/03/2013 03:28 AM
/gethp DerickClark Scripting Help 9 05/03/2013 10:16 PM
My own /givehp playerid health Guitar Scripting Help 4 21/08/2012 04:42 PM
[Tutorial] Basic Commands 1 (ZCMD)- /explode, /gethp SKAzini Tutorials 0 19/08/2012 06:27 PM


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


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