[HELP] How to make infinity armour ? - 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: [HELP] How to make infinity armour ? (
/showthread.php?tid=305798)
[HELP] How to make infinity armour ? -
c0GI - 23.12.2011
Hy! I make a script when health go to under 10000, the health will be back to 10000!!! But I want to anyone make a script with Armour infinity
LIKE THIS:
Quote:
new Float:HP; GetPlayerHealth(playerid, HP);
if(HP < 100000) SetPlayerHealth(playerid, 100000) || SetPlayerArmour(playerid, 10000)
|
Re: [HELP] How to make infinity armour ? -
Mini` - 23.12.2011
You didn't read the Scripting Basics and such on the wiki did you?
pawn Код:
new
Float:HP,
Float:Armour;
GetPlayerHealth(playerid, HP);
if(HP < 100000) {
SetPlayerHealth(playerid, 100000);
}
GetPlayerArmour(playerid, Armour);
if(Armour < 10000) {
SetPlayerArmour(playerid, 10000);
}
Is my guess at least :/
It's untested. And I wasn't sure how you wanted to handle giving player Armour, so I went ahead and checked it before giving it.
Re: [HELP] How to make infinity armour ? -
[ABK]Antonio - 23.12.2011
Quote:
Originally Posted by Mini`
You didn't read the Scripting Basics and such on the wiki did you?
pawn Код:
new Float:HP, Float:Armour; GetPlayerHealth(playerid, HP); if(HP < 100000) { SetPlayerHealth(playerid, 100000); } GetPlayerArmour(playerid, Armour); if(Armour < 10000) { SetPlayerArmour(playerid, 10000); }
Is my guess at least :/
It's untested. And I wasn't sure how you wanted to handle giving player Armour, so I went ahead and checked it before giving it.
|
Can make it smaller with
pawn Код:
new Float:HP, Float:Armour;
GetPlayerArmour(playerid, Armour);
GetPlayerHealth(playerid, HP);
if(HP < 10000 || Armour < 10000)
{
SetPlayerHealth(playerid, 10000);
SetPlayerArmour(playerid, 10000);
}
Does nearly the same thing its just a bit smaller
Re: [HELP] How to make infinity armour ? -
Mini` - 23.12.2011
Ehh probably doesn't matter for him...
But that will Set a users Armour higher if his Health is low... And Set Health higher if Armour is low... Right? Therefore it doesn't do the same thing.
Re: [HELP] How to make infinity armour ? -
Vince - 23.12.2011
pawn Код:
#define FLOAT_INFINITY (Float:0x7FFFFFFF)
Highest possible number you can get. Two billion and something, very unlikely to ever run out.
Re: [HELP] How to make infinity armour ? -
c0GI - 24.12.2011
Okej THANKS guys!! It works
))
Re: [HELP] How to make infinity armour ? -
eLeCTroNNN - 03.02.2015
Quote:
Originally Posted by [ABK]Antonio
Can make it smaller with
pawn Код:
new Float:HP, Float:Armour; GetPlayerArmour(playerid, Armour); GetPlayerHealth(playerid, HP); if(HP < 10000 || Armour < 10000) { SetPlayerHealth(playerid, 10000); SetPlayerArmour(playerid, 10000); }
Does nearly the same thing its just a bit smaller
|
Gives me warnings
Re: [HELP] How to make infinity armour ? -
CalvinC - 03.02.2015
Which warnings?
Re: [HELP] How to make infinity armour ? -
HydraHumza - 03.02.2015
show warning please