Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <Dini>
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Sistema de Banco Por FreeGells\n");
- print(" Carregando...\n");
- print("--------------------------------------\n");
- Create3DTextLabel("Banco", -1, 2316.6208,-9.7189,26.7422, 20,0);
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" Sistema de Banco Por FreeGells\n");
- print(" Descarregando...\n");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[256], idx, tmp[256], Arquivo[256], Dinheiro, string[128];
- cmd = strtok(cmdtext, idx);
- if(strcmp(cmd, "/depositar", true) == 0) {
- if(!IsPlayerInRangeOfPoint(playerid, 1.0, 2316.6208,-9.7189,26.7422)) return SendClientMessage(playerid, 0xFFFFFFAA, "[ERRO] Você não está no Banco!");
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) return SendClientMessage(playerid, 0xFFFFFFAA, "[ERRO] Use: /Depositar [Quantia]");
- Dinheiro = strval(tmp);
- if(GetPlayerMoney(playerid)<Dinheiro) return SendClientMessage(playerid, 0xFFFFFFAA, "[ERRO] Você não tem está quantia!");
- {
- if(GetPlayerMoney(playerid) >= Dinheiro) {
- new n[MAX_PLAYER_NAME];
- GetPlayerName(playerid, n, sizeof(n));
- format(Arquivo, sizeof(Arquivo), "Banco/%s.txt", n);
- if(dini_Exists(Arquivo)) {
- dini_IntSet(Arquivo, "Saldo", dini_Int(Arquivo, "Saldo") +Dinheiro);
- }
- else if(!dini_Exists(Arquivo)) {
- dini_Create(Arquivo);
- dini_IntSet(Arquivo, "Saldo", Dinheiro);
- }
- format(string, sizeof(string), "[BANCO] Você depositou %d em sua conta, Saldo atual: %d", Dinheiro, dini_Int(Arquivo, "Saldo"));
- SendClientMessage(playerid, 0x5EAF03FF, string);
- GivePlayerMoney(playerid, -Dinheiro);
- }
- return 1;
- }
- }
- }
- if(strcmp(cmd, "/sacar", true) == 0) {
- if(!IsPlayerInRangeOfPoint(playerid, 1.0, 2316.6208,-9.7189,26.7422)) return SendClientMessage(playerid, 0xFFFFFFAA, "[ERRO] Você não está no Banco!");
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) return SendClientMessage(playerid, 0xFFFFFFAA,"[ERRO] Use: /Sacar [Quantia]");
- Dinheiro = strval(tmp);
- {
- new n[MAX_PLAYER_NAME];
- GetPlayerName(playerid, n, sizeof(n));
- format(Arquivo, sizeof(Arquivo), "Banco/%s.txt", n);
- if(dini_Exists(Arquivo)) {
- if(dini_Int(Arquivo, "Saldo") < Dinheiro) return SendClientMessage(playerid, 0xFFFFFFAA, "[ERRO] Você não tem está quantia no Banco!");
- else if(dini_Int(Arquivo, "Saldo") >= Dinheiro) {
- dini_IntSet(Arquivo, "Saldo", dini_Int(Arquivo, "Saldo") -Dinheiro);
- format(string, sizeof(string), "[BANCO] Você retirou %d de sua conta bancaria, Saldo atual %d", Dinheiro, dini_Int(Arquivo, "Saldo"));
- SendClientMessage(playerid, 0x5EAF03FF, string);
- GivePlayerMoney(playerid, Dinheiro);
- }
- }
- }
- return 1;
- }
- }
- if(strcmp(cmd, "/saldo", true) == 0) {
- if(!IsPlayerInRangeOfPoint(playerid, 1.0, 2316.6208,-9.7189,26.7422)) return SendClientMessage(playerid, 0xFFFFFFAA, "[ERRO] Você não está no Banco!");
- {
- new n[MAX_PLAYER_NAME];
- GetPlayerName(playerid, n, sizeof(n));
- format(Arquivo, sizeof(Arquivo), "Banco/%s.txt", n);
- if(dini_Exists(Arquivo)) {
- format(string, sizeof(string), "[BANCO] Seu Saldo atual é %d", dini_Int(Arquivo, "Saldo"));
- SendClientMessage(playerid, 0x5EAF03FF, string);
- }
- else if(!dini_Exists(Arquivo)) {
- SendClientMessage(playerid, 0x5EAF03FF, "[BANCO] Seu Saldo atual é 0");
- }
- return 1;
- }
- }
- if(strcmp(cmd, "/cbanco", true) == 0) {
- SendClientMessage(playerid, 0x5EAF03FF, "~~~~~~~~~~~~~~~~~~~~~ Comandos Banco ~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, 0xFFFFFFAA, "{5EAF03}»{FFFFFF} /Saldo - Checa o Saldo Bancario");
- SendClientMessage(playerid, 0xFFFFFFAA, "{5EAF03}»{FFFFFF} /Sacar [Quantia] - Saca a quantia desejada");
- SendClientMessage(playerid, 0xFFFFFFAA, "{5EAF03}»{FFFFFF} /Depositar [Quantia] - Deposita a quantia desejada");
- SendClientMessage(playerid, 0x5EAF03FF, "~~~~~~~~~~~~~~~~~~~~~ Comandos Banco ~~~~~~~~~~~~~~~~~~~~~");
- return 1;
- }
- if(strcmp(cmd, "/creditosb", true) == 0) {
- SendClientMessage(playerid, 0x5EAF03FF, "~~~~~~~~~~~~~~~~~~~~~ Creditos Banco ~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, 0xFFFFFFAA, "{5EAF03}»{FFFFFF} Creditos a FreeGells pelo sistema de Banco!");
- SendClientMessage(playerid, 0x5EAF03FF, "~~~~~~~~~~~~~~~~~~~~~ Creditos Banco ~~~~~~~~~~~~~~~~~~~~~");
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement