Hooking functions
#1

Код:
//		[GivePlayerMoney Hook]
#if defined _ALS_GivePlayerMoney
  #undef GivePlayerMoney
#else
#define _ALS_GivePlayerMoney
#endif
#define GivePlayerMoney GivePlayerMoneyEx

stock GivePlayerMoneyEx(playerid, money)
{
	Anticheat[playerid][Money] += money;
	ResetPlayerMoney(playerid);
	GivePlayerMoney(playerid, Anticheat[playerid][Money]);
	return GivePlayerMoney(playerid, Anticheat[playerid][Money]);
}
When i add that include to bare script and use simple command:

Код:
if(strcmp(cmd, "/a", true) == 0) {
		GivePlayerMoney(playerid, 200);
    	return 1;
	}
I am getting error of "Unknown command" what is wrong here...?
Reply
#2

The hook is supposed to be after the redefinition. Additionally, try using ZCMD - it's faster and more efficient.
Reply
#3

Quote:
Originally Posted by Abagail
Посмотреть сообщение
The hook is supposed to be after the redefinition. Additionally, try using ZCMD - it's faster and more efficient.
Ohh.. problem solved thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)