PDA

View Full Version : SetPlayerArmour


dubyabeast
13/06/2013, 02:29 AM
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?:


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

#define SetPlayerArmour SetPlayerArmourEx

PaulDinam
13/06/2013, 02:31 AM
It will not working for anti-cheat, as you only make a new define for SetPlayerArmour, you can't use it as a stock.

dubyabeast
13/06/2013, 02:32 AM
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.

daemon3304
13/06/2013, 06:08 AM
u mean when he spawn he get armour he type /armour he get armour 100

daemon3304
13/06/2013, 06:22 AM
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

Dubya
13/06/2013, 08:03 AM
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.

daemon3304
13/06/2013, 08:35 AM
aha okay :))

daemon3304
13/06/2013, 08:37 AM
take http://pastebin.com/YNLD9WRW

Jewell
13/06/2013, 09:00 AM
You should hook the function.

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

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.