Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Filtro Script Sistema de Veiculo Menu
- Para usalo apenas aperte 2 e veja as opções
- Desenvolvido por TexPair
- Não se esqueça de manter os créditos =d
- FlW e até o proximo desenvolvimento
- */
- #include <a_samp>
- #define ROXINHO 0xC2A2DAAA
- #define GERENCIAR_VEICULO 109 // isto indica o dialog das opções do menu
- #define PLACA_VEICULO 108 // isto indica o dialog para troca de placas
- new engine,lights,alarm,doors,bonnet,boot,objective;
- new BigEar[MAX_PLAYERS];
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("| Sistema de Menu do veiculo |");
- print("| Criado por Texpair |");
- print("| Filtro Script iniciado com sucesso |");
- }
- #endif
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {// 512 é a tecla 2
- if((newkeys==512)&&(IsPlayerInAnyVehicle(playerid))&&(GetPlayerState(playerid) == PLAYER_STATE_DRIVER))
- {
- ShowPlayerDialog(playerid, GERENCIAR_VEICULO, DIALOG_STYLE_LIST, "|Gerenciando o Veiculo|", "Mudar Placa do Veiculo\nAbrir o capo\nFechar o Capo\n-Abrir Porta\nFechar Porta\nAlarme\nDesligar Alarme\nLigar Veiculo\nDesligar Veiculo\nLigar Luz\nApagar Luz", "Selecionar", "Fechar");
- return 1;
- }
- return 1;
- }
- forward public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
- public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5) // função do gf se ja possuir em seu gamemode não é nescessario.
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:posx, Float:posy, Float:posz;
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- //radi = 2.0; //Trigger Radius
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(!BigEar[i])
- {
- GetPlayerPos(i, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
- {
- SendClientMessage(i, col1, string);
- }
- else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
- {
- SendClientMessage(i, col2, string);
- }
- else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
- {
- SendClientMessage(i, col3, string);
- }
- else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
- {
- SendClientMessage(i, col4, string);
- }
- else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- SendClientMessage(i, col5, string);
- }
- }
- else
- {
- SendClientMessage(i, col1, string);
- }
- }
- }
- }//not connected
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new string[128],sendername[24];
- if(dialogid == GERENCIAR_VEICULO)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(IsPlayerAdmin(playerid))//<< podes modificar para função de seu gamemode
- {
- ShowPlayerDialog(playerid, PLACA_VEICULO, DIALOG_STYLE_INPUT, "Sistema de Placa", "Digite sua Placa:\n\nMaximo de 8 Caracteres", "Mudar", "Cancelar");
- }
- else
- {
- SendClientMessage(playerid, ROXINHO , "Você não é um Administrador RCON para trocar placa do veiculo!");
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- }
- }
- if(listitem == 1)
- {
- new vid = GetPlayerVehicleID(playerid);
- if(vid != INVALID_VEHICLE_ID)
- {
- GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vid,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
- }
- format(string, 256, "%s abriu o capo do veiculo.",sendername);
- ProxDetector(20.0,playerid,string,ROXINHO,ROXINHO,ROXINHO,ROXINHO,ROXINHO);
- }
- if(listitem == 2)
- {
- new vid = GetPlayerVehicleID(playerid);
- if(vid != INVALID_VEHICLE_ID)
- {
- GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vid,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
- }
- format(string, 256, "%s fechou o capo do veiculo.",sendername);
- ProxDetector(20.0,playerid,string,ROXINHO,ROXINHO,ROXINHO,ROXINHO,ROXINHO);
- }
- if(listitem == 3)
- {
- new vid = GetPlayerVehicleID(playerid);
- if(vid != INVALID_VEHICLE_ID)
- {
- GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
- }
- format(string, 256, "%s abriu a porta do veiculo.",sendername);
- ProxDetector(20.0,playerid,string,ROXINHO,ROXINHO,ROXINHO,ROXINHO,ROXINHO);
- return 1;
- }
- if(listitem == 4)
- {
- new vid = GetPlayerVehicleID(playerid);
- if(vid != INVALID_VEHICLE_ID)
- {
- GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
- }
- format(string, 256, "%s fechou a porta do veiculo.",sendername);
- ProxDetector(20.0,playerid,string,ROXINHO,ROXINHO,ROXINHO,ROXINHO,ROXINHO);
- }
- if(listitem == 5)
- {
- new vid = GetPlayerVehicleID(playerid);
- if(vid != INVALID_VEHICLE_ID)
- {
- GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
- }
- format(string, 256, "%s ligou o alarme do veiculo.",sendername);
- ProxDetector(20.0,playerid,string,ROXINHO,ROXINHO,ROXINHO,ROXINHO,ROXINHO);
- }
- if(listitem == 6)
- {
- new vid = GetPlayerVehicleID(playerid);
- if(vid != INVALID_VEHICLE_ID) {
- GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vid,engine,lights,VEHICLE_PARAMS_OFF,doors,bonnet,boot,objective);
- }
- format(string, 256, "%s ligou o alarme do veiculo.",sendername);
- ProxDetector(20.0,playerid,string,ROXINHO,ROXINHO,ROXINHO,ROXINHO,ROXINHO);
- }
- if(listitem == 7)
- {
- new vid = GetPlayerVehicleID(playerid);
- if(vid != INVALID_VEHICLE_ID)
- {
- GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
- }
- format(string, 256, "%s ligou o veiculo.",sendername);
- ProxDetector(20.0,playerid,string,ROXINHO,ROXINHO,ROXINHO,ROXINHO,ROXINHO);
- }
- if(listitem == 8)
- {
- new vid = GetPlayerVehicleID(playerid);
- if(vid != INVALID_VEHICLE_ID)
- {
- GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
- }
- format(string, 256, "%s desligou o veiculo.",sendername);
- ProxDetector(20.0,playerid,string,ROXINHO,ROXINHO,ROXINHO,ROXINHO,ROXINHO);
- }
- if(listitem == 9)
- {
- new vid = GetPlayerVehicleID(playerid);
- if(vid != INVALID_VEHICLE_ID)
- {
- GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
- }
- format(string, 256, "%s acendeu a luz do veiculo.",sendername);
- ProxDetector(20.0,playerid,string,ROXINHO,ROXINHO,ROXINHO,ROXINHO,ROXINHO);
- }
- if(listitem == 10)
- {
- new vid = GetPlayerVehicleID(playerid);
- if(vid != INVALID_VEHICLE_ID)
- {
- GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
- }
- format(string, 256, "%s apagou a luz do veiculo.",sendername);
- ProxDetector(20.0,playerid,string,ROXINHO,ROXINHO,ROXINHO,ROXINHO,ROXINHO);
- }
- }
- return 1;
- }
- if(dialogid == PLACA_VEICULO)
- {
- new Float:X, Float:Y, Float:Z, Float:angle;
- if(strlen(inputtext) < 1 || strlen(inputtext) > 8) return SendClientMessage(playerid, 0xAFAFAFAA, "Texto Invalido.");
- else
- {
- format(string, sizeof(string), "Você mudou o texto de sua placa para '%s'.", inputtext);
- SendClientMessage(playerid, 0x33CCFFAA, string);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, angle);
- SetVehicleNumberPlate(GetPlayerVehicleID(playerid), inputtext);
- SetVehicleToRespawn(GetPlayerVehicleID(playerid));
- GetPlayerPos(playerid, X, Y, Z);
- SetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
- SetVehicleZAngle(GetPlayerVehicleID(playerid), angle);
- PutPlayerInVehicle(playerid, GetPlayerVehicleID(playerid), 0);
- SetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z+2);
- format(string, 256, "Administrador RCON %s mudou a placa d seu veiculo para \'%s'/.",sendername,inputtext);
- ProxDetector(20.0,playerid,string,ROXINHO,ROXINHO,ROXINHO,ROXINHO,ROXINHO);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment