Define function
#1

Hi,

I'am making anti cheat and i don't know how to define function and i can directly call to function because now i do

stock GivePlayerMoneyZ( playerid, ammount )
{
GivePlayerMoney( playerid, ammount );
MONEY[ playerid ] +=ammount;
}

And i need in every place replace GivePlayerMoney to GivePlayerMoneyZ, how to make that i could left GivePlayerMoney but this stock get called when i call this function
Reply
#2

You don't really need to do that, you can just replace them all at once by pressing ctrl + H.

But anyway;

PHP код:
#if defined _ALS_GivePlayerMoney
    #undef GivePlayerMoney
#else
    #define _ALS_GivePlayerMoney
#endif
#define GivePlayerMoney GivePlayerMoneyZ
// stock isn't needed for this
GivePlayerMoneyZplayeridammount )
{
    
GivePlayerMoneyplayeridammount );
    
MONEYplayerid ] +=ammount;

Reply
#3

This no working because GivePlayerMoney in function giveplayermoneyz call as giveplayermoneyz and this can crash server
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)