Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * ATM System, Script 2011..
- * FilterScript Creato Interamente da S&C AkA Cirs Carandente, Non rimuovere i crediti!!
- * Ringraziamenti: SA-MP Team Per SAMP e a_samp.inc xD
- * Ringraziamenti: Drac0blue per Dini.
- */
- #include <a_samp>
- #include <dini>
- enum ATM
- {
- ContoBancario
- }
- new Atm[MAX_PLAYERS][ATM];new file[150];
- //===========VARI-DEFINE=============
- /*Define Percorso file*/
- #define PERCORSO "SCATM/%s.ini"
- /*Define Dialog*/
- #define ATMDIALOG 5
- #define GIVEATMMONEY 50
- #define BONIFICO 60
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- //======Object ATM Per tutta LS======
- CreateObject(2942, 1928.85253906, -1769.68933105, 13.18977451, 0.00000000, 0.00000000, 94.00000000);
- CreateObject(2942, 1737.41809082, -1863.49975586, 13.21789742, 0.00000000, 0.00000000, 175.99902344);
- CreateObject(2942, 1507.15856934, -1672.90502930, 13.68977451, 0.00000000, 0.00000000, 84.00000000);
- CreateObject(2942, 1315.14697266, -1367.85705566, 13.19184208, 0.00000000, 0.00000000, 0.00000000);
- CreateObject(2942, 1147.54638672, -1415.56066895, 13.31543922, 0.00000000, 0.00000000, 182.00000000);
- CreateObject(2942, 542.93206787, -1264.94409180, 16.32130814, 0.00000000, 0.00000000, 217.99951172);
- CreateObject(2942, 1034.24804688, -1339.46875000, 13.36946201, 0.00000000, 0.00000000, 182.00000000);
- CreateObject(2942, 2013.38476562, -1451.24255371, 13.19758701, 0.00000000, 0.00000000, 0.00000000);
- CreateObject(2942, 2128.33911133, -1769.59240723, 13.20264721, 0.00000000, 0.00000000, 268.00000000);
- CreateObject(2942, 1722.44250488, -1613.41235352, 13.18977451, 0.00000000, 0.00000000, 182.00000000);
- CreateObject(2942, 1415.26000977, -1693.91967773, 13.18977451, 0.00000000, 0.00000000, 69.99951172);
- //======Icone Soldi Per ATM======||
- CreatePickup(1274, 24, 542.5908, -1264.3429, 16.6761);
- CreatePickup(1274, 24, 1034.1892, -1338.8004, 13.7266);
- CreatePickup(1274, 24, 1147.4930, -1414.8746, 13.6727);
- CreatePickup(1274, 24, 1315.1608, -1368.5203, 13.5577);
- CreatePickup(1274, 24, 1415.8967, -1694.1305, 13.5469);
- CreatePickup(1274, 24, 1507.8236, -1672.9354, 14.0469);
- CreatePickup(1274, 24, 1929.5099, -1769.5654, 13.546);
- CreatePickup(1274, 24, 2127.6775, -1769.5358, 13.5598);
- CreatePickup(1274, 24, 1737.3802, -1862.8267, 13.5758);
- CreatePickup(1274, 24, 1722.4089, -1612.7482, 13.5469);
- CreatePickup(1274, 24, 2013.3716, -1451.9055, 13.5547);
- //======3D Text Label======||
- Create3DTextLabel("Premi ALT per aprire il menu del tuo conto bancario", 0x00ff00ff, 542.5908,-1264.3429,16.6761, 20.0,0);
- Create3DTextLabel("Premi ALT per aprire il menu del tuo conto bancario", 0x00ff00ff, 1034.1892,-1338.8004,13.7266, 20.0,0);
- Create3DTextLabel("Premi ALT per aprire il menu del tuo conto bancario", 0x00ff00ff, 1147.4930,-1414.8746,13.6727, 20.0,0);
- Create3DTextLabel("Premi ALT per aprire il menu del tuo conto bancario", 0x00ff00ff, 1315.1608,-1368.5203,13.5577, 20.0,0);
- Create3DTextLabel("Premi ALT per aprire il menu del tuo conto bancario", 0x00ff00ff, 1415.8967,-1694.1305,13.5469, 20.0,0);
- Create3DTextLabel("Premi ALT per aprire il menu del tuo conto bancario", 0x00ff00ff, 1507.8236,-1672.9354,14.0469, 20.0,0);
- Create3DTextLabel("Premi ALT per aprire il menu del tuo conto bancario", 0x00ff00ff, 1929.5099,-1769.5654,13.546, 20.0,0);
- Create3DTextLabel("Premi ALT per aprire il menu del tuo conto bancario", 0x00ff00ff, 2127.6775,-1769.5358,13.5598, 20.0,0);
- Create3DTextLabel("Premi ALT per aprire il menu del tuo conto bancario", 0x00ff00ff, 1737.3802,-1862.8267,13.5758, 20.0,0);
- Create3DTextLabel("Premi ALT per aprire il menu del tuo conto bancario", 0x00ff00ff, 1722.4089,-1612.7482,13.5469, 20.0,0);
- Create3DTextLabel("Premi ALT per aprire il menu del tuo conto bancario", 0x00ff00ff, 2013.3716,-1451.9055,13.5547, 20.0,0);
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- format(file, sizeof(file), PERCORSO, Nome(playerid));
- if(!dini_Exists(file))
- {
- dini_Create(file);
- dini_IntSet(file, "ContoBancario", 0);
- }
- Atm[playerid][ContoBancario] = dini_Int(file, "ContoBancario");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- format(file, sizeof(file), PERCORSO, Nome(playerid));
- dini_IntSet(file, "ContoBancario", Atm[playerid][ContoBancario]);
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys == KEY_WALK)
- {
- if(AUnAtm(playerid))
- {
- ShowPlayerDialog(playerid, ATMDIALOG, DIALOG_STYLE_LIST, "Scelta", "Ritira Soldi\nDeposita Soldi\nBonifico\nBilancio Bancario", "Scegli", "Annulla");
- }
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/givemoney", cmdtext, true, 10) == 0)
- {
- if(!IsPlayerAdmin(playerid))return 0;
- ShowPlayerDialog(playerid, GIVEATMMONEY, DIALOG_STYLE_INPUT, "ID Player", "Inserisci l'Id del player a cui givare i soldi", "Giva", "Annulla");
- return 1;
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == ATMDIALOG && response)
- {
- switch(listitem)
- {
- case 0:ShowPlayerDialog(playerid, ATMDIALOG+1, DIALOG_STYLE_INPUT, "Ritira", "Scrivi la quantità dei soldi da ritirare", "Ritira", "Annulla");
- case 1:ShowPlayerDialog(playerid, ATMDIALOG+2, DIALOG_STYLE_INPUT, "Deposita", "Scrivi la quantità dei soldi da depositare", "Deposita", "Annulla");
- case 2:ShowPlayerDialog(playerid, BONIFICO, DIALOG_STYLE_INPUT, "ID", "Inserisci l'ID del player a cui bonificare i soldi", "Giva", "Annulla");
- case 3:
- {
- format(file, sizeof(file), "Attualmente, in banca hai: $%d", Atm[playerid][ContoBancario]);
- SendClientMessage(playerid, -1, file);
- format(file, sizeof(file), "Attualmente, in banca hai: $%d", Atm[playerid][ContoBancario]);
- ShowPlayerDialog(playerid, 999+123, DIALOG_STYLE_INPUT, "Stato", file, "Ok", "Ok");
- }
- }
- }
- if(dialogid == ATMDIALOG+1 && response)
- {
- new soldidarit = strval(inputtext);
- format(file, sizeof(file), PERCORSO, Nome(playerid));
- if(!response)return 0;
- if(soldidarit > Atm[playerid][ContoBancario])return ShowPlayerDialog(playerid, ATMDIALOG+1, DIALOG_STYLE_INPUT, "Ritira", "Non hai tutti questi soldi!!\nScrivi la quantità dei soldi da ritirare", "Ritira", "Annulla");
- if(soldidarit < 1)return ShowPlayerDialog(playerid, ATMDIALOG+1, DIALOG_STYLE_INPUT, "Ritira", "Cifra Invalida!!\nScrivi la quantità dei soldi da ritirare", "Ritira", "Annulla");
- GivePlayerMoney(playerid, soldidarit);
- Atm[playerid][ContoBancario] = Atm[playerid][ContoBancario] - soldidarit;
- dini_IntSet(file, "ContoBancario", Atm[playerid][ContoBancario]);
- format(file, sizeof(file), "Hai ritirato $%d dal tuo conto bancario", soldidarit);
- SendClientMessage(playerid, -1, file);
- }
- if(dialogid == ATMDIALOG+2 && response)
- {
- new soldidadep = strval(inputtext);
- format(file, sizeof(file), PERCORSO, Nome(playerid));
- if(!response)return 0;
- if(soldidadep > GetPlayerMoney(playerid))return ShowPlayerDialog(playerid, ATMDIALOG+1, DIALOG_STYLE_INPUT, "Ritira", "Non hai tutti questi soldi!!\nScrivi la quantità dei soldi da ritirare", "Ritira", "Annulla");
- if(soldidadep < 1)return ShowPlayerDialog(playerid, ATMDIALOG+1, DIALOG_STYLE_INPUT, "Ritira", "Cifra Invalida!!\nScrivi la quantità dei soldi da ritirare", "Ritira", "Annulla");
- GivePlayerMoney(playerid, -soldidadep);
- Atm[playerid][ContoBancario] = Atm[playerid][ContoBancario] + soldidadep;
- dini_IntSet(file, "ContoBancario", Atm[playerid][ContoBancario]);
- format(file, sizeof(file), "Hai depositato $%d dal tuo conto bancario", soldidadep);
- SendClientMessage(playerid, -1, file);
- }
- if(dialogid == GIVEATMMONEY && response)
- {
- if(!response)return 0;
- new ID = strval(inputtext);
- SetPVarInt(playerid, "IDDaGivare", ID);
- ShowPlayerDialog(playerid, GIVEATMMONEY+1, DIALOG_STYLE_INPUT, "Soldi", "Inserisci la quantità dei soldi da dare al player", "Giva", "Annulla");
- }
- if(dialogid == GIVEATMMONEY+1 && response)
- {
- if(!response)return 0;
- new Soldi = strval(inputtext);
- Atm[GetPVarInt(playerid, "IDDaGivare")][ContoBancario] = Atm[GetPVarInt(playerid, "IDDaGivare")][ContoBancario]+Soldi;
- }
- //============BONIFICO====================
- if(dialogid == BONIFICO && response)
- {
- if(!response)return 0;
- new ID = strval(inputtext);
- SetPVarInt(playerid, "IDGivare", ID);
- ShowPlayerDialog(playerid, BONIFICO+1, DIALOG_STYLE_INPUT, "Soldi", "Inserisci la quantità dei soldi da bonificare al player", "Bonifica", "Annulla");
- }
- if(dialogid == BONIFICO+1 && response)
- {
- new Soldi = strval(inputtext);
- if(!response)return 0;
- if(Soldi > Atm[playerid][ContoBancario])return ShowPlayerDialog(playerid, BONIFICO+2, DIALOG_STYLE_INPUT, "Soldi", "Non hai tutti questi soldi sul tuo conto bancario\nInserisci la quantità dei soldi da bonificare al player", "Bonifica", "Annulla");
- Atm[GetPVarInt(playerid, "IDGivare")][ContoBancario] = Atm[GetPVarInt(playerid, "IDGivare")][ContoBancario]+Soldi;
- Atm[playerid][ContoBancario] -= Soldi;
- SendClientMessage(GetPVarInt(playerid, "IDGivare"), -1, "Hai ricevuto un bonifico, vai a un qualsiasi ATM per ritirarlo");
- }
- return 1;
- }
- stock Nome(playerid)
- {
- new Nomess[24];
- GetPlayerName(playerid, Nomess, sizeof(Nomess));
- return Nomess;
- }
- stock AUnAtm(playerid)
- {
- if(IsPlayerInRangeOfPoint(playerid, 4.0, 542.5908,-1264.3429,16.6761) || IsPlayerInRangeOfPoint(playerid, 4.0, 1034.1892,-1338.8004,13.7266))
- {
- return 1;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 4.0, 1147.4930,-1414.8746,13.6727) || IsPlayerInRangeOfPoint(playerid, 4.0, 1315.1608,-1368.5203,13.5577))
- {
- return 1;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 4.0, 1415.8967,-1694.1305,13.5469) || IsPlayerInRangeOfPoint(playerid, 4.0, 1507.8236,-1672.9354,14.0469))
- {
- return 1;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 4.0, 1929.5099,-1769.5654,13.546) || IsPlayerInRangeOfPoint(playerid, 4.0, 2127.6775,-1769.5358,13.5598))
- {
- return 1;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 4.0, 1737.3802,-1862.8267,13.5758) || IsPlayerInRangeOfPoint(playerid, 4.0, 1722.4089,-1612.7482,13.5469))
- {
- return 1;
- }
- else if(IsPlayerInRangeOfPoint(playerid, 4.0, 2013.3716,-1451.9055,13.5547))
- {
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement