SA-MP Forums Archive
SetPlayerArmour - 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: SetPlayerArmour (/showthread.php?tid=443626)



SetPlayerArmour - dubyabeast - 13.06.2013

Is it possible to edit SetPlayerArmour to where it still sets the player's Armour, but it checks if the Float:Armour is above 99 and it will automatically set it to 99 if it's above it (for anti-cheat reasons).

If so, would it be something like this?:

pawn Код:
stock SetPlayerArmourEx(playerid, Float:armour)
{
    if(armour > 99) armour = 99;
    return SetPlayerArmour(playerid, armour);
}

#define SetPlayerArmour SetPlayerArmourEx



Re: SetPlayerArmour - PaulDinam - 13.06.2013

It will not working for anti-cheat, as you only make a new define for SetPlayerArmour, you can't use it as a stock.


Re: SetPlayerArmour - dubyabeast - 13.06.2013

Quote:
Originally Posted by PaulDinam
Посмотреть сообщение
It will not working for anti-cheat, as you only make a new define for SetPlayerArmour, you can't use it as a stock.
I don't get what you mean here.


Re: SetPlayerArmour - daemon3304 - 13.06.2013

u mean when he spawn he get armour he type /armour he get armour 100


Re: SetPlayerArmour - daemon3304 - 13.06.2013

if u want to type like that Type /armour u get 100 armour ...http://www.solidfiles.com/d/f587e6b7cb/
http://pastebin.com/qwqMBD7D
http://www.mediafire.com/?z22wv3343sv2a8d


Re: SetPlayerArmour - Dubya - 13.06.2013

That isn't what I meant at all, daemon3304. How the hell did you come up with that is what I mean? First off, don't double post. Second, I am trying to make it so that if I do SetPlayerArmour(playerid, 100); inside of the SetPlayerArmour, it checks if it is above 99 (the armour amount to set) and sets it to 99 if it is above 99.


Re: SetPlayerArmour - daemon3304 - 13.06.2013

aha okay )


Re: SetPlayerArmour - daemon3304 - 13.06.2013

take http://pastebin.com/YNLD9WRW


Re: SetPlayerArmour - Jewell - 13.06.2013

You should hook the function.

add this code in a include or top of the script.

pawn Код:
stock SetPlayerArmourEx(playerid,Float:amount)
{
    if(amount > 99.0) amount = 99.0;
    return SetPlayerArmour(playerid,amount);
}

#if defined _ALS_SetPlayerArmour
    #undef SetPlayerArmour
#else
    #define _ALS_SetPlayerArmour
#endif
#define SetPlayerArmour SetPlayerArmourEx

@daemon3304, You clear don't understand what he meant. You just made a command that set player health to 99.