Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***************************************
- *** T - Money: Server side Money ***
- *** <!> v1.0 ***
- *** <!> Author: The Toni ***
- *** <!> Last Update: 3/9/10 ***
- *** <!> Native Functions: ***
- *** <!> T_GivePlayerMoney ***
- *** <!> T_ResetPlayerMoney ***
- *** <!> T_TakePlayerMoney ***
- ***************************************/
- #include <a_samp>
- new
- Money[MAX_PLAYERS],
- Timer
- ;
- //==============================================================================
- // -> T_OnGameModeInit() - Add this under OnGameModeInit()
- //==============================================================================
- stock T_OnGameModeInit()
- {
- for(new a = 0; a < MAX_PLAYERS; ++a)
- {
- Timer = SetTimerEx("omgwtfh4x", 750, 1, "i", a);
- }
- }
- //==============================================================================
- // -> T_OnGameModeExit() - Add this under OnGameModeExit()
- //==============================================================================
- stock T_OnGameModeExit()
- {
- KillTimer(Timer);
- }
- //==============================================================================
- // -> T_OnFilterScriptInit() - Add this under OnFilterScriptInit()
- //==============================================================================
- stock T_OnFilterScriptInit()
- {
- for(new j = 0; j < MAX_PLAYERS; ++a)
- {
- Timer = SetTimerEx("omgwtfh4x", 750, 1, "i", playerid);
- }
- }
- //==============================================================================
- // -> T_OnFilterScriptExit() - Add this under OnFilterScriptExit()
- //==============================================================================
- stock T_OnFilterScriptExit()
- {
- KillTimer(Timer);
- return 1;
- }
- //==============================================================================
- // -> T_GivePlayerMoney - Use this function to give player money!
- //==============================================================================
- stock T_GivePlayerMoney(playerid, amount)
- {
- Money[playerid] += amount;
- GivePlayerMoney(playerid, amount);
- }
- //==============================================================================
- // -> T_ResetPlayerMoney - Use this function to reset a player's money!
- //==============================================================================
- stock T_ResetPlayerMoney(playerid)
- {
- Money[playerid] = 0;
- ResetPlayerMoney(playerid);
- }
- //==============================================================================
- // -> T_TakePlayerMoney - Use this function to take a player's money!
- //==============================================================================
- stock T_TakePlayerMoney(playerid, amount)
- {
- Money[playerid] -= amount;
- GivePlayerMoney(playerid, -amount);
- }
- //==============================================================================
- // -> Da ultimate public :3
- //==============================================================================
- forward omgwtfh4x(playerid);
- public omgwtfh4x(playerid)
- {
- if(Money[playerid] < GetPlayerMoney(playerid))
- {
- new
- str[128],
- pName[24];
- GetPlayerName(playerid, pName, 24);
- format(str, sizeof(str), "SERVER: %s has been kicked for money hacking!", pName);
- SendClientMessageToAll(0xFFFFFF, str);
- Kick(playerid);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment