28.12.2012, 18:08
Hi, today i learned how to use this CallLocalFunction and Hooking
With this include you can do some cool things like this:
Include File:
well this is a small Include and i will not put in file and attach it... just copy paste it
just put this under of OnGameModeInit() or Main()
Now dont have your old SetPlayerScore Into SetPlayerScoreEx
it will automatically change by system
ENJOY!
With this include you can do some cool things like this:
pawn Код:
public OnPlayerScoreChange(playerid, newscore, oldscore)
{
if(newscore >= 100 && oldscore < 100) {
GameTextForPlayer(playerid, "[] Unlocked Rocket Luncher[]~n~Now you can use this weapon",4000,1);
}
return 1;
}
well this is a small Include and i will not put in file and attach it... just copy paste it
just put this under of OnGameModeInit() or Main()
pawn Код:
forward OnPlayerChangeScore(playerid, newscore, oldscore);
new OldScore[MAX_PLAYERS];
stock SetPlayerScoreEx(playerid, score)
{
OldScore[playerid] = GetPlayerScore(playerid);
SetPlayerScore(playerid, score);
return CallLocalFunction("OnPlayerChangeScore","iii",playerid, score, OldScore[playerid]);
}
#if defined _ALS_SetPlayerScore
#undef SetPlayerScore
#else
#define _ALS_SetPlayerScore
#endif
#define SetPlayerScore SetPlayerScoreEx
it will automatically change by system
Код:
Thanks to() { ****** - Told me how to to hook and i learned using "is[128]" stuff from his sscanf function ( THANK YOU! ) Dr.Lozer - for this include xD ;) return Rep++; }