Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <DOF2>
- #include <foreach>
- #include <sscanf2>
- #include <Pawn.CMD>
- // CORES
- #define Branco 0xFFFFFFAA
- #define Amarelo 0xFFFF00AA
- #define Ciano 0x00FFFFAA
- #define Blue 0x0000FFAA
- #define Rosa 0xFF00FFAA
- #define Verde 0x00FF00AA
- #define Vermelho 0xFF0000AA
- #define Azul 0x1E90FFAA
- // DEFINES
- #define CONTAS "Contas/%s.ini"
- // DIALOGS
- #define DIALOG_REGISTRO 1
- #define DIALOG_LOGIN 2
- #define DIALOG_SEXO 3
- #define DIALOG_LOCALSPAWN 4
- #define DIALOG_ABASTECER 5
- #define DIALOG_GASOLINA 6
- #define DIALOG_BANCO 7
- #define DIALOG_SAQUE 8
- #define DIALOG_DEPOSITO 9
- #define DIALOG_SALDO 10
- // SEXO - REGISTRO
- #define MASCULINO 1
- #define FEMININO 2
- // ENUNS
- enum PlayerInfo
- {
- Nome[24],
- Level,
- Logou,
- Procurado,
- Skin,
- Sexo,
- SenhaErrada,
- InteriorID,
- Admin,
- Gasolina,
- SaldoBanco,
- bool:ContaBanco,
- bool:Logado
- };
- // NEWS
- new Text:TextVelocimetro[5];
- new Player[MAX_PLAYERS][PlayerInfo];
- new PlayerText:TextPlayerVelocimetro[4][MAX_PLAYERS];
- new PlayerVelocimetroTimer[MAX_PLAYERS];
- new bool:PlayerVelocimetro[MAX_PLAYERS];
- // FORWARD
- forward UpdatePlayerVelocimetro(playerid);
- forward Combustivel();
- main()
- {
- print("\nGM Carregada com sucesso!\n\n");
- }
- new VehicleNames[212][] =
- {
- {"Landstalker"}, {"Bravura"}, {"Buffalo"}, {"Linerunner"}, {"Perrenial"}, {"Sentinel"}, {"Dumper"},
- {"Firetruck"}, {"Trashmaster"}, {"Stretch"}, {"Manana"}, {"Infernus"}, {"Voodoo"}, {"Pony"}, {"Mule"},
- {"Cheetah"}, {"Ambulance"}, {"Leviathan"}, {"Moonbeam"}, {"Esperanto"}, {"Taxi"}, {"Washington"},
- {"Bobcat"}, {"Mr Whoopee"}, {"BF Injection"}, {"Hunter"}, {"Premier"}, {"Enforcer"}, {"Securicar"},
- {"Banshee"}, {"Predator"}, {"Bus"}, {"Rhino"}, {"Barracks"}, {"Hotknife"}, {"Trailer 1"}, {"Previon"},
- {"Coach"}, {"Cabbie"}, {"Stallion"}, {"Rumpo"}, {"RC Bandit"}, {"Romero"}, {"Packer"}, {"Monster"},
- {"Admiral"}, {"Squalo"}, {"Seasparrow"}, {"Pizzaboy"}, {"Tram"}, {"Trailer 2"}, {"Turismo"},
- {"Speeder"}, {"Reefer"}, {"Tropic"}, {"Flatbed"}, {"Yankee"}, {"Caddy"}, {"Solair"}, {"Berkley's RC Van"},
- {"Skimmer"}, {"PCJ-600"}, {"Faggio"}, {"Freeway"}, {"RC Baron"}, {"RC Raider"}, {"Glendale"}, {"Oceanic"},
- {"Sanchez"}, {"Sparrow"}, {"Patriot"}, {"Quad"}, {"Coastguard"}, {"Dinghy"}, {"Hermes"}, {"Sabre"},
- {"Rustler"}, {"ZR-350"}, {"Walton"}, {"Regina"}, {"Comet"}, {"BMX"}, {"Burrito"}, {"Camper"}, {"Marquis"},
- {"Baggage"}, {"Dozer"}, {"Maverick"}, {"News Chopper"}, {"Rancher"}, {"FBI Rancher"}, {"Virgo"}, {"Greenwood"},
- {"Jetmax"}, {"Hotring"}, {"Sandking"}, {"Blista Compact"}, {"Police Maverick"}, {"Boxville"}, {"Benson"},
- {"Mesa"}, {"RC Goblin"}, {"Hotring Racer A"}, {"Hotring Racer B"}, {"Bloodring Banger"}, {"Rancher"},
- {"Super GT"}, {"Elegant"}, {"Journey"}, {"Bike"}, {"Mountain Bike"}, {"Beagle"}, {"Cropdust"}, {"Stunt"},
- {"Tanker"}, {"Roadtrain"}, {"Nebula"}, {"Majestic"}, {"Buccaneer"}, {"Shamal"}, {"Hydra"}, {"FCR-900"},
- {"NRG-500"}, {"HPV1000"}, {"Cement Truck"}, {"Tow Truck"}, {"Fortune"}, {"Cadrona"}, {"FBI Truck"},
- {"Willard"}, {"Forklift"}, {"Tractor"}, {"Combine"}, {"Feltzer"}, {"Remington"}, {"Slamvan"},
- {"Blade"}, {"Freight"}, {"Streak"}, {"Vortex"}, {"Vincent"}, {"Bullet"}, {"Clover"}, {"Sadler"},
- {"Firetruck LA"}, {"Hustler"}, {"Intruder"}, {"Primo"}, {"Cargobob"}, {"Tampa"}, {"Sunrise"}, {"Merit"},
- {"Utility"}, {"Nevada"}, {"Yosemite"}, {"Windsor"}, {"Monster A"}, {"Monster B"}, {"Uranus"}, {"Jester"},
- {"Sultan"}, {"Stratum"}, {"Elegy"}, {"Raindance"}, {"RC Tiger"}, {"Flash"}, {"Tahoma"}, {"Savanna"},
- {"Bandito"}, {"Freight Flat"}, {"Streak Carriage"}, {"Kart"}, {"Mower"}, {"Duneride"}, {"Sweeper"},
- {"Broadway"}, {"Tornado"}, {"AT-400"}, {"DFT-30"}, {"Huntley"}, {"Stafford"}, {"BF-400"}, {"Newsvan"},
- {"Tug"}, {"Trailer 3"}, {"Emperor"}, {"Wayfarer"}, {"Euros"}, {"Hotdog"}, {"Club"}, {"Freight Carriage"},
- {"Trailer 3"}, {"Andromada"}, {"Dodo"}, {"RC Cam"}, {"Launch"}, {"Police Car (LSPD)"}, {"Police Car (SFPD)"},
- {"Police Car (LVPD)"}, {"Police Ranger"}, {"Picador"}, {"S.W.A.T. Van"}, {"Alpha"}, {"Phoenix"}, {"Glendale"},
- {"Sadler"}, {"Luggage Trailer A"}, {"Luggage Trailer B"}, {"Stair Trailer"}, {"Boxville"}, {"Farm Plow"},
- {"Utility Trailer"}
- };
- public OnGameModeInit()
- {
- SetGameModeText("Base RPG - DOF2");
- UsePlayerPedAnims();
- EnableStuntBonusForAll(0);
- DisableInteriorEnterExits();
- // SETTIMERS
- SetTimer("Gasolina", 50000, true);
- // TEXTLABEL
- Create3DTextLabel("Aperte {00FFFF}Y {696969}para acessar o caixa", 0x696969AA, 1722.2161, -1625.3401, 20.2117, 50.0, 0);
- // PICKUP
- CreatePickup(1274, 1, 1722.2161, -1625.3401, 20.2117);
- // TEXTDRAW
- LoadTextDraws();
- return 1;
- }
- public OnGameModeExit()
- {
- DOF2::Exit();
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- if(DOF2::FileExists(Conta(playerid)))
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "LOGIN", "Digite sua senha para Logar-se.", "Logar", "Sair");
- }
- if(!DOF2::FileExists(Conta(playerid)))
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "REGISTRO", "Digite uma senha para Registrar-se.", "Registrar", "Sair");
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- // Velocimetro
- PlayerVelocimetro[playerid] = false;
- TextPlayerVelocimetro[0][playerid] = CreatePlayerTextDraw(playerid,615.000000, 385.000000, "Nenhum");
- PlayerTextDrawAlignment(playerid, TextPlayerVelocimetro[0][playerid], 3);
- PlayerTextDrawBackgroundColor(playerid, TextPlayerVelocimetro[0][playerid], 0);
- PlayerTextDrawFont(playerid, TextPlayerVelocimetro[0][playerid], 1);
- PlayerTextDrawLetterSize(playerid, TextPlayerVelocimetro[0][playerid], 0.330000, 1.299999);
- PlayerTextDrawColor(playerid, TextPlayerVelocimetro[0][playerid], -156);
- PlayerTextDrawSetOutline(playerid, TextPlayerVelocimetro[0][playerid], 0);
- PlayerTextDrawSetProportional(playerid, TextPlayerVelocimetro[0][playerid], 1);
- PlayerTextDrawSetShadow(playerid, TextPlayerVelocimetro[0][playerid], 1);
- PlayerTextDrawSetSelectable(playerid, TextPlayerVelocimetro[0][playerid], 0);
- TextPlayerVelocimetro[1][playerid] = CreatePlayerTextDraw(playerid,615.000000, 399.000000, "KM/H");
- PlayerTextDrawAlignment(playerid, TextPlayerVelocimetro[1][playerid], 3);
- PlayerTextDrawBackgroundColor(playerid, TextPlayerVelocimetro[1][playerid], 0);
- PlayerTextDrawFont(playerid, TextPlayerVelocimetro[1][playerid], 2);
- PlayerTextDrawLetterSize(playerid, TextPlayerVelocimetro[1][playerid], 0.250000, 1.299999);
- PlayerTextDrawColor(playerid, TextPlayerVelocimetro[1][playerid], -156);
- PlayerTextDrawSetOutline(playerid, TextPlayerVelocimetro[1][playerid], 0);
- PlayerTextDrawSetProportional(playerid, TextPlayerVelocimetro[1][playerid], 1);
- PlayerTextDrawSetShadow(playerid, TextPlayerVelocimetro[1][playerid], 1);
- PlayerTextDrawSetSelectable(playerid, TextPlayerVelocimetro[1][playerid], 0);
- TextPlayerVelocimetro[2][playerid] = CreatePlayerTextDraw(playerid,615.000000, 413.000000, "0 Litros");
- PlayerTextDrawAlignment(playerid, TextPlayerVelocimetro[2][playerid], 3);
- PlayerTextDrawBackgroundColor(playerid, TextPlayerVelocimetro[2][playerid], 0);
- PlayerTextDrawFont(playerid, TextPlayerVelocimetro[2][playerid], 2);
- PlayerTextDrawLetterSize(playerid, TextPlayerVelocimetro[2][playerid], 0.250000, 1.299999);
- PlayerTextDrawColor(playerid, TextPlayerVelocimetro[2][playerid], -156);
- PlayerTextDrawSetOutline(playerid, TextPlayerVelocimetro[2][playerid], 0);
- PlayerTextDrawSetProportional(playerid, TextPlayerVelocimetro[2][playerid], 1);
- PlayerTextDrawSetShadow(playerid, TextPlayerVelocimetro[2][playerid], 1);
- PlayerTextDrawSetSelectable(playerid, TextPlayerVelocimetro[2][playerid], 0);
- TextPlayerVelocimetro[3][playerid] = CreatePlayerTextDraw(playerid,615.000000, 427.000000, "0%");
- PlayerTextDrawAlignment(playerid, TextPlayerVelocimetro[3][playerid], 3);
- PlayerTextDrawBackgroundColor(playerid, TextPlayerVelocimetro[3][playerid], 0);
- PlayerTextDrawFont(playerid, TextPlayerVelocimetro[3][playerid], 2);
- PlayerTextDrawLetterSize(playerid, TextPlayerVelocimetro[3][playerid], 0.250000, 1.299999);
- PlayerTextDrawColor(playerid, TextPlayerVelocimetro[3][playerid], -156);
- PlayerTextDrawSetOutline(playerid, TextPlayerVelocimetro[3][playerid], 0);
- PlayerTextDrawSetProportional(playerid, TextPlayerVelocimetro[3][playerid], 1);
- PlayerTextDrawSetShadow(playerid, TextPlayerVelocimetro[3][playerid], 1);
- PlayerTextDrawSetSelectable(playerid, TextPlayerVelocimetro[3][playerid], 0);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(PlayerVelocimetro[playerid])
- {
- KillTimer(PlayerVelocimetroTimer[playerid]);
- }
- SalvarConta(playerid);
- 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[])
- {
- new string[150];
- if(Player[playerid][Admin] == 1)
- {
- format(string, sizeof(string), "{FFFFFF}[%d:{FF0000}AJD{FFFFFF}] %s", playerid, text);
- SendPlayerMessageToAll(playerid, string);
- return 0;
- }
- if(Player[playerid][Admin] == 2)
- {
- format(string, sizeof(string), "{FFFFFF}[%d:{0000FF}Mod{FFFFFF}] %s", playerid, text);
- SendPlayerMessageToAll(playerid, string);
- return 0;
- }
- if(Player[playerid][Admin] == 3)
- {
- format(string, sizeof(string), "{FFFFFF}[%d:{00FFFF}Admin{FFFFFF}] %s", playerid, text);
- SendPlayerMessageToAll(playerid, string);
- return 0;
- }
- format(string, sizeof(string), "{FFFFFF}[ %d ] %s", playerid, text);
- SendPlayerMessageToAll(playerid, string);
- return 0;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- if(Player[playerid][Gasolina] <= 0)
- {
- ClearAnimations(playerid);
- SendClientMessage(playerid, Vermelho, "| INFO | Você não tem gasolina para dirigir este veículo!");
- }
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(newstate == PLAYER_STATE_DRIVER)
- {
- if(Player[playerid][Gasolina] <= 0)
- {
- ClearAnimations(playerid);
- SendClientMessage(playerid, Vermelho, "| INFO | Você não tem gasolina para dirigir este veículo!");
- }
- }
- if(newstate == PLAYER_STATE_DRIVER)
- {
- ShowPlayerVelocimetro(playerid);
- }
- else
- {
- HidePlayerVelocimetro(playerid);
- }
- 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)
- {
- if(newkeys == KEY_YES) // Aperta 'Y'
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, 1722.2161, -1625.3401, 20.2117)) // Local Caixa
- {
- ShowPlayerDialog(playerid, DIALOG_BANCO, DIALOG_STYLE_LIST, "Banco", "Abrir Conta\nSacar\nDepositar\nSaldo", "Selecionar", "Fechar");
- }
- }
- 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[])
- {
- if(dialogid == DIALOG_LOGIN)
- {
- if(!response) return Kick(playerid);
- if(!strlen(inputtext))
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Digite sua senha para Logar-se.");
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "LOGIN", "Digite sua senha para Logar-se.", "Logar", "Sair");
- return 1;
- }
- if(strcmp(inputtext, DOF2::GetString(Conta(playerid), "Senha"), true) == 0)
- {
- CarregarConta(playerid);
- SendClientMessage(playerid, Azul, "| INFO | Logado(a) com sucesso!");
- }
- else
- {
- new string[32];
- Player[playerid][SenhaErrada]++;
- if(Player[playerid][SenhaErrada] == 3) Kick(playerid);
- format(string, sizeof(string), "| ERRO | Senha Errada (%d/3)", Player[playerid][SenhaErrada]);
- SendClientMessage(playerid, Vermelho, string);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "LOGIN", "Digite sua senha para Logar-se.", "Logar", "Sair");
- }
- return 1;
- }
- if(dialogid == DIALOG_REGISTRO)
- {
- if(!response) return Kick(playerid);
- if(strlen(inputtext) < 4 || strlen(inputtext) > 20)
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Digite uma senha entre 4 á 20 caracteres.");
- ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "REGISTRO", "Digite uma senha para Registrar-se.", "Registrar", "Sair");
- return 1;
- }
- DOF2::CreateFile(Conta(playerid));
- DOF2::SetString(Conta(playerid), "Senha", inputtext);
- DOF2::SetInt(Conta(playerid), "Dinheiro", 0);
- DOF2::SetInt(Conta(playerid), "Procurado", 0);
- DOF2::SetInt(Conta(playerid), "Level", 0);
- DOF2::SetInt(Conta(playerid), "Skin", 0);
- DOF2::SetInt(Conta(playerid), "Logou", 0);
- DOF2::SetInt(Conta(playerid), "Sexo", 0);
- DOF2::SetInt(Conta(playerid), "Admin", 0);
- DOF2::SetInt(Conta(playerid), "InteriorID", 0);
- DOF2::SaveFile();
- Player[playerid][Gasolina] = 30;
- Player[playerid][SaldoBanco] = 0;
- Player[playerid][ContaBanco] = false;
- GivePlayerMoney(playerid, 5000);
- SendClientMessage(playerid, Azul, "| INFO | Registrado(a) com sucesso!");
- ShowPlayerDialog(playerid, DIALOG_SEXO, DIALOG_STYLE_MSGBOX, "SEXO", "Escolha seu sexo abaixo:", "Masculino", "Feminino");
- return 1;
- }
- if(dialogid == DIALOG_SEXO)
- {
- if(response)
- {
- SetSpawnInfo(playerid, 0, 26, 1721.9768, -1608.3345, 13.5469, 360.0000, 0, 0, 0, 0, 0, 0);
- Player[playerid][Sexo] = MASCULINO;
- Player[playerid][Logado] = true;
- SpawnPlayer(playerid);
- }
- else
- {
- SetSpawnInfo(playerid, 0, 41, 1721.9768, -1608.3345, 13.5469, 360.0000, 0, 0, 0, 0, 0, 0);
- Player[playerid][Sexo] = FEMININO;
- Player[playerid][Logado] = true;
- SpawnPlayer(playerid);
- }
- return 1;
- }
- if(dialogid == DIALOG_LOCALSPAWN)
- {
- if(!response) return Kick(playerid);
- if(listitem == 0)
- {
- SetSpawnInfo(playerid, 0, Player[playerid][Skin], DOF2::GetFloat(Conta(playerid), "X"), DOF2::GetFloat(Conta(playerid), "Y"), DOF2::GetFloat(Conta(playerid), "Z"), DOF2::GetFloat(Conta(playerid), "A"), 0, 0, 0, 0, 0, 0);
- SetPlayerInterior(playerid, Player[playerid][InteriorID]);
- Player[playerid][Logado] = true;
- SpawnPlayer(playerid);
- }
- return 1;
- }
- if(dialogid == DIALOG_ABASTECER)
- {
- if(response)
- {
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid, DIALOG_GASOLINA, DIALOG_STYLE_INPUT, "Gasolina", "{FFFFFF}O Preço da gasolina está {008000}$3.00 {FFFFFF}o Litro!\n\n{FFFFFF}Digite a quantia de gasolina que deseja colocar:", "Abastecer", "Fechar");
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_GASOLINA)
- {
- if(response)
- {
- new string[70], Quantidade = strval(inputtext), Quantia = Quantidade*floatround(3.0);
- if(Quantidade > 100 || Quantidade <= 0) return SendClientMessage(playerid, Vermelho, "| ERRO | Quantidade Inválida!");
- if(GetPlayerMoney(playerid) < Quantia) return SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem dinheiro suficiente!");
- format(string, sizeof(string), "| INFO | Você colocou %d Litros de Gasolina por {008000}$%d", Quantidade, Quantia);
- SendClientMessage(playerid, Azul, string);
- Player[playerid][Gasolina] += Quantidade;
- GivePlayerMoney(playerid, - Quantia);
- }
- return 1;
- }
- if(dialogid == DIALOG_BANCO)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(Player[playerid][ContaBanco] == true) return SendClientMessage(playerid, Vermelho, "| ERRO | Você já tem uma Conta Bancária!");
- SendClientMessage(playerid, Azul, "| INFO | Você abriu uma conta Bancária com sucesso! Seu saldo atual é de {008000}$100");
- GivePlayerMoney(playerid, -100);
- Player[playerid][SaldoBanco] = 100;
- Player[playerid][ContaBanco] = true;
- }
- if(listitem == 1)
- {
- if(Player[playerid][ContaBanco] == false) return SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem uma Conta Bancária!");
- ShowPlayerDialog(playerid, DIALOG_SAQUE, DIALOG_STYLE_INPUT, "Saque", "Digite uma quantia que deseja sacar:", "Sacar", "Fechar");
- }
- if(listitem == 2)
- {
- if(Player[playerid][ContaBanco] == false) return SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem uma Conta Bancária!");
- ShowPlayerDialog(playerid, DIALOG_DEPOSITO, DIALOG_STYLE_INPUT, "Deposito", "Digite uma quantia que deseja depositar:", "Depositar", "Fechar");
- }
- if(listitem == 3)
- {
- if(Player[playerid][ContaBanco] == false) return SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem uma Conta Bancária!");
- new string[128];
- format(string, sizeof(string), "| INFO | Seu saldo atual é de {008000}$%d", Player[playerid][SaldoBanco]);
- SendClientMessage(playerid, Azul, string);
- }
- }
- }
- if(dialogid == DIALOG_SAQUE)
- {
- if(response)
- {
- if(!strval(inputtext)) return SendClientMessage(playerid, Vermelho, "| ERRO | Digite uma quantia apenas números!");
- if(strval(inputtext) >= Player[playerid][SaldoBanco]) return SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem todo esse dinheiro!");
- GivePlayerMoney(playerid, strval(inputtext));
- Player[playerid][SaldoBanco] -= strval(inputtext);
- new string[128];
- format(string, sizeof(string), "| INFO | Você sacou {008000}$%d{1E90FF}. Agora seu Saldo Atual é de {008000}$%d", strval(inputtext), Player[playerid][SaldoBanco]);
- SendClientMessage(playerid, Azul, string);
- }
- }
- if(dialogid == DIALOG_DEPOSITO)
- {
- if(response)
- {
- if(!strval(inputtext)) return SendClientMessage(playerid, Vermelho, "| ERRO | Digite uma quantia apenas números!");
- if(Player[playerid][SaldoBanco] >= strval(inputtext)) return SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem todo esse dinheiro!");
- Player[playerid][SaldoBanco] += strval(inputtext);
- GivePlayerMoney(playerid, - strval(inputtext));
- new string[128];
- format(string, sizeof(string), "| INFO | Você depositou {008000}$%d{1E90FF}. Agora seu Saldo Atual é de {008000}$%d", strval(inputtext), Player[playerid][SaldoBanco]);
- SendClientMessage(playerid, Azul, string);
- }
- }
- return 0;
- }
- Float:GetVehicleHealthEx(vehicleid)
- {
- new Float:Health;
- GetVehicleHealth(vehicleid, Health);
- if(Health > 900.0)
- {
- return Health / 10.0;
- }
- else return(Health / 10.0)-(24);
- }
- public UpdatePlayerVelocimetro(playerid)
- {
- new VehicleID, string[64];
- if((VehicleID = GetPlayerVehicleID(playerid)) != INVALID_VEHICLE_ID)
- {
- format(string, sizeof(string), "%02d KM/H", GetVehicleSpeed(VehicleID));
- PlayerTextDrawSetString(playerid, TextPlayerVelocimetro[1][playerid], string);
- format(string, sizeof(string), "%.0f%", GetVehicleHealthEx(VehicleID));
- PlayerTextDrawSetString(playerid, TextPlayerVelocimetro[3][playerid], string);
- format(string, sizeof(string), "%d Litros", Player[playerid][Gasolina]);
- PlayerTextDrawSetString(playerid, TextPlayerVelocimetro[2][playerid], string);
- }
- return 1;
- }
- public Combustivel()
- {
- foreach(Player, i)
- {
- if(GetVehicleModel(GetPlayerVehicleID(i)) != 509 || GetVehicleModel(GetPlayerVehicleID(i)) != 510 || GetVehicleModel(GetPlayerVehicleID(i)) != 481)
- {
- GetPlayerState(i);
- if(IsPlayerInAnyVehicle(i) == 1)
- {
- if(GetPlayerVehicleSeat(i) == 0)
- {
- Player[i][Gasolina]--;
- }
- }
- }
- }
- return 1;
- }
- Conta(playerid)
- {
- new File[64];
- format(File, sizeof(File), CONTAS, Player[playerid][Nome]);
- return File;
- }
- CarregarConta(playerid)
- {
- if(DOF2::FileExists(Conta(playerid)))
- {
- SetPlayerScore(playerid, Player[playerid][Level]);
- SetPlayerWantedLevel(playerid, Player[playerid][Procurado]);
- SetPlayerSkin(playerid, Player[playerid][Skin]);
- GivePlayerMoney(playerid, DOF2::GetInt(Conta(playerid), "Dinheiro"));
- Player[playerid][Level] = DOF2::GetInt(Conta(playerid), "Level");
- Player[playerid][Procurado] = DOF2::GetInt(Conta(playerid), "Procurado");
- Player[playerid][Skin] = DOF2::GetInt(Conta(playerid), "Skin");
- Player[playerid][Logou] = DOF2::GetInt(Conta(playerid), "Logou");
- Player[playerid][Sexo] = DOF2::GetInt(Conta(playerid), "Sexo");
- Player[playerid][Admin] = DOF2::GetInt(Conta(playerid), "Admin");
- Player[playerid][Gasolina] = DOF2::GetInt(Conta(playerid), "Gasolina");
- Player[playerid][SaldoBanco] = DOF2::GetInt(Conta(playerid), "SaldoBancario");
- Player[playerid][ContaBanco] = DOF2::GetBool(Conta(playerid), "ContaBancaria");
- Player[playerid][Logou]++;
- ShowPlayerDialog(playerid, DIALOG_LOCALSPAWN, DIALOG_STYLE_LIST, "Local Spawn:", "Última Posição", "Selecionar", "Sair");
- }
- return 1;
- }
- SalvarConta(playerid)
- {
- new Float:Pos[4];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- GetPlayerFacingAngle(playerid, Pos[3]);
- if(DOF2::FileExists(Conta(playerid)))
- {
- DOF2::SetInt(Conta(playerid), "Dinheiro", GetPlayerMoney(playerid));
- DOF2::SetInt(Conta(playerid), "Level", Player[playerid][Level]);
- DOF2::SetInt(Conta(playerid), "Procurado", Player[playerid][Procurado]);
- DOF2::SetInt(Conta(playerid), "Skin", Player[playerid][Skin]);
- DOF2::SetInt(Conta(playerid), "InteriorID", Player[playerid][InteriorID]);
- DOF2::SetInt(Conta(playerid), "Logou", Player[playerid][Logou]);
- DOF2::SetInt(Conta(playerid), "Sexo", Player[playerid][Sexo]);
- DOF2::SetInt(Conta(playerid), "Admin", Player[playerid][Admin]);
- DOF2::SetInt(Conta(playerid), "Gasolina", Player[playerid][Gasolina]);
- DOF2::SetInt(Conta(playerid), "SaldoBancario", Player[playerid][SaldoBanco]);
- DOF2::SetBool(Conta(playerid), "ContaBancaria", Player[playerid][ContaBanco]);
- DOF2::SetFloat(Conta(playerid), "X", Pos[0]);
- DOF2::SetFloat(Conta(playerid), "Y", Pos[1]);
- DOF2::SetFloat(Conta(playerid), "Z", Pos[2]);
- DOF2::SetFloat(Conta(playerid), "A", Pos[3]);
- DOF2::SaveFile();
- Player[playerid][Logado] = false;
- }
- return 1;
- }
- ShowPlayerVelocimetro(playerid)
- {
- if(PlayerVelocimetro[playerid])
- {
- return 0;
- }
- PlayerTextDrawSetString(playerid, TextPlayerVelocimetro[0][playerid], GetVehicleName(GetPlayerVehicleID(playerid)));
- for( new text; text != 5; text++) TextDrawShowForPlayer(playerid, TextVelocimetro[text]);
- for( new text; text != 4; text++) PlayerTextDrawShow(playerid, TextPlayerVelocimetro[text][playerid]);
- PlayerVelocimetro[playerid] = true;
- PlayerVelocimetroTimer[playerid] = SetTimerEx("UpdatePlayerVelocimetro", 100, true, "i", playerid);
- return 1;
- }
- HidePlayerVelocimetro(playerid)
- {
- if(!PlayerVelocimetro[playerid])
- {
- return 0;
- }
- for( new text; text != 5; text++) TextDrawHideForPlayer(playerid, TextVelocimetro[text]);
- for( new text; text != 4; text++) PlayerTextDrawHide(playerid, TextPlayerVelocimetro[text][playerid]);
- PlayerVelocimetro[playerid] = false;
- KillTimer(PlayerVelocimetroTimer[playerid]);
- return 1;
- }
- GetVehicleName(VehicleID)
- {
- new ModeloID = GetVehicleModel(VehicleID);
- new NomeVeiculo[75];
- if(ModeloID < 400 || ModeloID > 611)
- {
- strcat(NomeVeiculo, "Nenhum");
- return NomeVeiculo;
- }
- strcat(NomeVeiculo, VehicleNames[ModeloID - 400]);
- return NomeVeiculo;
- }
- GetVehicleSpeed(VehicleID)
- {
- new Float:Pos[3];
- GetVehicleVelocity(VehicleID, Pos[0], Pos[1], Pos[2]);
- return floatround(floatsqroot(Pos[0] * Pos[0] + Pos[1] * Pos[1] + Pos[2] * Pos[2]) * 170.0);
- }
- LoadTextDraws()
- {
- TextVelocimetro[0] = TextDrawCreate(379.000000, 378.000000, "i");
- TextDrawBackgroundColor(TextVelocimetro[0], 0);
- TextDrawFont(TextVelocimetro[0], 2);
- TextDrawLetterSize(TextVelocimetro[0], 28.800073, 2.600000);
- TextDrawColor(TextVelocimetro[0], 80);
- TextDrawSetOutline(TextVelocimetro[0], 0);
- TextDrawSetProportional(TextVelocimetro[0], 1);
- TextDrawSetShadow(TextVelocimetro[0], 1);
- TextDrawSetSelectable(TextVelocimetro[0], 0);
- TextVelocimetro[1] = TextDrawCreate(379.000000, 392.000000, "i");
- TextDrawBackgroundColor(TextVelocimetro[1], 0);
- TextDrawFont(TextVelocimetro[1], 2);
- TextDrawLetterSize(TextVelocimetro[1], 28.800073, 2.600000);
- TextDrawColor(TextVelocimetro[1], 80);
- TextDrawSetOutline(TextVelocimetro[1], 0);
- TextDrawSetProportional(TextVelocimetro[1], 1);
- TextDrawSetShadow(TextVelocimetro[1], 1);
- TextDrawSetSelectable(TextVelocimetro[1], 0);
- TextVelocimetro[2] = TextDrawCreate(379.000000, 406.000000, "i");
- TextDrawBackgroundColor(TextVelocimetro[2], 0);
- TextDrawFont(TextVelocimetro[2], 2);
- TextDrawLetterSize(TextVelocimetro[2], 28.800073, 2.600000);
- TextDrawColor(TextVelocimetro[2], 80);
- TextDrawSetOutline(TextVelocimetro[2], 0);
- TextDrawSetProportional(TextVelocimetro[2], 1);
- TextDrawSetShadow(TextVelocimetro[2], 1);
- TextDrawSetSelectable(TextVelocimetro[2], 0);
- TextVelocimetro[3] = TextDrawCreate(379.000000, 420.000000, "i");
- TextDrawBackgroundColor(TextVelocimetro[3], 0);
- TextDrawFont(TextVelocimetro[3], 2);
- TextDrawLetterSize(TextVelocimetro[3], 28.800073, 2.600000);
- TextDrawColor(TextVelocimetro[3], 80);
- TextDrawSetOutline(TextVelocimetro[3], 0);
- TextDrawSetProportional(TextVelocimetro[3], 1);
- TextDrawSetShadow(TextVelocimetro[3], 1);
- TextDrawSetSelectable(TextVelocimetro[3], 0);
- TextVelocimetro[4] = TextDrawCreate(531.000000, 387.000000, "Carro~n~~n~Velocidade~n~~n~Combustivel~n~~n~Lataria");
- TextDrawAlignment(TextVelocimetro[4], 3);
- TextDrawBackgroundColor(TextVelocimetro[4], 0);
- TextDrawFont(TextVelocimetro[4], 2);
- TextDrawLetterSize(TextVelocimetro[4], 0.210000, 0.799999);
- TextDrawColor(TextVelocimetro[4], -186);
- TextDrawSetOutline(TextVelocimetro[4], 0);
- TextDrawSetProportional(TextVelocimetro[4], 1);
- TextDrawSetShadow(TextVelocimetro[4], 1);
- TextDrawSetSelectable(TextVelocimetro[4], 0);
- return 1;
- }
- CMD:abastecer(playerid, params[])
- {
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, Vermelho, "| ERRO | Você não está em um veículo!");
- if(Player[playerid][Gasolina] >= 50) return SendClientMessage(playerid, Vermelho, "| ERRO | Você já tem muita Gasolina!");
- ShowPlayerDialog(playerid, DIALOG_ABASTECER, DIALOG_STYLE_LIST, "Abastecer", "Gasolina", "Selecionar", "Fechar");
- return 1;
- }
- CMD:setadmin(playerid, params[])
- {
- new ID, Cargo, string[128];
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem permissão!");
- if(sscanf(params, "ud", ID, Cargo)) return SendClientMessage(playerid, Vermelho, "| ERRO | Use: /SetAdmin [ID] [Cargo]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, Vermelho, "| ERRO | ID Inválido!");
- if(Cargo >= 4) return SendClientMessage(playerid, Vermelho, "| ERRO | Cargo Inválido!");
- if(Cargo == 1)
- {
- Player[playerid][Admin] = 1;
- format(string, sizeof(string), "| INFO-SERVER | O(A) Rcon %s (%d) Promoveu o(a) jogador(a) %s (%d) para Ajudante!", Player[playerid][Nome], playerid, Player[ID][Nome], ID);
- SendClientMessageToAll(Azul, string);
- }
- if(Cargo == 2)
- {
- Player[playerid][Admin] = 2;
- format(string, sizeof(string), "| INFO-SERVER | O(A) Rcon %s (%d) Promoveu o(a) jogador(a) %s (%d) para Moderador(a)!", Player[playerid][Nome], playerid, Player[ID][Nome], ID);
- SendClientMessageToAll(Azul, string);
- }
- if(Cargo == 3)
- {
- Player[playerid][Admin] = 3;
- format(string, sizeof(string), "| INFO-SERVER | O(A) Rcon %s (%d) Promoveu o(a) jogador(a) %s (%d) para Administrador(a)!", Player[playerid][Nome], playerid, Player[ID][Nome], ID);
- SendClientMessageToAll(Azul, string);
- }
- if(Cargo == 0)
- {
- Player[playerid][Admin] = 0;
- format(string, sizeof(string), "| INFO-SERVER | O(A) Rcon %s (%d) Retirou o(a) jogador(a) %s (%d) da Staff!", Player[playerid][Nome], playerid, Player[ID][Nome], ID);
- SendClientMessageToAll(Azul, string);
- }
- return 1;
- }
- CMD:veh(playerid, params[])
- {
- new Veiculo, Modelo, Color[2], Float:Pos[4], string[70];
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem permissão!");
- if(sscanf(params, "ddd", Modelo, Color[0], Color[1])) return SendClientMessage(playerid, Vermelho, "| ERRO | Use: /Veh [Modelo] [Color1] [Color2]");
- if(Modelo < 400 || Modelo > 611) return SendClientMessage(playerid, Vermelho, "| ERRO | Veículo Inválido!");
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- GetPlayerFacingAngle(playerid, Pos[3]);
- Veiculo = CreateVehicle(Modelo, Pos[0], Pos[1], Pos[2], Pos[3], Color[0], Color[1], 0);
- PutPlayerInVehicle(playerid, Veiculo, 0);
- format(string, sizeof(string), "| INFO | Você criou o Veículo ID: {FF0000}%d", Modelo);
- SendClientMessage(playerid, Azul, string);
- return 1;
- }
- CMD:dargrana(playerid, params[])
- {
- new ID, Grana, string[128];
- if(IsPlayerAdmin(playerid) || Player[playerid][Admin] == 3)
- {
- if(sscanf(params, "ud", ID, Grana)) return SendClientMessage(playerid, Vermelho, "| ERRO | Use: /DarGrana [ID] [Grana]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, Vermelho, "| ERRO | ID Inválido!");
- format(string, sizeof(string), "| INFO | O(A) Administrador(a) %s (%d) Deu para você {008000}$%d {1E90FF}de dinheiro!", Player[playerid][Nome], playerid, Grana);
- SendClientMessage(ID, Azul, string);
- GivePlayerMoney(ID, Grana);
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem permissão!");
- }
- return 1;
- }
- CMD:dararma(playerid, params[])
- {
- new ID, Arma, Municao, string[128];
- if(IsPlayerAdmin(playerid) || Player[playerid][Admin] == 3)
- {
- if(sscanf(params, "udd", ID, Arma, Municao)) return SendClientMessage(playerid, Vermelho, "| ERRO | Use: /DarArma [ID] [Arma] [Munição]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, Vermelho, "| ERRO | ID Inválido!");
- if(Municao < 0 || Municao > 9999) return SendClientMessage(playerid, Vermelho, "| ERRO | Munição Inválida!");
- format(string, sizeof(string), "| INFO | O(A) Administrador(a) %s (%d) Gerou a arma ID: {FF0000}%d {1E90FF}com {FF0000}%d {1E90FF}Munições!", Player[playerid][Nome], playerid, Arma, Municao);
- SendClientMessage(ID, Azul, string);
- GivePlayerWeapon(ID, Arma, Municao);
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem permissão!");
- }
- return 1;
- }
- CMD:setlevel(playerid, params[])
- {
- new ID, string[128];
- if(IsPlayerAdmin(playerid) || Player[playerid][Admin] == 3)
- {
- if(sscanf(params, "ud", ID, Player[ID][Level])) return SendClientMessage(playerid, Vermelho, "| ERRO | Use: /SetLevel [ID] [Level]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, Vermelho, "| ERRO | ID Inválido!");
- format(string, sizeof(string), "| INFO | O(A) Administrador(a) %s (%d) Setou seu level para {FF0000}%d", Player[playerid][Nome], playerid, Player[ID][Level]);
- SendClientMessage(ID, Azul, string);
- SetPlayerScore(ID, Player[ID][Level]);
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem permissão!");
- }
- return 1;
- }
- CMD:setskin(playerid, params[])
- {
- new ID, string[128];
- if(IsPlayerAdmin(playerid) || Player[playerid][Admin] == 3)
- {
- if(sscanf(params, "ud", ID, Player[ID][Skin])) return SendClientMessage(playerid, Vermelho, "| ERRO | Use: /SetSkin [ID] [Skin]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, Vermelho, "| ERRO | ID Inválido!");
- format(string, sizeof(string), "| INFO | O(A) Administrador(a) %s (%d) Setou sua skin para {FF0000}%d", Player[playerid][Nome], playerid, Player[ID][Skin]);
- SendClientMessage(ID, Azul, string);
- SetPlayerScore(ID, Player[ID][Skin]);
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem permissão!");
- }
- return 1;
- }
- CMD:resetargrana(playerid, params[])
- {
- new ID, string[128];
- if(IsPlayerAdmin(playerid) || Player[playerid][Admin] == 3)
- {
- if(sscanf(params, "u", ID)) return SendClientMessage(playerid, Vermelho, "| ERRO | Use: /ResetarGrana [ID]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, Vermelho, "| ERRO | ID Inválido!");
- format(string, sizeof(string), "| INFO | O(A) Administrador(a) %s (%d) Resetou seu dinheiro!", Player[playerid][Nome], playerid);
- SendClientMessage(ID, Azul, string);
- ResetPlayerMoney(ID);
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem permissão!");
- }
- return 1;
- }
- CMD:desarmar(playerid, params[])
- {
- new ID, string[128];
- if(IsPlayerAdmin(playerid) || Player[playerid][Admin] == 3)
- {
- if(sscanf(params, "u", ID)) return SendClientMessage(playerid, Vermelho, "| ERRO | Use: /Desarmar [ID]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, Vermelho, "| ERRO | ID Inválido!");
- format(string, sizeof(string), "| INFO | O(A) Administrador(a) %s (%d) Desarmou você", Player[playerid][Nome], playerid);
- SendClientMessage(ID, Azul, string);
- ResetPlayerWeapons(ID);
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem permissão!");
- }
- return 1;
- }
- CMD:congelar(playerid, params[])
- {
- new ID, string[128];
- if(IsPlayerAdmin(playerid) || Player[playerid][Admin] == 3 || Player[playerid][Admin] == 2 || Player[playerid][Admin] == 1)
- {
- if(sscanf(params, "u", ID)) return SendClientMessage(playerid, Vermelho, "| ERRO | Use: /Congelar [ID]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, Vermelho, "| ERRO | ID Inválido!");
- format(string, sizeof(string), "| INFO | O(A) Administrador(a) %s (%d) Congelou você!", Player[playerid][Nome], playerid);
- SendClientMessage(ID, Azul, string);
- TogglePlayerControllable(ID, 0);
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem permissão!");
- }
- return 1;
- }
- CMD:descongelar(playerid, params[])
- {
- new ID, string[128];
- if(IsPlayerAdmin(playerid) || Player[playerid][Admin] == 3 || Player[playerid][Admin] == 2 || Player[playerid][Admin] == 1)
- {
- if(sscanf(params, "u", ID)) return SendClientMessage(playerid, Vermelho, "| ERRO | Use: /Descongelar [ID]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, Vermelho, "| ERRO | ID Inválido!");
- format(string, sizeof(string), "| INFO | O(A) Administrador(a) %s (%d) Descongelou você!", Player[playerid][Nome], playerid);
- SendClientMessage(ID, Azul, string);
- TogglePlayerControllable(ID, 1);
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem permissão!");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment