Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include a_samp
- #include zcmd
- #define Dinheiro_Mi 1500
- #define Dinheiro_Max 5500
- #define Motorista do Correio 1
- #define Vermelho 0xFF0000AA
- #define Amarelo 0xFFFF00AA
- //--------------------------- Variaveis ------------------------
- new Correio;
- new Emprego[MAX_PLAYERS];
- new Mercadoria[MAX_PLAYERS];
- new TempoPickupX[MAX_PLAYERS] = 0;
- new Bilhete[MAX_PLAYERS];
- new Float: EntregaP[4][]=
- {
- {1298.4347,-800.3129,84.1406},
- {2127.6431,2377.9688,10.8203},
- {-2720.2776,-318.9388,7.8438},
- {1124.3198,-2037.0066,69.8845}
- };
- //--------------------------- Variaveis ------------------------
- //----------------------------------Publics-------------------------------------------
- public OnGameModeInit()
- {
- AddStaticVehicle(482,95.8216,-172.0899,2.6949,268.5031,6,6); // carro1
- AddStaticVehicle(482,116.5521,-150.3481,1.6917,178.9269,6,6); // carro2
- AddStaticVehicle(482,110.6535,-150.3582,1.7800,179.9409,6,6); // carro4
- Correio = CreatePickup(1239, 23, 92.7077,-164.8840,2.5938); // Pickup Correio
- CreatePickup(1210, 23, 1153.9417,-1771.2805,16.5992);
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- new string[150];
- DisablePlayerCheckpoint(playerid);
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 102.3935,-164.8320,2.3893)) return SendClientMessage(playerid, Amarelo, "Você chegou na Hq do Correio!");
- Mercadoria[playerid] = 0;
- new Float:Pos[4];
- GetPlayerPos(playerid,Pos[0], Pos[1], Pos[2]);
- GetPlayerFacingAngle(playerid, Pos[3]);
- CreateObject(1221, Pos[0], Pos[1], Pos[2], Pos[3], 0.00, 0.00);
- Bilhete[playerid] = 1;
- format(string, sizeof(string), "Mercadoria entregue com sucesso, e recebeu um comprovante pra pegar seu dinheiro no Correio!");
- SendClientMessage(playerid,0xFFA500AA, string);
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == Correio)
- {
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Correio ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
- SendClientMessage(playerid, -1, "Bem vindo(a) ao correio");
- SendClientMessage(playerid, -1, "Aqui você pega suas mercadorias e pega seu dinheiro por entrega!");
- SendClientMessage(playerid, -1, "Funciona 24h por dias!");
- SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Correio ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
- TempoPickupX[playerid] = 30;
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerPos(playerid,1152.2280,-1725.6045,13.8887);
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 1)
- {
- if(response)
- {
- SendClientMessage(playerid, Amarelo, "Localização de entrega setada com sucesso!");
- }
- else
- {
- DisablePlayerCheckpoint(playerid);
- }
- }
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- new modelo;
- modelo = GetVehicleModel(GetPlayerVehicleID(playerid));
- if(modelo == 482)
- {
- if(Emprego[playerid] <=0)
- {
- SendClientMessage(playerid, Vermelho, "Você não pode entrar neste veículo");
- RemovePlayerFromVehicle(playerid);
- return 1;
- }
- }
- return 1;
- }
- //----------------------------------Publics-------------------------------------------
- //----------------------------------Stock-------------------------------------------
- stock randomEspecial(minimo,maximo)
- {
- new valor = random(maximo-minimo)+minimo;
- return valor;
- }
- //----------------------------------Stock-------------------------------------------
- //------------------------------Comandos-------------------------------------------------
- CMD:pegarprof(playerid)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0,1153.9417,-1771.2805,16.5992))
- {
- Emprego[playerid] = 1;
- SetPlayerSkin(playerid, 61);
- SetPlayerCheckpoint(playerid, 102.3935,-164.8320,2.3893, 3.0);
- SendClientMessage(playerid, Amarelo, "Você pegou a profissão de entregador do Correio, foi marcado no seu mini mapa a localização exata.");
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "Você não está na agência de empregos!");
- }
- return 1;
- }
- CMD:entregar(playerid)
- {
- if(!IsPlayerInAnyVehicle(playerid))
- return SendClientMessage(playerid, Vermelho, "Você não está Dentro do veiculo do Correio!");
- if(Emprego[playerid] <=0) return SendClientMessage(playerid, Vermelho, "Você não trabalha para o Correio!");
- if(Mercadoria[playerid] <= 0)
- {
- SendClientMessage(playerid,Vermelho,"Você não pode entregar algo que não tem!");
- return 1;
- }
- new string[250];
- new rand = random(sizeof(EntregaP));
- new Float: Distancia = GetPlayerDistanceFromPoint(playerid,EntregaP[rand][0],EntregaP[rand][1],EntregaP[rand][2]);
- SetPlayerCheckpoint(playerid, EntregaP[rand][0],EntregaP[rand][1],EntregaP[rand][2],3.0);
- format(string,sizeof(string),"{FFFFFF}Você tem um produto pra ser entregue na distância de {30F72D}%0.2f {FFFFFF}metros, siga o checkpoint para entrega-la",Distancia);
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "{FFA500}Correio", string, "Ir", "Cancelar");
- return 1;
- }
- CMD:pegarmercadorias(playerid, params[])
- {
- if(Emprego[playerid] <=0) return SendClientMessage(playerid, Vermelho, "Você não trabalha para o Correio!");
- if(IsPlayerInRangeOfPoint(playerid, 2.0,92.7077,-164.8840,2.5938))
- {
- Mercadoria[playerid] = 1;
- SendClientMessage(playerid, Amarelo, "Você pegou a caixa com produtos, coloque no veiculo e vá entregar!");
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "Você não está no correio!");
- }
- return 1;
- }
- CMD:pegardinheiro(playerid)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0,92.7077,-164.8840,2.5938))
- {
- if(Bilhete[playerid] <=0) return SendClientMessage(playerid, Vermelho, "Você não tem bilhete de comprovação!");
- GivePlayerMoney(playerid, randomEspecial(Dinheiro_Mi, Dinheiro_Max));
- Bilhete[playerid] = 0;
- SendClientMessage(playerid, Amarelo, "Você recebeu seu dinheiro!");
- }
- else
- {
- SendClientMessage(playerid, Vermelho, "Você não está no correio!");
- }
- return 1;
- }
- CMD:comandos(playerid)
- {
- SendClientMessage(playerid, Amarelo,"/pegarmercadorias, /entregar, /pegardinheiro e /pegarprof");
- return 1;
- }
- //------------------------------Comandos-------------------------------------------------
Add Comment
Please, Sign In to add comment