Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //sistema de elevador
- #include <a_samp>
- #define ElevadorAptos 1
- new ElevadorApartamentos;
- forward ElevadorApartamentosAndando();
- public ElevadorApartamentosAndando()
- {
- MoveObject(ElevadorApartamentos,1786.62,-1303.28,14.54, 2);
- return true;
- }
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- public PlayerToPoint(Float:radi, playerid, 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);
- //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return true;
- }
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if (dialogid == ElevadorAptos)
- {
- if (response)
- {
- if (listitem == 0)
- {
- MoveObject( ElevadorApartamentos, 1786.62, -1303.28, 14.54,3);
- }
- if (listitem == 1)
- {
- MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 23.22,3);
- }
- if (listitem == 2)
- {
- MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 28.62,3);
- }
- if (listitem == 3)
- {
- MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 34.07,3);
- }
- if (listitem == 4)
- {
- MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 39.49,3);
- }
- if (listitem == 5)
- {
- MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 44.97,3);
- }
- if (listitem == 6)
- {
- MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 50.36,3);
- }
- if (listitem == 7)
- {
- MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 55.85,3);
- }
- if (listitem == 8)
- {
- MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 61.33,3);
- }
- if (listitem == 9)
- {
- MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 66.78,3);
- }
- if (listitem == 10)
- {
- MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 72.20,3);
- }
- if (listitem == 11)
- {
- MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 77.65,3);
- }
- if (listitem == 12)
- {
- MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 83.09,3);
- }
- if (listitem == 13)
- {
- MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 88.54,3);
- }
- if (listitem == 14)
- {
- MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 93.96,3);
- }
- if (listitem == 15)
- {
- MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 99.51,3);
- }
- if (listitem == 16)
- {
- MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 104.81,3);
- }
- if (listitem == 17)
- {
- MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 110.31,3);
- }
- if (listitem == 18)
- {
- MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 115.79,3);
- }
- if (listitem == 19)
- {
- MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 121.18,3);
- }
- }
- else
- {
- }
- }
- }
- public OnFilterScriptInit()
- {
- print("\nFilterScript de elevador carregado");
- print(">>>> Créditos a Vinicius (Não retire os creditos)<<<<\n");
- ElevadorApartamentos = CreateObject(18755, 1786.62, -1303.28, 14.54, 0.00, 0.00, 270.35);
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
- {
- if(newkeys == 16 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- OnPlayerCommandText(playerid,"/elevador");
- }
- return true;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[128];
- if (strcmp(cmd, "/apartamentos", true) == 0)
- {
- SetPlayerPos(playerid, 1788.8251,-1292.3501,13.6023);
- return true;
- }
- if (strcmp(cmd, "/elevador", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerToPoint(1.5,playerid, 1785.3308,-1302.5597,13.5789) || PlayerToPoint(1.5,playerid, 1785.1156,-1302.5652,120.3800) || PlayerToPoint(1.5,playerid, 1785.1299,-1302.8934,22.4200) || PlayerToPoint(1.5,playerid, 1785.1149,-1302.1145,27.8200) || PlayerToPoint(1.5,playerid, 1785.1139,-1302.2268,38.6900) || PlayerToPoint(1.5,playerid, 1785.1130,-1302.0863,44.1700) || PlayerToPoint(1.5,playerid, 1785.1128,-1302.0325,49.5600) ||
- PlayerToPoint(1.5,playerid, 1785.1123,-1301.9784,55.0500) || PlayerToPoint(1.5,playerid, 1785.1178,-1302.9601,60.5300) || PlayerToPoint(1.5,playerid, 1785.1176,-1302.6318,65.9800) || PlayerToPoint(1.5,playerid, 1785.1169,-1302.6899,71.4000) || PlayerToPoint(1.5,playerid, 1785.1168,-1302.6820,76.8500) || PlayerToPoint(1.5,playerid, 1785.1189,-1302.8367,82.2900) || PlayerToPoint(1.5,playerid, 1785.1213,-1303.3326,87.7400) ||
- PlayerToPoint(1.5,playerid, 1785.0488,-1301.9581,99.9473) || PlayerToPoint(1.5,playerid, 1786.67, -1303.31, 104.81) || PlayerToPoint(1.5,playerid, 1786.67, -1303.31, 110.31) || PlayerToPoint(1.5,playerid, 1786.4457,-1303.0217,93.1600) || PlayerToPoint(1.5,playerid, 1786.67, -1303.31, 110.31) || PlayerToPoint(1.5,playerid, 1786.67, -1303.31, 115.79) || PlayerToPoint(1.5,playerid, 1785.1173,-1302.5492,33.2700))
- {
- ShowPlayerDialog(playerid,ElevadorAptos,DIALOG_STYLE_LIST,"Elevador","Térreo\n1º Andar\n2º Andar\n3º Andar\n4º Andar\n5º Andar\n6º Andar\n7º Andar\n8º Andar\n9ºAndar\n10º Andar\n11º Andar\n12º Andar\n13º Andar\n14º Andar\n15º Andar\n16º Andar\n17º Andar\n18º Andar\nUltimo Andar","Ir","Cancelar");
- }
- }
- return true;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement