SetPlayerArmour
#1

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

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

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

u mean when he spawn he get armour he type /armour he get armour 100
Reply
#5

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

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

aha okay )
Reply
#8

take http://pastebin.com/YNLD9WRW
Reply
#9

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


Forum Jump:


Users browsing this thread: 1 Guest(s)