Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #define COLOR_RED 0xAA3333AA
- #define COLOR_LIME 0x10F441AA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_BLUE 0x0000BBAA
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define GANHO_MIN 2500 //GANHO MINIMO POR ENTREGA
- #define GANHO_MAX 9000 //GANHO MAXIMO POR ENTREGA
- #define ID_MOTOCA 448 //ID DA MOTOCA DE ENTREGAS
- #define PRESSED(%0) \
- (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- new AppLigado[MAX_PLAYERS];
- new iFood[MAX_PLAYERS];
- new Entregando[MAX_PLAYERS];
- new Retiroupedido[MAX_PLAYERS];
- new buscandocorridas[MAX_PLAYERS];
- new TempoDeResposta[MAX_PLAYERS];
- new TemCorrida[MAX_PLAYERS];
- new PlayerText:texto_novaentrega[MAX_PLAYERS];
- new PlayerText:playertextdraw_1[MAX_PLAYERS];
- new PlayerText:playertextdraw_2[MAX_PLAYERS];
- new PlayerText:playertextdraw_3[MAX_PLAYERS];
- new Temporizador[][1] = //TEMPO DE ESPERA ENTRE CADA ENTREGA
- {
- {5000},
- {8000},
- {10000},
- {12000},
- {16000}
- };
- enum Rests
- {
- Float:BrX,
- Float:BrY,
- Float:BrZ,
- Local[64]
- }
- new Restaurantes[][Rests] = //ADICIONE QUANTOS RESTAURANTES QUISER :D ESQUEMA -> (X,Y,Z,"NOME")
- {
- {953.6340,-1379.8330,13.3438, "Cluckin' Bell"},// Cluckin Bells
- {1045.5018,-1269.2733,13.6790, "China's Food"},//Chinese Food
- {1126.0450,-1372.2838,13.9844, "Loja de bebidas"},// Loja de bebidas
- {1196.8871,-921.3952,43.0530, "Burguer Shot"},//Burguer Shot
- {1300.6167,-1156.1165,23.8281, "Disk Bebidas"},// Conveniencia 24hrs
- {421.7389,-1758.9269,8.1689, "Pizzaria da Praia"}// Pizzaria Praia
- };
- new Float:Entregas_ifood[][3] =
- {
- {1247.3604,-1101.0178,26.6719},
- {1243.1884,-1076.3695,31.5547},
- {856.1241,-1687.5447,13.5550},
- {840.9093,-1477.0052,13.5930} //ADICIONE QUANTAS CASAS QUISER, SEGUINDO O ESQUEMA: {X,Y,Z},
- };
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" iFood by Brunno Vinicius (darkxdll)");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- AppLigado[playerid] = 0;
- Retiroupedido[playerid] = 0;
- Entregando[playerid] = 0;
- TemCorrida[playerid] = 0;
- texto_novaentrega[playerid] = CreatePlayerTextDraw(playerid, 515.000000, 267.000000, "Nova entrega recebida");
- PlayerTextDrawFont(playerid, texto_novaentrega[playerid], 2);
- PlayerTextDrawLetterSize(playerid, texto_novaentrega[playerid], 0.216666, 1.299980);
- PlayerTextDrawTextSize(playerid, texto_novaentrega[playerid], 100.000000, 128.000000);
- PlayerTextDrawSetOutline(playerid, texto_novaentrega[playerid], 1);
- PlayerTextDrawSetShadow(playerid, texto_novaentrega[playerid], 1);
- PlayerTextDrawAlignment(playerid, texto_novaentrega[playerid], 2);
- PlayerTextDrawColor(playerid, texto_novaentrega[playerid], -1);
- PlayerTextDrawBackgroundColor(playerid, texto_novaentrega[playerid], 255);
- PlayerTextDrawBoxColor(playerid, texto_novaentrega[playerid], -16776961);
- PlayerTextDrawUseBox(playerid, texto_novaentrega[playerid], 1);
- PlayerTextDrawSetProportional(playerid, texto_novaentrega[playerid], 1);
- PlayerTextDrawSetSelectable(playerid, texto_novaentrega[playerid], 0);
- playertextdraw_1[playerid] = CreatePlayerTextDraw(playerid, 515.000000, 283.000000, "_");
- PlayerTextDrawFont(playerid, playertextdraw_1[playerid], 2);
- PlayerTextDrawLetterSize(playerid, playertextdraw_1[playerid], 9.499993, 10.250018);
- PlayerTextDrawTextSize(playerid, playertextdraw_1[playerid], 101.000000, 128.000000);
- PlayerTextDrawSetOutline(playerid, playertextdraw_1[playerid], 1);
- PlayerTextDrawSetShadow(playerid, playertextdraw_1[playerid], 1);
- PlayerTextDrawAlignment(playerid, playertextdraw_1[playerid], 2);
- PlayerTextDrawColor(playerid, playertextdraw_1[playerid], -1);
- PlayerTextDrawBackgroundColor(playerid, playertextdraw_1[playerid], 255);
- PlayerTextDrawBoxColor(playerid, playertextdraw_1[playerid], 255);
- PlayerTextDrawUseBox(playerid, playertextdraw_1[playerid], 1);
- PlayerTextDrawSetProportional(playerid, playertextdraw_1[playerid], 1);
- PlayerTextDrawSetSelectable(playerid, playertextdraw_1[playerid], 0);
- playertextdraw_2[playerid] = CreatePlayerTextDraw(playerid, 481.000000, 281.000000, "Preview_Model");
- PlayerTextDrawFont(playerid, playertextdraw_2[playerid], 5);
- PlayerTextDrawLetterSize(playerid, playertextdraw_2[playerid], 0.600000, 2.000000);
- PlayerTextDrawTextSize(playerid, playertextdraw_2[playerid], 71.500000, 83.000000);
- PlayerTextDrawSetOutline(playerid, playertextdraw_2[playerid], 0);
- PlayerTextDrawSetShadow(playerid, playertextdraw_2[playerid], 0);
- PlayerTextDrawAlignment(playerid, playertextdraw_2[playerid], 1);
- PlayerTextDrawColor(playerid, playertextdraw_2[playerid], -1);
- PlayerTextDrawBackgroundColor(playerid, playertextdraw_2[playerid], 125);
- PlayerTextDrawBoxColor(playerid, playertextdraw_2[playerid], 0);
- PlayerTextDrawUseBox(playerid, playertextdraw_2[playerid], 0);
- PlayerTextDrawSetProportional(playerid, playertextdraw_2[playerid], 1);
- PlayerTextDrawSetSelectable(playerid, playertextdraw_2[playerid], 0);
- PlayerTextDrawSetPreviewModel(playerid, playertextdraw_2[playerid], 19580);
- PlayerTextDrawSetPreviewRot(playerid, playertextdraw_2[playerid], -32.000000, 0.000000, -20.000000, 1.000000);
- PlayerTextDrawSetPreviewVehCol(playerid, playertextdraw_2[playerid], 1, 1);
- playertextdraw_3[playerid] = CreatePlayerTextDraw(playerid, 515.000000, 363.000000, "'Y' para aceitar");
- PlayerTextDrawFont(playerid, playertextdraw_3[playerid], 2);
- PlayerTextDrawLetterSize(playerid, playertextdraw_3[playerid], 0.293332, 1.289999);
- PlayerTextDrawTextSize(playerid, playertextdraw_3[playerid], 208.500000, 128.000000);
- PlayerTextDrawSetOutline(playerid, playertextdraw_3[playerid], 1);
- PlayerTextDrawSetShadow(playerid, playertextdraw_3[playerid], 0);
- PlayerTextDrawAlignment(playerid, playertextdraw_3[playerid], 2);
- PlayerTextDrawColor(playerid, playertextdraw_3[playerid], -1);
- PlayerTextDrawBackgroundColor(playerid, playertextdraw_3[playerid], 255);
- PlayerTextDrawBoxColor(playerid, playertextdraw_3[playerid], 50);
- PlayerTextDrawUseBox(playerid, playertextdraw_3[playerid], 1);
- PlayerTextDrawSetProportional(playerid, playertextdraw_3[playerid], 1);
- PlayerTextDrawSetSelectable(playerid, playertextdraw_3[playerid], 0);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- AppLigado[playerid] = 0;
- Retiroupedido[playerid] = 0;
- Entregando[playerid] = 0;
- TemCorrida[playerid] = 0;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- AppLigado[playerid] = 0;
- Retiroupedido[playerid] = 0;
- Entregando[playerid] = 0;
- TemCorrida[playerid] = 0;
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- AppLigado[playerid] = 0;
- Retiroupedido[playerid] = 0;
- Entregando[playerid] = 0;
- TemCorrida[playerid] = 0;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if (PRESSED (KEY_YES) )
- {
- if(Entregando[playerid] == 1 && AppLigado[playerid] == 1 && TemCorrida[playerid] == 1)
- {
- KillTimer(TempoDeResposta[playerid]);
- KillTimer(buscandocorridas[playerid]);
- TemCorrida[playerid] = 0;
- StopAudioStreamForPlayer(playerid);
- PlayerTextDrawHide(playerid,texto_novaentrega[playerid]);
- PlayerTextDrawHide(playerid,playertextdraw_1[playerid]);
- PlayerTextDrawHide(playerid,playertextdraw_2[playerid]);
- PlayerTextDrawHide(playerid,playertextdraw_3[playerid]);
- new rand = random(sizeof(Restaurantes));
- SetPlayerCheckpoint(playerid,Restaurantes[rand][BrX],Restaurantes[rand][BrY],Restaurantes[rand][BrZ], 5);
- }
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(Entregando[playerid] == 1 && Retiroupedido[playerid] != 1)
- {
- DisablePlayerCheckpoint(playerid);
- SetTimerEx("SigaEntrega",2000,false,"i",playerid);
- TogglePlayerControllable(playerid,false);
- }
- if(Entregando[playerid] == 1 && Retiroupedido[playerid] == 1)
- {
- DisablePlayerCheckpoint(playerid);
- SetTimerEx("FinalizandoEntrega",2000,false,"i",playerid);
- TogglePlayerControllable(playerid,false);
- }
- return 1;
- }
- forward SigaEntrega(playerid);
- public SigaEntrega(playerid)
- {
- new rand = random(sizeof(Entregas_ifood));
- Retiroupedido[playerid] = 1;
- SetPlayerCheckpoint(playerid,Entregas_ifood[rand][0],Entregas_ifood[rand][1],Entregas_ifood[rand][2], 5);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "[iFood] Siga para a entrega");
- TogglePlayerControllable(playerid, true);
- return 1;
- }
- forward FinalizandoEntrega(playerid);
- public FinalizandoEntrega(playerid)
- {
- SendClientMessage(playerid, COLOR_LIME, "[iFood] Entrega realizada com sucesso");
- GivePlayerMoney(playerid, randomEspecial(GANHO_MIN, GANHO_MAX));
- Entregando[playerid] = 0;
- Retiroupedido[playerid] = 0;
- TemCorrida[playerid] = 0;
- AppLigado[playerid] = 1;
- TogglePlayerControllable(playerid, true);
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- if(AppLigado[playerid] == 1 && Entregando[playerid] != 1 && TemCorrida[playerid] == 0)
- {
- Entregando[playerid] = 1;
- new pseudorand = random(sizeof(Temporizador));
- buscandocorridas[playerid] = SetTimerEx("ChamarEntrega", Temporizador[pseudorand][0], false,"i", playerid);
- }
- return 1;
- }
- forward ChamarEntrega(playerid);
- public ChamarEntrega(playerid)
- {
- TempoDeResposta[playerid] = SetTimerEx("PerdeuEntrega", 10000,false,"i",playerid);
- TemCorrida[playerid] = 1;
- PlayAudioStreamForPlayer(playerid, "https://www.fetchtube.com/Mp3Download.php/Did%20I%20Miss%20Request%20New%20%23Uber%20Ringtone%20%F0%9F%98%8E.mp3?filename=9d12b0d588b5f65d2b21191765d66ae6");
- for(new t=0; t < 15; t++)
- {
- SendClientMessage(playerid, -1, "");
- }
- SendClientMessage(playerid,COLOR_LIGHTBLUE, "[iFood] Nova entrega recebida, você possui 10s para aceitar");
- PlayerTextDrawShow(playerid, texto_novaentrega[playerid]);
- PlayerTextDrawShow(playerid, playertextdraw_1[playerid]);
- PlayerTextDrawShow(playerid, playertextdraw_2[playerid]);
- PlayerTextDrawShow(playerid, playertextdraw_3[playerid]);
- return 1;
- }
- forward PerdeuEntrega(playerid);
- public PerdeuEntrega(playerid)
- {
- DisablePlayerCheckpoint(playerid);
- Entregando[playerid] = 0;
- TemCorrida[playerid] = 0;
- StopAudioStreamForPlayer(playerid);
- PlayerTextDrawHide(playerid,texto_novaentrega[playerid]);
- PlayerTextDrawHide(playerid,playertextdraw_1[playerid]);
- PlayerTextDrawHide(playerid,playertextdraw_2[playerid]);
- PlayerTextDrawHide(playerid,playertextdraw_3[playerid]);
- KillTimer(TempoDeResposta[playerid]);
- return 1;
- }
- stock randomEspecial(minimo,maximo)
- {
- new valor = random(maximo-minimo)+minimo;
- return valor;
- }
- CMD:ifood(playerid, params[])
- {
- AppLigado[playerid] = 0;
- iFood[playerid] = 1;
- SendClientMessage(playerid, COLOR_BLUE, "[iFood] Bem Vindo ao iFood");
- SendClientMessage(playerid, COLOR_BLUE, "[iFood] Criado por Bruno Vinicius");
- SendClientMessage(playerid, COLOR_BLUE, "[iFood] Comandos: /ifood - /ligarapp - /desligarapp");
- SendClientMessage(playerid, COLOR_BLUE, "[iFood] Moto: /motoca ");
- return 1;
- }
- CMD:ligarapp(playerid, params[])
- {
- if(AppLigado[playerid] == 1)
- return SendClientMessage(playerid, COLOR_RED ,"[iFood] Você já está conectado");
- else
- {
- if(iFood[playerid] == 1)
- {
- if(GetVehicleModel(GetPlayerVehicleID(playerid)) == ID_MOTOCA)
- {
- SendClientMessage(playerid, COLOR_BLUE, "[iFood] Aplicativo habilitado para receber entregas!");
- AppLigado[playerid] = 1;
- }
- else
- {
- SendClientMessage(playerid,COLOR_RED,"[iFood] Desculpe, não aceitamos este modelo de veiculo!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED,"[iFood] Falha na autenticação");
- }
- }
- return 1;
- }
- CMD:desligarapp(playerid, params[])
- {
- if(AppLigado[playerid] != 1)
- return SendClientMessage(playerid, COLOR_RED,"[iFood] Você já está desconectado");
- else
- {
- AppLigado[playerid] = 0;
- Entregando[playerid] = 0;
- Retiroupedido[playerid] = 0;
- KillTimer(buscandocorridas[playerid]);
- DisablePlayerCheckpoint(playerid);
- SendClientMessage(playerid, COLOR_LIME, "[iFood] Obrigado pelas entregas, até breve!");
- }
- return 1;
- }
- CMD:motoca(playerid, params[])
- {
- new Float:x, Float:y, Float:z;
- new Float:ang;
- GetPlayerPos(playerid, x,y,z);
- GetPlayerFacingAngle(playerid, ang);
- AddStaticVehicle( 448, x,y,z, ang, 255,255);
- return 1;
- }/*
- CMD:carro(playerid, params[])
- {
- new Float:x, Float:y, Float:z;
- new Float:ang;
- GetPlayerPos(playerid, x,y,z);
- GetPlayerFacingAngle(playerid, ang);
- AddStaticVehicle( 422, x,y,z, ang, 255,255);
- return 1;
- }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement