Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ----------------------------------------------[MONEYBAG SYSTEM MADE BY THATFAG - SAMP FORUMS]---------------------------------------------------------------------
- PLEASE FOR ANYONE THAT IS USING THIS SCRIPT DO NOT REMOVE THE CREDITS OR TAKE IT AS YOUR OWN WORK, THANK YOU.
- */
- #include <a_samp>
- #include <zcmd>
- #include <dini>
- #include <streamer>
- #define MAX_BAGS 30
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" MONEYBAG SYSTEM BY THATFAG - SAMP FORUMS");
- print(" MONEYBAG SYSTEM BY THATFAG - SAMP FORUMS");
- print(" MONEYBAG SYSTEM BY THATFAG - SAMP FORUMS");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- enum eBags
- {
- BagAmount,
- BagPickup,
- Text3D:BagLabel,
- Float:BagX,
- Float:BagY,
- Float:BagZ,
- }
- new BagInfo[MAX_BAGS][eBags];
- stock ReturnNextUnusedBag()
- {
- new path[32];
- for(new a=0;a<MAX_BAGS;a++)
- {
- format(path,sizeof(path),"Bags/%d.txt",a);
- if(dini_Exists(path)) continue;
- return a;
- }
- return -1;
- }
- stock CreateBag(Float:x,Float:y,Float:z, Amount)
- {
- for(new e=0;e<MAX_BAGS;e++)
- {
- new bagid=ReturnNextUnusedBag();
- new path[32],string[50];
- format(path,sizeof(path),"Bags/%d.txt",e);
- dini_FloatSet(path,"X",x);
- dini_FloatSet(path,"Y",y);
- dini_FloatSet(path,"Z",z);
- dini_IntSet(path,"amount", Amount);
- BagInfo[bagid][BagX] = x;
- BagInfo[bagid][BagY] = y;
- BagInfo[bagid][BagZ] = z;
- format(string, sizeof(string), "Bag ID[%d] - BagAmount [%d]",bagid,dini_Int(path,"amount"));
- BagInfo[bagid][BagLabel]= CreateDynamic3DTextLabel(string, 0xFFFFFFFF, BagInfo[bagid][BagX],BagInfo[bagid][BagY],BagInfo[bagid][BagZ],10);
- BagInfo[bagid][BagPickup] = CreateDynamicPickup(1550,1,x,y,z-0.5);
- return bagid;
- }
- return 1;
- }
- COMMAND:createbag(playerid, params[])
- {
- new atmid=ReturnNextUnusedBag(), iamount;
- printf("%d",atmid);
- if( sscanf ( params, "d",iamount)) return SendClientMessage(playerid,-1, "/createbag [bag cash]");
- new hf[64];
- new Float: x, Float: y, Float: z, Float: a;
- GetPlayerPos(playerid,x,y,z);
- GetPlayerFacingAngle(playerid,a);
- format(hf,sizeof(hf),"Bags/%d.txt",atmid);
- if(!dini_Exists(hf))
- {
- dini_Create(hf);
- dini_FloatSet(hf,"X",x);
- dini_IntSet(hf,"amount",iamount);
- dini_FloatSet(hf,"Y",y);
- dini_FloatSet(hf,"Z",z);
- BagInfo[atmid][BagAmount] = iamount;
- CreateBag(x,y,z,iamount);
- return 1;
- }
- return 1;
- }
- stock LoadBags()
- {
- new file[64], string[50];
- for(new e=0;e<MAX_BAGS;e++)
- {
- format(file,sizeof(file),"Bags/%d.txt",e);
- new Float: X, Float: Y, Float: Z,Amount;
- X = dini_Float(file,"X");
- Y = dini_Float(file,"Y");
- Z = dini_Float(file,"Z");
- Amount = dini_Int(file,"amount");
- if(dini_Exists(file))
- {
- BagInfo[e][BagX]=X;
- BagInfo[e][BagY]=Y;
- BagInfo[e][BagZ]=Z;
- BagInfo[e][BagAmount] = Amount;
- BagInfo[e][BagPickup] = CreateDynamicPickup(1550,1,X,Y,Z);
- format(string, sizeof(string), "Bag ID[%d] - BagAmount [%d]",e,dini_Int(file,"amount"));
- BagInfo[e][BagLabel]= CreateDynamic3DTextLabel(string, 0xFFFFFFFF, BagInfo[e][BagX],BagInfo[e][BagY],BagInfo[e][BagZ],10);
- }
- }
- printf("Bags loaded successfully.");
- return 1;
- }
- COMMAND:pickbag(playerid, params[])
- {
- for(new e=0;e<MAX_BAGS;e++)
- {
- if(IsPlayerInRangeOfPoint(playerid,5, BagInfo[e][BagX],BagInfo[e][BagY],BagInfo[e][BagZ]))
- {
- new file[64],Amount;
- format(file,sizeof(file),"Bags/%d.txt",e);
- Amount = dini_Int(file,"amount");
- BagInfo[playerid][BagAmount] = Amount;
- GivePlayerMoney(playerid, BagInfo[playerid][BagAmount]);
- dini_Remove(file);
- DestroyDynamicPickup(BagInfo[e][BagPickup]);
- DestroyDynamic3DTextLabel(BagInfo[e][BagLabel]);
- }
- }
- return 1;
- }
- COMMAND:deletebag(playerid, params[])
- {
- new id;
- if( sscanf ( params, "d", id)) return SendClientMessage(playerid,-1, "[Bag ID]");
- new hf[64];
- format(hf,sizeof(hf),"Bags/%d.txt",id);
- if(!dini_Exists(hf)) return SendClientMessage(playerid,-1,"There is no bag with this ID");
- dini_Remove(hf);
- DestroyDynamicPickup(BagInfo[id][BagPickup]);
- DestroyDynamic3DTextLabel(BagInfo[id][BagLabel]);
- return 1;
- }
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("Blank Script");
- LoadBags();
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
Add Comment
Please, Sign In to add comment