Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <A_Samp>
- #include <CpsTream>
- #include <Dini>
- //Defines 1
- #define MIN_SENHA 4
- #define MAX_SENHA 15
- //Defines
- #define LocalContas "Contas/%s.ini"
- #define MenuAgencia 0
- #define Honestas 1
- #define Transportes 2
- #define Policias 3
- #define ForcasArmadas 4
- #define AVISO 5
- #define REGISTRO 6
- #define LOGIN 7
- //Cores
- #define Vermelho 0xFF0000AA
- #define Branco 0xFFFFFFAA
- #define Amarelo 0xFFFF00AA
- //Profissões
- #define Desempregado 0
- // - Honestas
- #define Fotografo 1
- #define Paramedico 2
- // - Transportes
- #define Petroleiro 3
- #define Concreteiro 4
- // - Policias
- #define PMilitar 5
- #define Interpol 6
- // - Forças Armadas
- #define Exercito 7
- #define Aeronautica 8
- //Cores Profissão
- // Cores - Honestas
- #define C_Fotografo 0x808080AA
- #define C_Paramedico 0xFF1493AA
- // Cores - Tranportes
- #define C_Petroleiro 0x1E90FFAA
- #define C_Concreteiro 0x778899AA
- // Cores - Policias
- #define C_PMilitar 0x6495EDAA
- #define C_Interpol 0x00FFFFAA
- // Cores - Forças Armadas
- #define C_Exercito 0x6B8E23AA
- #define C_Aeronautica 0x7FFFD4AA
- // Salários
- #define Salario_Desempregado 100
- // Salário - Honestas
- #define Salario_Fotografo 600
- #define Salario_Paramedico 700
- // Salário - Transportes
- #define Salario_Petroleiro 1100
- #define Salario_Concreteiro 1200
- // Salário - Policias
- #define Salario_PMilitar 2100
- #define Salario_Interpol 2500
- // Salário - Forças Armadas
- #define Salario_Exercito 3000
- #define Salario_Aeronautica 3500
- //Checkpoints
- new CheckAgencia;
- //Entrada/Saida
- new EntradaAgencia;
- new SaidaAgencia;
- //News
- enum pInfo
- {
- pProfissao,
- pLogado,
- pLevel,
- pErroSenha,
- pInfoLevel,
- pAdmin
- };
- new segUP[MAX_PLAYERS]; // Variavel de Segundos
- new minUP[MAX_PLAYERS]; // Variavel de Minutos
- new PlayerInfo[MAX_PLAYERS][pInfo];
- new Grana[MAX_PLAYERS];
- //Relogio UP
- new Text:UPRelogio[MAX_PLAYERS];
- main()
- {
- print("* GameMode iniciada com sucesso!");
- }
- public OnGameModeInit()
- {
- DisableInteriorEnterExits();
- EnableStuntBonusForAll(0);
- UsePlayerPedAnims();
- SetGameModeText("Brasil:PT");
- AddPlayerClass(60, 1310.1779,-1377.8152,13.6728,180.0000,0,0,0,0,0,0);
- SetTimer("AtualizarGrana", 1000, true);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- SetTimerEx("RelogioUP", 1000, true, "i", i);
- UPRelogio[i] = TextDrawCreate(51.000000, 321.000000, "+UP:00:00");
- TextDrawBackgroundColor(UPRelogio[i], 255);
- TextDrawFont(UPRelogio[i], 3);
- TextDrawLetterSize(UPRelogio[i], 0.430000, 1.600000);
- TextDrawColor(UPRelogio[i], -1);
- TextDrawSetOutline(UPRelogio[i], 1);
- TextDrawSetProportional(UPRelogio[i], 1);
- TextDrawSetShadow(UPRelogio[i], 1);
- TextDrawSetSelectable(UPRelogio[i], 0);
- }
- //Mensagems TextLabel - Entradas
- Create3DTextLabel("Agência de Empregos", 0xFFFFFFAA, 1310.1906,-1367.2676,13.5265, 50.0, 0);
- //Mensagems TextLabel - Saídas
- Create3DTextLabel("{FF0000}Saída\n{FFFFFF}Agência de Empregos", 0xFFFFFFAA, 246.3765,107.6381,1003.2188, 50.0, 0);
- //Entradas
- EntradaAgencia = CreatePickup(19132, 1, 1310.1906,-1367.2676,13.5265); // Agência LS
- //Saídas
- SaidaAgencia = CreatePickup(1239, 1, 246.3765,107.6381,1003.2188); // Agência LS
- //Checks
- CheckAgencia = CPS_AddCheckpoint(246.5727,118.4587,1003.2188, 1.0, 50); // Local de pegar Profissão
- //Caixas
- Create3DTextLabel( "/AbrirConta\n/Depositar\n/Sacar\n/Saldo", Branco, 1318.5458,-1372.1052,13.7030, 30.0 , 0); //Agencia
- CreatePickup(1274, 1, 1318.5458,-1372.1052,13.7030);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- ShowPlayerDialog(playerid, AVISO, DIALOG_STYLE_MSGBOX, "• Servidor", "{FFFFFF}Seja bem vindo(a) ao servidor", "Entrar", "Sair");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- Desconnectar(playerid);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- TextDrawShowForPlayer(playerid, UPRelogio[playerid]);
- if(dini_Isset("SegundosUP", segUP[playerid])){
- }
- if(dini_Isset("MinutosUP", minUP[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 Mensagem[ 130 ];
- format(Mensagem, sizeof(Mensagem), "%s: {FFFFFF}[ %d ] %s", PlayerName(playerid), playerid, text);
- SendClientMessage(playerid, GetPlayerColor(playerid), Mensagem);
- return 0;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[ 256 ], tmp[ 256 ], string[ 256 ], idx;
- cmd = strtok(cmdtext, idx);
- if(strcmp(cmd, "/AbrirConta", true) == 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, 1318.5458,-1372.1052,13.7030))
- {
- new aname[MAX_PLAYER_NAME], file[ 150 ];
- GetPlayerName(playerid, aname, sizeof(aname));
- format(file, sizeof(file), LocalContas, aname);
- if(dini_Int(file, "ContaBancaria") == 0)
- {
- new grana;
- grana = GetPlayerGrana(playerid);
- if(grana > 99)
- {
- dini_IntSet(file, "ContaBancaria", 1);
- GivePlayerGrana(playerid, -100);
- dini_IntSet(file, "SaldoBancario", 100);
- SendClientMessage(playerid, 0xFFFF59AA, "| BANCO | Você abriu uma Conta Bancária, Seu saldo atual é de {008000}$100{FFFF59}.");
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Para abrir uma conta bancária você precisa de {008000}$100");
- }
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Você já tem uma conta bancária.");
- }
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Você não esta em um 'Caixa/Banco'.");
- }
- return 1;
- }
- if(strcmp(cmd, "/Sacar", true) == 0)
- {
- new aname[MAX_PLAYER_NAME], file[ 150 ];
- GetPlayerName(playerid, aname, sizeof(aname));
- format(file, sizeof(file), LocalContas, aname);
- if(IsPlayerInRangeOfPoint(playerid, 1.0, 1318.5458,-1372.1052,13.7030))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Digite: /Sacar [Quantia]");
- return 1;
- }
- new valor;
- if(strfind(tmp, "-", true) != -1)
- {
- SendClientMessage(playerid,Vermelho,"| ERRO | Valor inválido!");
- return 1;
- }
- if(strlen(tmp) > 8)
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Valor inválido!");
- return 1;
- }
- valor = strval(tmp);
- if(dini_Int(file, "ContaBancaria") == 1)
- {
- if(dini_Int(file, "SaldoBancario") > valor-1)
- {
- dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")-valor);
- GivePlayerGrana(playerid, valor);
- format(string, sizeof(string), "| BANCO | Você sacou uma quantia de {008000}$%d", valor);
- SendClientMessage(playerid, Amarelo, string);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem todo este dinheiro.");
- }
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem uma conta bancária.");
- }
- }
- else
- {
- SendClientMessage(playerid, Vermelho,"| ERRO | Você não esta em um 'Caixa/Banco'.");
- }
- return 1;
- }
- if(strcmp(cmd, "/Depositar", true) == 0)
- {
- new aname[MAX_PLAYER_NAME], file[ 150 ];
- GetPlayerName(playerid, aname, sizeof(aname));
- format(file, sizeof(file), LocalContas, aname);
- if(IsPlayerInRangeOfPoint(playerid, 1.0, 1318.5458,-1372.1052,13.7030))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Digite: /Depositar [Quantia]");
- return 1;
- }
- new valor;
- if(strfind(tmp, "-", true) != -1)
- {
- SendClientMessage(playerid,Vermelho,"| ERRO | Valor inválido!");
- return 1;
- }
- if(strlen(tmp) > 8)
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Valor inválido!");
- return 1;
- }
- valor = strval(tmp);
- if(dini_Int(file, "ContaBancaria") == 1)
- {
- new grana;
- grana = GetPlayerGrana(playerid);
- if(grana > valor-1)
- {
- dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")+valor);
- GivePlayerGrana(playerid, -valor);
- format(string, sizeof(string), "| BANCO | Você depositou a quantia de {008000}$%d", valor);
- SendClientMessage(playerid, Amarelo, string);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem todo este dinheiro.");
- }
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem uma conta bancária.");
- }
- }
- else
- {
- SendClientMessage(playerid, Vermelho,"| ERRO | Você não esta em um 'Caixa/Banco'.");
- }
- return 1;
- }
- if(strcmp(cmd, "/Saldo", true) == 0)
- {
- new aname[MAX_PLAYER_NAME], file[ 150 ];
- GetPlayerName(playerid, aname, sizeof(aname));
- format(file, sizeof(file), LocalContas, aname);
- if(IsPlayerInRangeOfPoint(playerid, 1.0, 1318.5458,-1372.1052,13.7030))
- {
- if(dini_Int(file, "ContaBancaria") == 1)
- {
- format(string, sizeof(string), "| BANCO | Seu Saldo Bancário atual é {008000}$%d", dini_Int(file, "SaldoBancario"));
- SendClientMessage(playerid, Amarelo, string);
- }
- else
- {
- SendClientMessage(playerid, Vermelho,"| ERRO | Você não tem uma Conta Bancária.");
- }
- }
- else
- {
- SendClientMessage(playerid, Vermelho,"| ERRO | Você não esta em um 'Caixa/Banco'.");
- }
- return 1;
- }
- if(strcmp(cmd, "/Agencia", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] == 3 || IsPlayerAdmin(playerid))
- {
- SetPlayerPos(playerid, 1310.0931,-1369.6028,13.5644);
- }
- return 1;
- }
- if(strcmp(cmd, "/SetLevel", true) == 0)
- {
- new file[ 150 ];
- format(file, sizeof(file), LocalContas, PlayerName(playerid));
- if(IsPlayerAdmin(playerid))
- {
- new plid, skin;
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Use: /SetLevel [id] [Level]");
- return 1;
- }
- plid = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Use: /SetLevel [id] [Level]");
- return 1;
- }
- skin = strval(tmp);
- new Pname[MAX_PLAYER_NAME];
- GetPlayerName(plid, Pname, MAX_PLAYER_NAME);
- if(IsPlayerConnected(plid))
- {
- format(string, sizeof(string), "| INFO | O(A) Administrador(a) %s (%d) te setou %d level.", PlayerName(playerid), playerid, skin);
- SendClientMessage(plid, 0x33AAFFAA, string);
- format(string, sizeof(string), "| INFO | Você deu a %s (%d) %d level.", Pname, plid, skin);
- SendClientMessage(playerid, 0xFFFF00AA, string);
- PlayerInfo[plid][pLevel] = skin;
- dini_IntSet(file, "Level", PlayerInfo[plid][pLevel]);
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Esse ID não está online no momento!");
- }
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Você não tem permissão para usar este comando!");
- }
- return 1;
- }
- if(strcmp(cmd, "/SetAdmin", true) == 0)
- {
- if(IsPlayerAdmin(playerid))
- {
- new plid, skin;
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Use: /SetAdmin [id] [Level]");
- return 1;
- }
- plid = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Use: /SetAdmin [id] [Level]");
- return 1;
- }
- skin = strval(tmp);
- if(skin >= 4)
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | O level Permitido para ADM e 0 a 3!");
- return 1;
- }
- new pname[MAX_PLAYER_NAME];
- GetPlayerName(plid, pname, MAX_PLAYER_NAME);
- if(IsPlayerConnected(plid))
- {
- if(skin == 1) //Ajudante
- {
- PlayerInfo[plid][pAdmin] = skin;
- SpawnPlayer(plid);
- format(string, sizeof(string), "| INFO-SERVER | O(A) %s (%d) Promoveu o jogador(a) %s (%d) para Ajudante.", PlayerName(playerid), plid, pname, playerid);
- SendClientMessageToAll(0x00FFFFAA, string);
- }
- if(skin == 2) //Moderador
- {
- PlayerInfo[plid][pAdmin] = skin;
- SpawnPlayer(plid);
- format(string, sizeof(string), "| INFO-SERVER | O(A) %s (%d) Promoveu o jogador(a) %s (%d) para Moderador.", PlayerName(playerid), plid, pname, playerid);
- SendClientMessageToAll(0x00FFFFAA, string);
- }
- if(skin == 3) //Administrador
- {
- PlayerInfo[plid][pAdmin] = skin;
- SpawnPlayer(plid);
- format(string, sizeof(string), "| INFO-SERVER | O(A) %s (%d) Promoveu o jogador(a) %s (%d) para Administrador.", PlayerName(playerid), plid, pname, playerid);
- SendClientMessageToAll(0x00FFFFAA, string);
- }
- if(skin == 0) //Tirar
- {
- PlayerInfo[plid][pAdmin] = 0;
- SpawnPlayer(plid);
- format(string, sizeof(string), "| INFO-SERVER | O(A) %s (%d) Retirou o jogador(a) %s (%d) da Administração.", PlayerName(playerid), plid, pname, playerid);
- SendClientMessageToAll(0x00FFFFAA, string);
- }
- return 1;
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Esse ID não esta online no servidor.");
- }
- }
- return 1;
- }
- return SendClientMessage(playerid, 0xFF0000AA, "| ERRO | Comando Inválido!");
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- new Checkpoint = CPS_GetPlayerCheckpoint(playerid);
- //Abrir o menu de Profissões
- if(Checkpoint == CheckAgencia)
- {
- new File[ 150 ];
- format(File, sizeof(File), LocalContas, PlayerName(playerid));
- if(dini_Int(File, "ContaBancaria") == 1)
- {
- ShowPlayerDialog(playerid, MenuAgencia, DIALOG_STYLE_LIST, "Agência de Empregos", "Honestas\nTransporte\nPolicia\nForças Armadas", "Selecionar", "Fechar");
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "| ERRO | Você precisa ter uma Conta Bancária para pegar uma Profissão!");
- }
- }
- 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)
- {
- //Mensagens quando entra na Pickup
- if(pickupid == EntradaAgencia)
- {
- SendClientMessage(playerid, 0xFFFFFFAA, "| INFO | Para entrar na Agência de Empregos, aperte as teclas {545352}F {FFFFFF}ou {545352}Enter{FFFFFF}.");
- }
- //Saída
- if(pickupid == SaidaAgencia)
- {
- SetPlayerPos(playerid, 1310.1361,-1370.3138,13.5739);
- SetPlayerInterior(playerid, 0);
- SetPlayerFacingAngle(playerid, 180.0000);
- SetCameraBehindPlayer( playerid );
- }
- 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_SECONDARY_ATTACK)
- {
- //Agencia de Empregos - Entrada
- if(IsPlayerInRangeOfPoint(playerid, 1.0, 1310.1906,-1367.2676,13.5265))
- {
- SetPlayerPos(playerid, 246.3007,110.5564,1003.2188);
- SetPlayerInterior(playerid, 10);
- SetPlayerFacingAngle(playerid, 1.5693);
- SetCameraBehindPlayer( playerid );
- }
- }
- 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[])
- {
- //Login / Registro
- new string[ 256 ], File[ 150 ];
- format(File, sizeof(File), LocalContas, PlayerName(playerid));
- if(dialogid == AVISO)
- {
- if(response)
- {
- if(PlayerInfo[playerid][pLogado] == 0)
- {
- if(!dini_Exists(File))
- {
- format(string, sizeof(string), "{FFFFFF}Seja Bem-vindo(a) Pela primeira vez ao servidor!\n\n{33AAFF}Nick: {FFFFFF}%s\n{33AAFF}Conta: {FF0000}Não Registrado(a)!\n\n{FFFFFF}Digite uma senha para Registrar-se.", PlayerName(playerid));
- ShowPlayerDialog(playerid, REGISTRO, DIALOG_STYLE_PASSWORD, "• Registro", string, "Registrar", "Sair");
- }
- if(dini_Exists(File))
- {
- format(string, sizeof(string), "{FFFFFF}Seja Bem-vindo(a) Novamente ao servidor!\n\n{33AAFF}Nick: {FFFFFF}%s\n{33AAFF}Conta: {00FF00}Registrado(a)!\n\n{FFFFFF}Digite sua senha para Logar-se.", PlayerName(playerid));
- ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "• Login", string, "Logar", "Sair");
- }
- }
- }
- else
- {
- GameTextForPlayer(playerid,"~r~KICKADO!", 3000, 3);
- Kick(playerid);
- }
- }
- if(dialogid == REGISTRO)
- {
- if(response)
- {
- if(strlen(inputtext) < MIN_SENHA || strlen(inputtext) > MAX_SENHA)
- {
- new STRX[ 250 ];
- format(STRX, sizeof(STRX), "| ERRO | Sua senha deve ter entre %d e %d caracteres!", MIN_SENHA, MAX_SENHA);
- SendClientMessage(playerid, Vermelho, STRX);
- format(string, sizeof(string), "{FFFFFF}Seja Bem-vindo(a) Pela primeira vez ao servidor!\n\n{33AAFF}Nick: {FFFFFF}%s\n{33AAFF}Conta: {FF0000}Não Registrado(a)!\n\n{FFFFFF}Digite uma senha para Registrar-se.", PlayerName(playerid));
- ShowPlayerDialog(playerid, REGISTRO, DIALOG_STYLE_PASSWORD, "• Registro", string, "Registrar", "Sair");
- return 1;
- }
- dini_Create(File);
- dini_Set(File, "Senha", inputtext);
- dini_IntSet(File, "Profissao", 0);
- dini_IntSet(File, "Level", 0);
- dini_IntSet(File, "Dinheiro", 0);
- dini_IntSet(File, "Admin", 0);
- dini_IntSet(File, "ContaBancaria", 0);
- dini_IntSet(File, "SaldoBancario", 0);
- GivePlayerGrana(playerid, 5000);
- SendClientMessage(playerid, 0x808080AA, "* Registrado(a) com sucesso!");
- SpawnPlayer(playerid);
- PlayerInfo[ playerid ][ pProfissao ] = Desempregado;
- PlayerInfo[ playerid ][ pLogado ] = 1;
- PlayerInfo[ playerid ][ pLevel ] = 0;
- SetarProfissao(playerid);
- minUP[playerid] = 29;
- segUP[playerid] = 59;
- }
- else
- {
- GameTextForPlayer(playerid,"~r~KICKADO!", 3000, 3);
- Kick(playerid);
- }
- }
- if(dialogid == LOGIN)
- {
- if(response)
- {
- if(!strlen(inputtext))
- {
- PlayerInfo[playerid][pErroSenha]++;
- if(PlayerInfo[playerid][pErroSenha] >= 3)
- {
- format(string, sizeof(string), "| INFO-SERVER | O(A) Jogador(a) %s (%d) foi kickado do servidor! ( Motivo: Inativo Login )", PlayerName(playerid), playerid);
- SendClientMessageToAll(Vermelho, string);
- Kick(playerid);
- }
- else
- {
- format(string, sizeof(string), "{FFFFFF}Seja Bem-vindo(a) Pela primeira vez ao servidor!\n\n{33AAFF}Nick: {FFFFFF}%s\n{33AAFF}Conta: {FF0000}Não Registrado(a)!\n\n{FFFFFF}Digite uma senha para Registrar-se.", PlayerName(playerid));
- ShowPlayerDialog(playerid, REGISTRO, DIALOG_STYLE_PASSWORD, "• Registro", string, "Registrar", "Sair");
- return 1;
- }
- }
- if(strcmp(inputtext, dini_Get(File, "Senha"), true) == 0)
- {
- PlayerInfo[ playerid ][ pAdmin ] = dini_Int(File, "Admin");
- PlayerInfo[ playerid ][ pProfissao ] = dini_Int(File, "Profissao");
- SetPlayerScore(playerid, dini_Int(File, "Level"));
- GivePlayerGrana(playerid, dini_Int(File, "Dinheiro"));
- dini_IntSet(File, "ContaBancaria", dini_Int(File, "ContaBancaria"));
- dini_IntSet(File, "SaldoBancario", dini_Int(File, "SaldoBancario"));
- PlayerInfo[ playerid ][ pLogado ] = 1;
- SetarProfissao(playerid);
- SendClientMessage(playerid, 0x808080AA, "* Logado(a) com sucesso!");
- SpawnPlayer(playerid);
- segUP[playerid] = dini_Int(File, "SegundosUP");
- minUP[playerid] = dini_Int(File, "MinutosUP");
- }
- else
- {
- PlayerInfo[playerid][pErroSenha]++;
- if(PlayerInfo[playerid][pErroSenha] >= 3)
- {
- format(string, sizeof(string), "| INFO-SERVER | O(A) Jogador(a) %s (%d) foi kickado do servidor! ( Motivo: Senha Incorreta )", PlayerName(playerid), playerid);
- SendClientMessageToAll(Vermelho, string);
- Kick(playerid);
- }
- else
- {
- new ErroPW[ 256 ];
- format(ErroPW, sizeof(ErroPW), "• Senha Incorreta ( %d / 3 )", PlayerInfo[ playerid ][ pErroSenha ]);
- SendClientMessage(playerid, Vermelho, ErroPW);
- format(string, sizeof(string), "{FFFFFF}Seja Bem-vindo(a) Novamente ao servidor!\n\n{33AAFF}Nick: {FFFFFF}%s\n{33AAFF}Conta: {00FF00}Registrado(a)!\n\n{FFFFFF}Digite sua senha para Logar-se.", PlayerName(playerid));
- ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "• Login", string, "Logar", "Sair");
- }
- }
- }
- else
- {
- GameTextForPlayer(playerid,"~r~KICKADO!", 3000, 3);
- Kick(playerid);
- }
- }
- //Profissões
- if(dialogid == MenuAgencia)
- {
- if(response)
- {
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid, Honestas, DIALOG_STYLE_TABLIST_HEADERS, "Profissões » Honestas", "Profissão\t{33AAFF}Level\t{008000}Salário\nFotografo\t{33AAFF}0\t{008000}$600,00\nParamedico\t{33AAFF}5\t{008000}$700,00", "Selecionar", "Voltar");
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid, Transportes, DIALOG_STYLE_TABLIST_HEADERS, "Profissões » Transportes", "Profissão\t{33AAFF}Level\t{008000}Salário\nPetroleiro\t{33AAFF}0\t{008000}$1.100,00\nConcreteiro\t{33AAFF}10\t{008000}$1.200,00", "Selecionar", "Voltar");
- }
- if(listitem == 2)
- {
- ShowPlayerDialog(playerid, Policias, DIALOG_STYLE_TABLIST_HEADERS, "Profissões » Policias", "Profissão\t{33AAFF}Level\t{008000}Salário\nPolícia Militar\t{33AAFF}50\t{008000}$2.100,00\nInterpol\t{33AAFF}200\t{008000}$2.500,00", "Selecionar", "Voltar");
- }
- if(listitem == 3)
- {
- ShowPlayerDialog(playerid, ForcasArmadas, DIALOG_STYLE_TABLIST_HEADERS, "Profissões » ForcasArmadas", "Profissão\t{33AAFF}Level\t{008000}Salário\nExército\t{33AAFF}700\t{008000}$3.000,00\nAéronautica\t{33AAFF}800\t{008000}$3.500,00", "Selecionar", "Voltar");
- }
- }
- }
- if(dialogid == Honestas)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(GetPlayerScore(playerid) >= 0)
- {
- SendClientMessage(playerid, 0x008080AA, "~~~~~~~~~~~~~~~~~~~~~~~ Fotografo ~~~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Seu curriculo foi aceito nesta Profissão!");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Agora você trabalha como Fotografo!");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Você passará a receber um salário de {008000}$600,00");
- SendClientMessage(playerid, 0x008080AA, "~~~~~~~~~~~~~~~~~~~~~~~ Fotografo ~~~~~~~~~~~~~~~~~~~~~~~");
- PlayerInfo[ playerid ][ pProfissao ] = Fotografo;
- SetarProfissao(playerid);
- }
- }
- if(listitem == 1)
- {
- if(GetPlayerScore(playerid) >= 5)
- {
- SendClientMessage(playerid, 0x008080AA, "~~~~~~~~~~~~~~~~~~~~~~~ Paramedico ~~~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Seu curriculo foi aceito nesta Profissão!");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Agora você trabalha como Paramedico!");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Você passará a receber um salário de {008000}$700,00");
- SendClientMessage(playerid, 0x008080AA, "~~~~~~~~~~~~~~~~~~~~~~~ Paramedico ~~~~~~~~~~~~~~~~~~~~~~~");
- PlayerInfo[ playerid ][ pProfissao ] = Paramedico;
- SetarProfissao(playerid);
- }
- else
- {
- SendClientMessage(playerid, 0xFF0000AA, "| ERRO | Você não tem level suficiente para pegar esta Profissão!");
- }
- }
- }
- else
- {
- ShowPlayerDialog(playerid, MenuAgencia, DIALOG_STYLE_LIST, "Agência de Empregos", "Honestas\nTransporte\nPolicia\nForças Armadas", "Selecionar", "Fechar");
- }
- }
- if(dialogid == Transportes)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(GetPlayerScore(playerid) >= 0)
- {
- SendClientMessage(playerid, 0x008080AA, "~~~~~~~~~~~~~~~~~~~~~~~ Petroleiro ~~~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Seu curriculo foi aceito nesta Profissão!");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Agora você trabalha como Petroleiro!");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Você passará a receber um salário de {008000}$1.100,00");
- SendClientMessage(playerid, 0x008080AA, "~~~~~~~~~~~~~~~~~~~~~~~ Petroleiro ~~~~~~~~~~~~~~~~~~~~~~~");
- PlayerInfo[ playerid ][ pProfissao ] = Petroleiro;
- SetarProfissao(playerid);
- }
- }
- if(listitem == 1)
- {
- if(GetPlayerScore(playerid) >= 10)
- {
- SendClientMessage(playerid, 0x008080AA, "~~~~~~~~~~~~~~~~~~~~~~~ Concreteiro ~~~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Seu curriculo foi aceito nesta Profissão!");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Agora você trabalha como Concreteiro!");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Você passará a receber um salário de {008000}$1.200,00");
- SendClientMessage(playerid, 0x008080AA, "~~~~~~~~~~~~~~~~~~~~~~~ Concreteiro ~~~~~~~~~~~~~~~~~~~~~~~");
- PlayerInfo[ playerid ][ pProfissao ] = Concreteiro;
- SetarProfissao(playerid);
- }
- else
- {
- SendClientMessage(playerid, 0xFF0000AA, "| ERRO | Você não tem level suficiente para pegar esta Profissão!");
- }
- }
- }
- else
- {
- ShowPlayerDialog(playerid, MenuAgencia, DIALOG_STYLE_LIST, "Agência de Empregos", "Honestas\nTransporte\nPolicia\nForças Armadas", "Selecionar", "Fechar");
- }
- }
- if(dialogid == Policias)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(GetPlayerScore(playerid) >= 50)
- {
- SendClientMessage(playerid, 0x008080AA, "~~~~~~~~~~~~~~~~~~~~~~~ Polícia Militar ~~~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Seu curriculo foi aceito nesta Profissão!");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Agora você é um Polícial Militar!");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Você passará a receber um salário de {008000}$2.100,00");
- SendClientMessage(playerid, 0x008080AA, "~~~~~~~~~~~~~~~~~~~~~~~ Polícia Militar ~~~~~~~~~~~~~~~~~~~~~~~");
- PlayerInfo[ playerid ][ pProfissao ] = PMilitar;
- SetarProfissao(playerid);
- }
- else
- {
- SendClientMessage(playerid, 0xFF0000AA, "| ERRO | Você não tem level suficiente para pegar esta Profissão!");
- }
- }
- if(listitem == 1)
- {
- if(GetPlayerScore(playerid) >= 200)
- {
- SendClientMessage(playerid, 0x008080AA, "~~~~~~~~~~~~~~~~~~~~~~~ Interpol ~~~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Seu curriculo foi aceito nesta Profissão!");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Agora você é da Polícia Interpol!");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Você passará a receber um salário de {008000}$2.500,00");
- SendClientMessage(playerid, 0x008080AA, "~~~~~~~~~~~~~~~~~~~~~~~ Interpol ~~~~~~~~~~~~~~~~~~~~~~~");
- PlayerInfo[ playerid ][ pProfissao ] = Interpol;
- SetarProfissao(playerid);
- }
- else
- {
- SendClientMessage(playerid, 0xFF0000AA, "| ERRO | Você não tem level suficiente para pegar esta Profissão!");
- }
- }
- }
- else
- {
- ShowPlayerDialog(playerid, MenuAgencia, DIALOG_STYLE_LIST, "Agência de Empregos", "Honestas\nTransporte\nPolicia\nForças Armadas", "Selecionar", "Fechar");
- }
- }
- if(dialogid == ForcasArmadas)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(GetPlayerScore(playerid) >= 700)
- {
- SendClientMessage(playerid, 0x008080AA, "~~~~~~~~~~~~~~~~~~~~~~~ Exército ~~~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Seu curriculo foi aceito nesta Profissão!");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Agora você é do Exército!");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Você passará a receber um salário de {008000}$3.000,00");
- SendClientMessage(playerid, 0x008080AA, "~~~~~~~~~~~~~~~~~~~~~~~ Exército ~~~~~~~~~~~~~~~~~~~~~~~");
- PlayerInfo[ playerid ][ pProfissao ] = Exercito;
- SetarProfissao(playerid);
- }
- else
- {
- SendClientMessage(playerid, 0xFF0000AA, "| ERRO | Você não tem level suficiente para pegar esta Profissão!");
- }
- }
- if(listitem == 1)
- {
- if(GetPlayerScore(playerid) >= 800)
- {
- SendClientMessage(playerid, 0x008080AA, "~~~~~~~~~~~~~~~~~~~~~~~ Aéronautica ~~~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Seu curriculo foi aceito nesta Profissão!");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Agora você é da Aéronautica!");
- SendClientMessage(playerid, 0xFFFFFFAA, "» Você passará a receber um salário de {008000}$3.500,00");
- SendClientMessage(playerid, 0x008080AA, "~~~~~~~~~~~~~~~~~~~~~~~ Aéronautica ~~~~~~~~~~~~~~~~~~~~~~~");
- PlayerInfo[ playerid ][ pProfissao ] = Aeronautica;
- SetarProfissao(playerid);
- }
- else
- {
- SendClientMessage(playerid, 0xFF0000AA, "| ERRO | Você não tem level suficiente para pegar esta Profissão!");
- }
- }
- }
- else
- {
- ShowPlayerDialog(playerid, MenuAgencia, DIALOG_STYLE_LIST, "Agência de Empregos", "Honestas\nTransporte\nPolicia\nForças Armadas", "Selecionar", "Fechar");
- }
- }
- return 1;
- }
- forward SetarProfissao(playerid);
- public SetarProfissao(playerid)
- {
- if(PlayerInfo[ playerid ][ pProfissao ] == Desempregado)
- {
- SetPlayerColor(playerid, 0xFFFFFFAA);
- }
- if(PlayerInfo[ playerid ][ pProfissao ] == Fotografo)
- {
- SetPlayerColor(playerid, C_Fotografo);
- }
- if(PlayerInfo[ playerid ][ pProfissao ] == Paramedico)
- {
- SetPlayerColor(playerid, C_Paramedico);
- }
- if(PlayerInfo[ playerid ][ pProfissao ] == Petroleiro)
- {
- SetPlayerColor(playerid, C_Petroleiro);
- }
- if(PlayerInfo[ playerid ][ pProfissao ] == Concreteiro)
- {
- SetPlayerColor(playerid, C_Concreteiro);
- }
- if(PlayerInfo[ playerid ][ pProfissao ] == PMilitar)
- {
- SetPlayerColor(playerid, C_PMilitar);
- GivePlayerWeapon(playerid, 3, 1);
- GivePlayerWeapon(playerid, 22, 100);
- GivePlayerWeapon(playerid, 25, 100);
- }
- if(PlayerInfo[ playerid ][ pProfissao ] == Interpol)
- {
- SetPlayerColor(playerid, C_Interpol);
- GivePlayerWeapon(playerid, 3, 1);
- GivePlayerWeapon(playerid, 24, 100);
- GivePlayerWeapon(playerid, 31, 100);
- GivePlayerWeapon(playerid, 34, 100);
- }
- if(PlayerInfo[ playerid ][ pProfissao ] == Exercito)
- {
- SetPlayerColor(playerid, C_Exercito);
- GivePlayerWeapon(playerid, 31, 300);
- GivePlayerWeapon(playerid, 34, 100);
- GivePlayerWeapon(playerid, 24, 300);
- GivePlayerWeapon(playerid, 25, 300);
- }
- if(PlayerInfo[ playerid ][ pProfissao ] == Aeronautica)
- {
- SetPlayerColor(playerid, C_Aeronautica);
- GivePlayerWeapon(playerid, 46, 1);
- GivePlayerWeapon(playerid, 31, 300);
- GivePlayerWeapon(playerid, 34, 100);
- GivePlayerWeapon(playerid, 24, 300);
- GivePlayerWeapon(playerid, 25, 300);
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- forward RelogioUP(playerid);
- public RelogioUP(playerid)
- {
- new string[256];
- if(segUP[playerid] == 0 && minUP[playerid] == 0)
- {
- new aname[MAX_PLAYER_NAME], file[ 150 ];
- GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
- format(file, sizeof(file), LocalContas, aname);
- if(PlayerInfo[ playerid ][ pLogado ] == 1)
- {
- if(PlayerInfo[playerid][pInfoLevel] == 0)
- {
- PlayerInfo[playerid][pLevel]++;
- PlayerInfo[playerid][pInfoLevel] = 0;
- format(string, sizeof(string), "| +UP | Você acaba de ganhar +1 Level Totalizando {0000FF}.{008000}:{FFFF00}: {FF0000}%d {FFFF00}:{008000}:{0000FF}.", PlayerInfo[playerid][pLevel]);
- SendClientMessage(playerid, 0x75EA00AA, string);
- PlayerPlaySound(playerid, 1057, 0, 0, 0);
- dini_IntSet(file, "Level", PlayerInfo[ playerid ][ pLevel ]);
- Salario(playerid);
- }
- }
- }
- if(segUP[playerid] == -1)
- {
- if(minUP[playerid] == 0)
- minUP[playerid] = 29;
- segUP[playerid] = 59;
- minUP[playerid]--;
- }
- format(string, sizeof(string), "~g~+UP:~w~%02d~g~:~w~%02d", minUP[playerid], segUP[playerid]);
- TextDrawSetString(UPRelogio[playerid], string);
- segUP[playerid] --;
- return 1;
- }
- forward Salario(playerid);
- public Salario(playerid)
- {
- new string[ 256 ], file[ 150 ];
- format(file, sizeof(file), LocalContas, PlayerName(playerid));
- if(IsPlayerConnected(playerid))
- {
- if(dini_Int(file, "ContaBancaria") == 1)
- {
- if(PlayerInfo[ playerid ][pProfissao] == Desempregado)
- {
- dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")+Salario_Desempregado);
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~ Salário ~~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, Branco, "{FFFF00}» {FFFFFF}Ministério do Trabalho:");
- SendClientMessage(playerid, Branco, "{FFFF00}» {FFFFFF}Profissão: Desempregado");
- format(string,sizeof(string),"{FFFF00}» {FFFFFF}Salário: {008000}$%d", Salario_Desempregado);
- SendClientMessage(playerid, Branco, string);
- format(string,sizeof(string),"{FFFF00}» {FFFFFF}Saldo Atual: {008000}$%d", dini_Int(file, "SaldoBancario"));
- SendClientMessage(playerid, Branco, string);
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~ Salário ~~~~~~~~~~~~~~~~~~~~~~");
- }
- else
- {
- if(PlayerInfo[ playerid ][pProfissao] == Fotografo)
- {
- dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")+Salario_Fotografo);
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~ Salário ~~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, Branco, "{FFFF00}» {FFFFFF}Ministério do Trabalho:");
- SendClientMessage(playerid, Branco, "{FFFF00}» {FFFFFF}Profissão: Fotografo");
- format(string,sizeof(string),"{FFFF00}» {FFFFFF}Salário: {008000}$%d", Salario_Fotografo);
- SendClientMessage(playerid, Branco, string);
- format(string,sizeof(string),"{FFFF00}» {FFFFFF}Saldo Atual: {008000}$%d", dini_Int(file, "SaldoBancario"));
- SendClientMessage(playerid, Branco, string);
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~ Salário ~~~~~~~~~~~~~~~~~~~~~~");
- }
- if(PlayerInfo[ playerid ][pProfissao] == Paramedico)
- {
- dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")+Salario_Paramedico);
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~ Salário ~~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, Branco, "{FFFF00}» {FFFFFF}Ministério do Trabalho:");
- SendClientMessage(playerid, Branco, "{FFFF00}» {FFFFFF}Profissão: Paramédico");
- format(string,sizeof(string),"{FFFF00}» {FFFFFF}Salário: {008000}$%d", Salario_Paramedico);
- SendClientMessage(playerid, Branco, string);
- format(string,sizeof(string),"{FFFF00}» {FFFFFF}Saldo Atual: {008000}$%d", dini_Int(file, "SaldoBancario"));
- SendClientMessage(playerid, Branco, string);
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~ Salário ~~~~~~~~~~~~~~~~~~~~~~");
- }
- if(PlayerInfo[ playerid ][pProfissao] == Petroleiro)
- {
- dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")+Salario_Petroleiro);
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~ Salário ~~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, Branco, "{FFFF00}» {FFFFFF}Ministério do Trabalho:");
- SendClientMessage(playerid, Branco, "{FFFF00}» {FFFFFF}Profissão: Petroleiro");
- format(string,sizeof(string),"{FFFF00}» {FFFFFF}Salário: {008000}$%d", Salario_Petroleiro);
- SendClientMessage(playerid, Branco, string);
- format(string,sizeof(string),"{FFFF00}» {FFFFFF}Saldo Atual: {008000}$%d", dini_Int(file, "SaldoBancario"));
- SendClientMessage(playerid, Branco, string);
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~ Salário ~~~~~~~~~~~~~~~~~~~~~~");
- }
- if(PlayerInfo[ playerid ][pProfissao] == Concreteiro)
- {
- dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")+Salario_Concreteiro);
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~ Salário ~~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, Branco, "{FFFF00}» {FFFFFF}Ministério do Trabalho:");
- SendClientMessage(playerid, Branco, "{FFFF00}» {FFFFFF}Profissão: Concreteiro");
- format(string,sizeof(string),"{FFFF00}» {FFFFFF}Salário: {008000}$%d", Salario_Concreteiro);
- SendClientMessage(playerid, Branco, string);
- format(string,sizeof(string),"{FFFF00}» {FFFFFF}Saldo Atual: {008000}$%d", dini_Int(file, "SaldoBancario"));
- SendClientMessage(playerid, Branco, string);
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~ Salário ~~~~~~~~~~~~~~~~~~~~~~");
- }
- if(PlayerInfo[ playerid ][pProfissao] == PMilitar)
- {
- dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")+Salario_PMilitar);
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~ Salário ~~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, Branco, "{FFFF00}» {FFFFFF}Ministério do Trabalho:");
- SendClientMessage(playerid, Branco, "{FFFF00}» {FFFFFF}Profissão: Polícia Militar");
- format(string,sizeof(string),"{FFFF00}» {FFFFFF}Salário: {008000}$%d", Salario_PMilitar);
- SendClientMessage(playerid, Branco, string);
- format(string,sizeof(string),"{FFFF00}» {FFFFFF}Saldo Atual: {008000}$%d", dini_Int(file, "SaldoBancario"));
- SendClientMessage(playerid, Branco, string);
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~ Salário ~~~~~~~~~~~~~~~~~~~~~~");
- }
- if(PlayerInfo[ playerid ][pProfissao] == Interpol)
- {
- dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")+Salario_Interpol);
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~ Salário ~~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, Branco, "{FFFF00}» {FFFFFF}Ministério do Trabalho:");
- SendClientMessage(playerid, Branco, "{FFFF00}» {FFFFFF}Profissão: Interpol");
- format(string,sizeof(string),"{FFFF00}» {FFFFFF}Salário: {008000}$%d", Salario_Interpol);
- SendClientMessage(playerid, Branco, string);
- format(string,sizeof(string),"{FFFF00}» {FFFFFF}Saldo Atual: {008000}$%d", dini_Int(file, "SaldoBancario"));
- SendClientMessage(playerid, Branco, string);
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~ Salário ~~~~~~~~~~~~~~~~~~~~~~");
- }
- if(PlayerInfo[ playerid ][pProfissao] == Exercito)
- {
- dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")+Salario_Exercito);
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~ Salário ~~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, Branco, "{FFFF00}» {FFFFFF}Ministério do Trabalho:");
- SendClientMessage(playerid, Branco, "{FFFF00}» {FFFFFF}Profissão: Exército");
- format(string,sizeof(string),"{FFFF00}» {FFFFFF}Salário: {008000}$%d", Salario_Exercito);
- SendClientMessage(playerid, Branco, string);
- format(string,sizeof(string),"{FFFF00}» {FFFFFF}Saldo Atual: {008000}$%d", dini_Int(file, "SaldoBancario"));
- SendClientMessage(playerid, Branco, string);
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~ Salário ~~~~~~~~~~~~~~~~~~~~~~");
- }
- if(PlayerInfo[ playerid ][pProfissao] == Aeronautica)
- {
- dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")+Salario_Aeronautica);
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~ Salário ~~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, Branco, "{FFFF00}» {FFFFFF}Ministério do Trabalho:");
- SendClientMessage(playerid, Branco, "{FFFF00}» {FFFFFF}Profissão: Aéronautica");
- format(string,sizeof(string),"{FFFF00}» {FFFFFF}Salário: {008000}$%d", Salario_Aeronautica);
- SendClientMessage(playerid, Branco, string);
- format(string,sizeof(string),"{FFFF00}» {FFFFFF}Saldo Atual: {008000}$%d", dini_Int(file, "SaldoBancario"));
- SendClientMessage(playerid, Branco, string);
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~ Salário ~~~~~~~~~~~~~~~~~~~~~~");
- }
- }
- }
- }
- return 1;
- }
- stock PlayerName(playerid)
- {
- new xNome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, xNome, sizeof(xNome));
- return xNome;
- }
- stock Desconnectar(playerid)
- {
- new Conta[ 250 ];
- format(Conta, sizeof(Conta), LocalContas, PlayerName(playerid));
- if(PlayerInfo[ playerid ][ pLogado ] == 1)
- {
- dini_IntSet(Conta, "Admin", PlayerInfo[ playerid ][ pAdmin ]);
- dini_IntSet(Conta, "Profissao", PlayerInfo[ playerid ][ pProfissao ]);
- dini_IntSet(Conta, "Dinheiro", GetPlayerGrana(playerid));
- dini_IntSet(Conta, "SegundosUP", segUP[playerid]);
- dini_IntSet(Conta, "MinutosUP", minUP[playerid]);
- dini_IntSet(Conta, "ContaBancaria", dini_Int(Conta, "ContaBancaria"));
- dini_IntSet(Conta, "SaldoBancario", dini_Int(Conta, "SaldoBancario"));
- PlayerInfo[ playerid ][ pErroSenha ] = 0;
- PlayerInfo[ playerid ][ pLogado ] = 0;
- }
- return 1;
- }
- forward AtualizarGrana();
- public AtualizarGrana()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- ResetPlayerMoney( i);
- GivePlayerMoney(i, GetPlayerGrana( i));
- }
- }
- stock GivePlayerGrana(playerid, ammount) return Grana[playerid] += ammount;
- stock GetPlayerGrana(playerid) return Grana[playerid];
- stock ResetPlayerGrana(playerid) return Grana[playerid] = 0;
- strtok(const string[], &index)
- {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' '))
- {
- index++;
- }
- new offset = index;
- new result[20];
- while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment