[HELP] How to make infinity armour ?
#1

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)

Reply
#2

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.
Reply
#3

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
Reply
#4

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.
Reply
#5

pawn Код:
#define FLOAT_INFINITY (Float:0x7FFFFFFF)
Highest possible number you can get. Two billion and something, very unlikely to ever run out.
Reply
#6

Okej THANKS guys!! It works ))
Reply
#7

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
Reply
#8

Which warnings?
Reply
#9

show warning please
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)