Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Nao retire os Creditos :)*/
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- /*MACROS*/
- #define SendClientFormat(%0,%1,%2,%3); format(string, sizeof(string), %2, %3); SendClientMessage(%0, %1, string);
- /*ENUMS*/
- enum pProf
- {
- Profissao
- }
- /*NEWS*/
- new A_Aviao[3];
- new Prof[MAX_PLAYERS][pProf];
- new carregado[MAX_PLAYERS] = 0;
- /*Profissao*/
- #define Piloto 0
- #define C_Piloto 0x0080C0AA
- /*DIALOGS*/
- #define DIALOG_PILOTO 22
- /*CORES*/
- #define COR_ERRO 0xFF0000FF
- #define Verde 0x31E045FF
- #define Azul 0x0091FFFF
- public OnFilterScriptInit()
- {
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- print("\n--------------------------------------");
- print(" Criado por: SmokiieGamer");
- print(" http://forum.sa-mp.com/member.php?u=282148 ");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- A_Aviao[0] = CreateVehicle(592, 1966.7438, -2636.7927, 14.4717, 30.0000, -1, -1, 100);
- A_Aviao[1] = CreateVehicle(592, 2007.2888, -2633.1421, 14.4717, 30.0000, -1, -1, 100);
- A_Aviao[2] = CreateVehicle(592, 2051.5925, -2633.0779, 14.4717, 30.0000, -1, -1, 100);
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- SetPlayerColor(playerid, 0xFFFFFFFF);
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_PILOTO)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- DisablePlayerCheckpoint(playerid);
- SetPlayerCheckpoint(playerid, 1476.443969, 1751.984863, 10.812500, 0.0);
- carregado[playerid] = 1;
- SendClientMessage(playerid, Verde, "| CARREGAMENTO | Foi marcado um ponto vermelho no seu mapa. Siga-o para entregar os passageiros !");
- return 1;
- } // CASE QUISER FAZER OUTROS CARREGAMENTOS, FASSA IGUAL AO DE CIMA.
- case 1:
- {
- DisablePlayerCheckpoint(playerid);
- SetPlayerCheckpoint(playerid, -1202.430541, -185.807723, 14.148437, 0.0);
- carregado[playerid] = 1;
- SendClientMessage(playerid, Verde, "| CARREGAMENTO | Foi marcado um ponto vermelho no seu mapa. Siga-o para entregar os passageiros !");
- return 1;
- }
- }
- }
- }
- return 1;
- }
- CMD:carregar(playerid)
- {
- if(Prof[playerid][Profissao] == Piloto)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 592)
- {
- if(PlayerToPoint(playerid, 50.0, 2024.782226, -2603.623779, 13.546875) || PlayerToPoint(playerid, 50.0, 1979.591552, -2605.063720, 13.546875) || PlayerToPoint(playerid, 50.0, 1979.190063, -2584.598144, 13.546875))
- {
- if(carregado[playerid] == 0)
- {
- new StringCat[700];
- strcat(StringCat, "{FFFFFF}30 Passageiros LV{D2691E}» {00FF00}R$1500\n");
- strcat(StringCat, "{FFFFFF}50 Passageiros SF{D2D61E}» {00FF00}R$1500\n");
- ShowPlayerDialog(playerid, DIALOG_PILOTO, DIALOG_STYLE_LIST, "{FFFFFF}Carregamento", StringCat, "{FFFFFF}Carregar", "{FFFFFF}Cancelar");
- carregado[playerid] = 1;
- return 1;
- }
- else SendClientMessage(playerid, COR_ERRO, "Seu avião já está carregado!");
- return 1;
- }
- else SendClientMessage(playerid, COR_ERRO, "Você não está na Área de Carregamento!");
- return 1;
- }
- else SendClientMessage(playerid, COR_ERRO, "Você não está em um Avião");
- return 1;
- }
- else SendClientMessage(playerid, COR_ERRO, "Você não está dirigindo um avião!");
- return 1;
- }
- else SendClientMessage(playerid, COR_ERRO, "Você não tem permissão!");
- return 1;
- }
- CMD:descarregar(playerid)
- {
- if(Prof[playerid][Profissao] == Piloto)
- {
- if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 592)
- {
- if(carregado[playerid] == 0)
- {
- SendClientMessage(playerid, COR_ERRO, "O seu avião não está carregado!");
- return 1;
- }
- if(carregado[playerid] == 1)
- {
- if(PlayerToPoint(playerid, 50.0, 1476.443969, 1751.984863, 10.812500) || PlayerToPoint(playerid, 50.0, 1476.443969, 1751.984863, 10.812500) || PlayerToPoint(playerid, 50.0, -1202.430541, -185.807723, 14.148437))
- carregado[playerid] = 0;
- DisablePlayerCheckpoint(playerid);
- SendClientMessage(playerid, Verde, "Você entrou os passageiros e ganhou R$1500");
- GivePlayerMoney(playerid, 1500);
- return 1;
- }
- else SendClientMessage(playerid, COR_ERRO, "Você não está na área de descarregamento!");
- return 1;
- }
- else SendClientMessage(playerid, COR_ERRO, "Você não está em um avião!");
- return 1;
- }
- else SendClientMessage(playerid, COR_ERRO, "Você não tem permissão!");
- return 1;
- }
- CMD:setprof(playerid, params[])
- {
- new id, string[500];
- new aname[24], pname[24];
- GetPlayerName(id, aname, sizeof(aname));
- GetPlayerName(playerid, pname, sizeof(pname));
- if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COR_ERRO, "| ERRO | Você não está logado na RCON.");
- if(sscanf(params, "d", id)) return SendClientMessage(playerid, COR_ERRO, "| ERRO | Uso Correto: /Setprof [id].");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_ERRO, "| ERRO | Player não conectado.");
- SendClientFormat(id, Verde, "O(A) admin %s tornou você um(a) piloto(a).", pname);
- SendClientFormat(playerid, Azul, "Você setou o(a) %s um(a) piloto(a).", aname);
- Prof[id][Profissao] = Piloto;
- SetPlayerPos(playerid, 1917.070556, -2645.118408, 13.546875);
- SetPlayerColor(id, C_Piloto);
- return 1;
- }
- CMD:jetpack(playerid){ SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK); return 1; }
- CMD:piloto(playerid)
- {
- SetPlayerPos(playerid, 1917.070556, -2645.118408, 13.546875);
- return 1;
- }
- stock PlayerToPoint(playerid, Float:radi, Float:x, Float:y, Float:z)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment