SA-MP Forums Archive
[Functions] GivePlayerHealth & GivePlayerArmour & GivePlayerScore - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Functions] GivePlayerHealth & GivePlayerArmour & GivePlayerScore (/showthread.php?tid=151210)



[Functions] GivePlayerHealth & GivePlayerArmour & GivePlayerScore - aircombat - 29.05.2010

Here is a little tutorial about those 3 functions in the title , i know most people out there will just say its useless , but it's not for beginners

1.GivePlayerHealth :
Add anywhere in the script (Not in a callback)

pawn Код:
stock GivePlayerHealth(playerid,Float:Health)
{
new Float:health; GetPlayerHealth(playerid,health);
SetPlayerHealth(playerid,health+Health);
}
2.GivePlayerArmour :
Add anywhere in the script (Not in a callback)

pawn Код:
stock GivePlayerArmour(playerid,Float:Armour)
{
new Float:armour; GetPlayerHealth(playerid,armour);
SetPlayerArmour(playerid,armour+Armour);
}
3.GivePlayerScore :
Add anywhere in the script (Not in a callback)

pawn Код:
stock GivePlayerScore(playerid,Score)
{
SetPlayerScore(playerid,GetPlayerScore(playerid)+Score);
}
-------------------------------------------------------------------------------------------------------------------
Special Thanks To ViruZZzZ_ChiLLL For Testing The Codes ( I'm Not Home Atm )


Re: [Functions] GivePlayerHealth & GivePlayerArmour & GivePlayerScore - WackoX - 29.05.2010

Put it in the useful functions list, this isn't a FS nor an Include.
And also please learn some identation.


Re: [Functions] GivePlayerHealth & GivePlayerArmour & GivePlayerScore - aircombat - 29.05.2010

No i ain't putting it anywhere lol , its here except an admin move it , and no offense but its my code and i like it like that


Respuesta: [Functions] GivePlayerHealth & GivePlayerArmour & GivePlayerScore - [TF]Death_Ghost - 24.06.2011

Good Work, but i think the GivePlayerScore it's:

pawn Код:
stock GivePlayerScore(playerid,Float:Score)
{
    SetPlayerScore(playerid,GetPlayerScore(playerid)+Score);
}



Re: [Functions] GivePlayerHealth & GivePlayerArmour & GivePlayerScore - Mauzen - 24.06.2011

No, the score isnt tagged as float, it is just an integer.
BTW there was no need to bump still, again im wondering how you even found that.


Respuesta: [Functions] GivePlayerHealth & GivePlayerArmour & GivePlayerScore - Treyfus - 27.04.2012

Well I do not speak English but you are reading this was translated by ****** translator.

and well I wanted to in section desir Spanish, published a post called an include GPH and that it ise me if they want to download and view mirenlon dowload.

here the link:

https://sampforum.blast.hk/showthread.php?tid=337673


Re: [Functions] GivePlayerHealth & GivePlayerArmour & GivePlayerScore - doreto - 27.04.2012

why i will make stock for GivePlayerHealth,GivePlayerArmor than i can use SetPlayerHealth, SetPlayerArmor, ?


Respuesta: [Functions] GivePlayerHealth & GivePlayerArmour & GivePlayerScore - Treyfus - 28.04.2012




AW: [Functions] GivePlayerHealth & GivePlayerArmour & GivePlayerScore - ElMelo - 11.04.2013

I like it, Good Job men