SA-MP Forums Archive
[Help] A limit for 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] A limit for armour. (/showthread.php?tid=293833)



[Help] A limit for armour. - Da' J' - 30.10.2011

So the thing i try to do, is to make a max. amount of armour which can be given in the situation. (In this case, drugs)
I tried this:
pawn Код:
}
            if(GetPlayerArmour(playerid, armour == 60));
            {
                SendClientMessage(playerid, COLOR_WHITE, "** You cannot use any more drugs.");
                return 1;
            }
So any help? :/


Re: [Help] A limit for armour. - Max_Coldheart - 30.10.2011

So this doesn't work?


Re: [Help] A limit for armour. - Norn - 30.10.2011

Learn the correct usage of GetPlayerArmour.


Re: [Help] A limit for armour. - Lorenc_ - 30.10.2011

pawn Код:
new armour;
GetPlayerArmour(playerid, armour);
if(armour == 60.0)
{
    SendClientMessage(playerid, COLOR_WHITE, "** You cannot use any more drugs.");
    return 1;
}



Re: [Help] A limit for armour. - Max_Coldheart - 30.10.2011

Quote:
Originally Posted by Lorenc_
Посмотреть сообщение
pawn Код:
new armour;
GetPlayerArmour(playerid, armour);
if(armour == 60.0)
{
    SendClientMessage(playerid, COLOR_WHITE, "** You cannot use any more drugs.");
    return 1;
}
I doubt he wants it only to work only at 60, so wouldn't it be better to do like

pawn Код:
new armour;
GetPlayerArmour(playerid, armour);
if(armour >= 60.0)
{
    SendClientMessage(playerid, COLOR_WHITE, "** You cannot use any more drugs.");
    return 1;
}
?


Re: [Help] A limit for armour. - Norn - 30.10.2011

Quote:
Originally Posted by Max_Coldheart
Посмотреть сообщение
I doubt he wants it only to work only at 60, so wouldn't it be better to do like

pawn Код:
new armour;
GetPlayerArmour(playerid, armour);
if(armour >= 60.0)
{
    SendClientMessage(playerid, COLOR_WHITE, "** You cannot use any more drugs.");
    return 1;
}
?
That is 60, it's irrelevant.


Re: [Help] A limit for armour. - Max_Coldheart - 30.10.2011

Quote:
Originally Posted by Norn
Посмотреть сообщение
That is 60, it's irrelevant.
Tho my code checks if its MORE or EXACTLY 60.


Re: [Help] A limit for armour. - Norn - 30.10.2011

Quote:
Originally Posted by Max_Coldheart
Посмотреть сообщение
Tho my code checks if its MORE or EXACTLY 60.
Oh sorry it's 7am here, I thought you just added a deciminal point haha my bad.


Re: [Help] A limit for armour. - Da' J' - 30.10.2011

Quote:
Originally Posted by Max_Coldheart
Посмотреть сообщение
I doubt he wants it only to work only at 60, so wouldn't it be better to do like

pawn Код:
new armour;
GetPlayerArmour(playerid, armour);
if(armour >= 60.0)
{
    SendClientMessage(playerid, COLOR_WHITE, "** You cannot use any more drugs.");
    return 1;
}
?
Wit hthis, it only lets me use the drugsonce, and mo mor. Even not untill the 60 comes up.


Re: [Help] A limit for armour. - SmiT - 30.10.2011

Your variable called "armour" should be a Float.