25.02.2012, 19:04
VERSION 1.0
Released on 25/2/2012
INTRO:
Have you ever wanted to have no money hackers at all? Have you ever wanted your server being protected against money hackers that can buy everything? Well, this small include allows you to do so! Basically, it creates 2 textdraws that hide original SA money bar and third one on which is new money ammount displayed! It supports up to 7 digits ( maybe 8 ), and its plug-and-play! See bellow for installation help!
__________________________________________________ __________________________________________________
PREVIEW:
__________________________________________________ __________________________________________________
NATIVES:
pawn Код:
native GiveMoney(playerid,ammount); //give money to player
native TakeMoney(playerid,ammount); //take money from player
native SetMoney(playerid,ammount); //set players money to certain ammount
native ResetMoney(playerid); //reset players money
native GetMoney(playerid); //get money ammount that player owns (same as GetPlayerMoney)
STUF NEEDED:
One important thing needed to run this script perfectly is - Dini!
__________________________________________________ _______________________________________________
INSTALLATION:
1. Download .rar from Mediafire!
2. Extract anywhere!
3. Put "money.inc" into your "pawno/include" folder!
4. Put "Money" folder into "scriptfiles"!
5. Open some script and add:
pawn Код:
#include <money>
__________________________________________________ _______________________________________________
DOWNLOAD:
Mediafire v1.0
Or copy/paste:
pawn Код:
#if defined _money_included
#endinput
#endif
#define _money_included
#include <Dini>
new Text:MoneyTD[MAX_PLAYERS];
new Text:MoneyTD2[MAX_PLAYERS];
new Text:MoneyTD3[MAX_PLAYERS];
new PCash[MAX_PLAYERS];
new File[100];
/*Natives:
native GiveMoney(playerid,ammount);
native TakeMoney(playerid,ammount);
native SetMoney(playerid,ammount);
native ResetMoney(playerid);
native GetMoney(playerid);
*/
forward M_OnGameModeInit();
public OnGameModeInit()
{
for(new playerid=0; playerid < MAX_PLAYERS; playerid++)
{
MoneyTD[playerid] = TextDrawCreate(498.000000, 88.000000,"_");
TextDrawBackgroundColor(MoneyTD[playerid], 255);
TextDrawFont(MoneyTD[playerid], 1);
TextDrawLetterSize(MoneyTD[playerid], 0.500000, 1.000000);
TextDrawColor(MoneyTD[playerid], -1);
TextDrawSetOutline(MoneyTD[playerid], 0);
TextDrawSetProportional(MoneyTD[playerid], 1);
TextDrawSetShadow(MoneyTD[playerid], 1);
TextDrawUseBox(MoneyTD[playerid], 1);
TextDrawBoxColor(MoneyTD[playerid], 255);
TextDrawTextSize(MoneyTD[playerid], 625.000000, 480.000000);
MoneyTD2[playerid] = TextDrawCreate(498.000000, 78.000000,"_");
TextDrawBackgroundColor(MoneyTD2[playerid], 255);
TextDrawFont(MoneyTD2[playerid], 1);
TextDrawLetterSize(MoneyTD2[playerid], 0.500000, 1.000000);
TextDrawColor(MoneyTD2[playerid], -1);
TextDrawSetOutline(MoneyTD2[playerid], 0);
TextDrawSetProportional(MoneyTD2[playerid], 1);
TextDrawSetShadow(MoneyTD2[playerid], 1);
TextDrawUseBox(MoneyTD2[playerid], 1);
TextDrawBoxColor(MoneyTD2[playerid], 255);
TextDrawTextSize(MoneyTD2[playerid], 625.000000, 480.000000);
MoneyTD3[playerid] = TextDrawCreate(498.000000, 83.000000,"_");
TextDrawBackgroundColor(MoneyTD3[playerid], 255);
TextDrawFont(MoneyTD3[playerid], 3);
TextDrawLetterSize(MoneyTD3[playerid], 0.750000, 1.800000);
TextDrawColor(MoneyTD3[playerid], -1);
TextDrawSetOutline(MoneyTD3[playerid], 0);
TextDrawSetProportional(MoneyTD3[playerid], 1);
TextDrawSetShadow(MoneyTD3[playerid], 1);
TextDrawUseBox(MoneyTD3[playerid], 1);
TextDrawBoxColor(MoneyTD3[playerid], 255);
TextDrawTextSize(MoneyTD3[playerid], 625.000000, 480.000000);
if(funcidx("M_OnGameModeInit") != -1) CallLocalFunction("M_OnGameModeInit", "");
}
return 1;
}
#if defined _ALS_OnGameModeInit
#undef OnGameModeInit
#else
#define _ALS_OnGameModeInit
#endif
#define OnGameModeInit M_OnGameModeInit
forward M_OnPlayerConnect(playerid);
public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid,MoneyTD2[playerid]);
TextDrawShowForPlayer(playerid,MoneyTD[playerid]);
TextDrawShowForPlayer(playerid,MoneyTD3[playerid]);
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(File,sizeof(File),"/Money/%s.txt",playername);
if(dini_Exists(File))
{
PCash[playerid] = dini_Int(File,"Money");
}
else
{
dini_Create(File);
dini_IntSet(File, "Money", PCash[playerid]);
}
if(funcidx("M_OnPlayerConnect") != -1) CallLocalFunction("M_OnPlayerConnect", "i", playerid);
return 1;
}
#if defined _ALS_OnPlayerConnect
#undef OnPlayerConnect
#else
#define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect M_OnPlayerConnect
forward M_OnPlayerUpdate(playerid);
public OnPlayerUpdate(playerid)
{
new cashstr[100];
format(cashstr,sizeof(cashstr),"~g~$~w~%d", PCash[playerid]);
TextDrawSetString(MoneyTD3[playerid],cashstr);
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(File,sizeof(File),"/Money/%s.txt",playername);
if(dini_Exists(File))
{
dini_IntSet(File, "Money", PCash[playerid]);
}
if(funcidx("M_OnPlayerUpdate") != -1) CallLocalFunction("OnPlayerUpdate", "i", playerid);
return 1;
}
#if defined _ALS_OnPlayerUpdate
#undef OnPlayerUpdate
#else
#define _ALS_OnPlayerUpdate
#endif
#define OnPlayerUpdate M_OnPlayerUpdate
stock GiveMoney(playerid,ammount)
{
PCash[playerid] += ammount;
return 1;
}
stock TakeMoney(playerid,ammount)
{
PCash[playerid] -= ammount;
return 1;
}
stock SetMoney(playerid,ammount)
{
PCash[playerid] = ammount;
return 1;
}
stock ResetMoney(playerid)
{
PCash[playerid] = 0;
return 1;
}
stock GetMoney(playerid)
{
return PCash[playerid];
}
CREDITS:
fiki574_CRO - Creating everything
DracoBlue - His awesome Dini
__________________________________________________ _______________________________________________
Have fun!
Regards,
Fiki!