19.03.2013, 20:18
(
Последний раз редактировалось Alef_Jourdan; 20.03.2013 в 13:46.
)
Olб Galera Quero QUe Me Ajudem ,Coloquei a Fs Sistemas de Cameras v 2 ,So que ela ta com um bug as cameras nao movimenta fica parada ,Era pra se movimentar apertando as setas e o w,a,s,d Mais Nao Ta movimentando ta travada
e outra coisa mudei a posiзгo da central de seguranзa ai ficou com um bug pra entrar tem que segurar F se nao Entra e sai rapido So esses dois bugs
Camera Nao Movimenta e Tem Que Segurar F Pra Poder entrar Espero que me ajudem to quebrando a cabeзa aqui mais nao tou conseguindo Vou posta o codigo
e outra coisa mudei a posiзгo da central de seguranзa ai ficou com um bug pra entrar tem que segurar F se nao Entra e sai rapido So esses dois bugs
Camera Nao Movimenta e Tem Que Segurar F Pra Poder entrar Espero que me ajudem to quebrando a cabeзa aqui mais nao tou conseguindo Vou posta o codigo
Код:
/* CRIADO POR : Jonathan Feitosa ============ |====== ======== NAO REMOVA OS CREDITOS | | | CRIADO DO 0 SEM AJUDA ! | | |======| PERMIЗГO PARA POSTAR ADD : | |====== | john_feat@hotmail.com | | | Qualquer BUG/DICA/DЪVIDAS ADD O MSN ! | | | _______| | =======| Crйditos : Sandra Piter Mentos ===============================================================================*/ #include <a_samp> #define COLOR_WHITE 0xFFFFFFAA #define CSEGURANCA 9234 //============================================================================== #define SPEED_ROTATE_LEFTRIGHT_SLOW 0.5 #define SPEED_ROTATE_LEFTRIGHT_FAST 2.0 #define SPEED_ROTATE_UPDOWN_SLOW 0.05 #define SPEED_ROTATE_UPDOWN_FAST 0.15 #define SPEED_MOVE_UPDOWN_SLOW 0.25 #define SPEED_MOVE_UPDOWN_FAST 1.0 #define SPEED_MOVE_FORWARDBACKWARD_SLOW 0.4 #define SPEED_MOVE_FORWARDBACKWARD_FAST 2.0 #define SPEED_MOVE_LEFTRIGHT_SLOW 0.4 #define SPEED_MOVE_LEFTRIGHT_FAST 2.0 new Float:PCP[MAX_PLAYERS][3], Float:PCL[MAX_PLAYERS][3], Float:PCA[MAX_PLAYERS], KeyTimer[MAX_PLAYERS], KeyState[MAX_PLAYERS]; // ============================================================================= new JFS, Camera[MAX_PLAYERS]; #if defined FILTERSCRIPT #else #endif public OnFilterScriptInit() { Create3DTextLabel("Secretaria de\nSeguranзa", 0xF68E00F6, 1798.3790,-1578.7922,14.0906,92,0,0); // ENTRADA Cвmera Create3DTextLabel("Use /camera", 0xF68E00F6, 542.6953,-897.9803,1304.7952,60.0,0); Create3DTextLabel("Painel", 0xF68E00F6, 1824.6990,-1538.1650,13.5469,79.7544,0,0); AddStaticPickup(1318, 23, 1824.6990,-1538.1650,13.5469); // painel AddStaticPickup(1318, 23, 542.6953,-897.9803,1304.7952); // Cвmera AddStaticPickup(1318, 23, 538.6310,-891.6687,1304.2013); // Cвmera Saida Seta AddStaticPickup(1318, 1, 1798.3790,-1578.7922,14.0906); // Cвmera Entrada Seta < */ CreateObject(16150,541.76556396,-886.17199707,1303.20129395,0.00000000,0.00000000,0.00000000); //object(ufo_barinterior) (1) CreateObject(2093,538.45800781,-881.89099121,1303.20910645,0.00000000,0.00000000,0.00000000); //object(tv_ward_low) (1) CreateObject(1828,542.19512939,-885.76055908,1303.20910645,0.00000000,0.00000000,0.25000000); //object(man_sdr_rug) (1) CreateObject(1808,545.90661621,-885.06701660,1303.20910645,0.00000000,0.00000000,0.00000000); //object(cj_watercooler2) (1) CreateObject(1782,538.64447021,-881.00097656,1304.53125000,0.00000000,0.00000000,46.00000000); //object(med_video_2) (1) CreateObject(1518,545.11285400,-899.40350342,1305.91040039,0.00000000,0.00000000,180.00000000); //object(dyn_tv_2) (1) CreateObject(1518,545.10742188,-899.40356445,1305.34631348,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (2) CreateObject(1518,545.12335205,-899.40350342,1304.80615234,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (3) CreateObject(1518,544.51165771,-899.40600586,1304.81445312,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (4) CreateObject(1518,543.87957764,-899.40863037,1304.80163574,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (5) CreateObject(1518,544.50030518,-899.40606689,1305.34936523,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (6) CreateObject(1518,544.49261475,-899.40612793,1305.91467285,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (7) CreateObject(1518,543.86474609,-899.40869141,1305.89624023,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (8) CreateObject(1518,543.87677002,-899.40863037,1305.39355469,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (9) CreateObject(1518,543.25714111,-899.41125488,1305.37646484,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (10) CreateObject(1518,542.68493652,-899.41357422,1305.36877441,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (11) CreateObject(1518,543.23846436,-899.41131592,1304.81054688,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (12) CreateObject(1518,542.64154053,-899.41375732,1304.81884766,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (13) CreateObject(1518,543.27471924,-899.41113281,1305.89794922,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (14) CreateObject(1518,542.67034912,-899.41363525,1305.90209961,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (15) CreateObject(1518,542.05541992,-899.41619873,1305.90039062,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (16) CreateObject(1518,542.04455566,-899.41625977,1305.40185547,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (17) CreateObject(1518,542.03594971,-899.41632080,1304.83764648,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (18) CreateObject(1518,541.41210938,-899.41888428,1304.83605957,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (19) CreateObject(1518,541.43322754,-899.41882324,1305.38500977,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (20) CreateObject(1518,541.42791748,-899.41882324,1305.90441895,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (21) CreateObject(1518,545.08819580,-899.40362549,1304.27722168,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (22) CreateObject(1518,544.47937012,-899.40612793,1304.27648926,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (23) CreateObject(1518,543.86425781,-899.40869141,1304.27001953,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (24) CreateObject(1518,543.25720215,-899.41125488,1304.26696777,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (25) CreateObject(1518,542.64837646,-899.41375732,1304.26843262,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (26) CreateObject(1518,542.02648926,-899.41632080,1304.26843262,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (27) CreateObject(1518,541.41204834,-899.41888428,1304.27294922,0.00000000,0.00000000,179.99450684); //object(dyn_tv_2) (28) CreateObject(2614,539.37841797,-899.36022949,1304.56909180,0.00000000,0.00000000,182.00000000); //object(cj_us_flag) (1) CreateObject(1504,537.86712646,-890.91735840,1303.24243164,0.00000000,0.00000000,270.00000000); //object(gen_doorext06) (1) CreateObject(16378,543.15722656,-896.06896973,1304.55700684,0.00000000,0.00000000,0.00000000); //object(des_byofficeint) (1) CreateObject(1713,540.27014160,-881.14288330,1303.20910645,0.00000000,0.00000000,0.00000000); //object(kb_couch04) (1) CreateObject(1713,538.62426758,-885.77636719,1303.20910645,0.00000000,0.00000000,90.00000000); //object(kb_couch04) (2) CreateObject(2266,540.63299561,-880.85498047,1304.20068359,0.00000000,0.00000000,0.00000000); //object(frame_wood_5) (1) CreateObject(11631,538.73754883,-896.50872803,1305.04101562,0.00000000,0.00000000,90.00000000); //object(ranch_desk) (1) CreateObject(2605,549.20416260,-886.17803955,1303.60754395,0.00000000,0.00000000,338.75000000); //object(polce_desk1) (1) CreateObject(2356,544.85723877,-881.74523926,1303.20910645,0.00000000,0.00000000,0.00000000); //object(police_off_chair) (1) CreateObject(2356,539.77880859,-888.54437256,1303.20910645,0.00000000,0.00000000,97.00000000); //object(police_off_chair) (2) CreateObject(2308,547.16613770,-891.12371826,1303.20910645,0.00000000,0.00000000,182.00000000); //object(med_office4_desk_4) (1) CreateObject(2356,546.36993408,-891.36706543,1303.20910645,0.00000000,0.00000000,180.00000000); //object(police_off_chair) (3) CreateObject(2198,538.62817383,-889.17987061,1303.20910645,0.00000000,0.00000000,84.00000000); //object(med_office2_desk_3) (1) CreateObject(2356,538.94561768,-898.05426025,1303.79516602,0.00000000,0.00000000,187.99450684); //object(police_off_chair) (4) CreateObject(2165,539.57958984,-898.87554932,1303.79516602,0.00000000,0.00000000,182.00000000); //object(med_office_desk_1) (1) CreateObject(1998,544.02142334,-881.78778076,1303.20910645,0.00000000,0.00000000,0.75000000); //object(officedesk1l) (1) CreateObject(2356,549.03320312,-887.15429688,1303.20910645,0.00000000,0.00000000,0.00000000); //object(police_off_chair) (5) return CreateObject(2356,539.64062500,-896.23046875,1303.79516602,0.00000000,0.00000000,72.74597168); //object(police_off_chair) (6) } public OnPlayerConnect(playerid) { KeyState[playerid] = 0; return Camera[playerid] = 0; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/camerasolta", cmdtext, true, 11) == 0) { if(!IsPlayerInRangeOfPoint(playerid, 1,1824.6990,-1538.1650,13.5469)) return SendClientMessage(playerid,0xFF0000AA," Voce Nгo Estб no Local !!"); return ShowPlayerDialog(playerid, 3212, DIALOG_STYLE_MSGBOX," Painel - Cвmera Solta"," Essa Cвmera Solta й Especial.\n Vocк Leva a Cвmera Para Onde Quiser\n Aperte 'Voar' Para Ir.","Voar","Cancelar"); } //============================================================================== if (strcmp("/desligarc", cmdtext, true, 10) == 0) { TogglePlayerControllable(playerid, 1); SetCameraBehindPlayer(playerid); KillTimer(KeyTimer[playerid]); } { if(strcmp(cmdtext, "/entrar", true) == 0) { if(IsPlayerInRangeOfPoint(playerid, 4.0, 1798.3790,-1578.7922,14.0906)) { SetPlayerPos(playerid, 538.9589,-891.6457,1304.2013); SendClientMessage(playerid, COLOR_WHITE, "Seja Bem Vindo A Secretaria De Seguranзa !."); GivePlayerMoney(playerid, -50); } return 1; } if(strcmp(cmdtext, "/sair", true) == 0) { if(IsPlayerInRangeOfPoint(playerid, 2.0, 538.9589,-891.6457,1304.2013)) { SetPlayerInterior(playerid, 0); SetPlayerPos(playerid, 1798.3790,-1578.7922,14.0906); SendClientMessage(playerid, COLOR_WHITE, "Agradecemos Sua Presenзa!"); } return 1; } } if(strcmp(cmdtext, "/irsenasp", true) == 0) { SetPlayerPos(playerid,542.6953,-897.9803,1304.7952); SetPlayerInterior(playerid, 0); } // ============================================================================= if (strcmp("/camera", cmdtext, true, 10) == 0) { if(!IsPlayerInRangeOfPoint(playerid, 1, 542.6953,-897.9803,1304.7952)) return SendClientMessage(playerid, COLOR_WHITE, "Vocк Nгo Estб no Centro de Seguranзa!"); new JFS1[110]; JFS++; format(JFS1, sizeof(JFS1), "O {FF6347}Sistema de Cвmera {AA3333}Tem{33CCFF} %d Visitas {AA3333}Desde Quando o Serve Foi Ligado!",JFS); SendClientMessage(playerid,0xAA3333AA, JFS1); Camera[playerid] = 1; return ShowPlayerDialog(playerid, CSEGURANCA, DIALOG_STYLE_LIST, "{0000FF}- Cвmeras - Criado Por : Jonathan_Feitosa - ", "{0000FF}Lugares Importantes\n{00F8FF}Ruas Importantes\n{DD30B4}Baladas\n{FFFF00}Interiores\n{FF0000}Pedбgios\n{7A00FF}Desligar Camera", "Selecionar", "Sair"); } // ============================================================================= if (strcmp("/entrarsenasp", cmdtext, true, 10) == 0) { if(IsPlayerInRangeOfPoint(playerid, 1,1798.3790,-1578.7922,14.0906)){ GameTextForPlayer(playerid, "Senasp", 4000, 5); SetPlayerInterior(playerid, 0); SetPlayerPos(playerid,538.9589,-891.6457,1304.2013);} if(IsPlayerInRangeOfPoint(playerid, 1,538.9589,-891.6457,1304.2013)){ SetPlayerInterior(playerid, 0); return SetPlayerPos(playerid,1798.3790,-1578.7922,14.0906); }} // ============================================================================= if (strcmp("/desligarcamera", cmdtext, true, 10) == 0) { if(Camera[playerid] == 1){ Camera[playerid] = 0; } else return SendClientMessage(playerid, COLOR_WHITE, " Vocк Nгo Estб Usando a Camera! :C"); SetCameraBehindPlayer(playerid); SetPlayerInterior(playerid,0); TogglePlayerControllable(playerid, 1); return SetPlayerPos(playerid, 542.6953,-897.9803,1304.7952); } // ============================================================================= return 0; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 3212) { if(response == 1) { SetPlayerInterior(playerid,0); SendClientMessage(playerid, COLOR_WHITE, "Para Desligar a {2641FE}Cвmera Solta {FFFFFF}Use {2641FE}/desligarc"); TogglePlayerControllable(playerid, 0); GetPlayerPos(playerid, PCP[playerid][0], PCP[playerid][1], PCP[playerid][2]); GetPlayerFacingAngle(playerid, PCA[playerid]); if(IsPlayerInAnyVehicle(playerid)){ GetVehicleZAngle(GetPlayerVehicleID(playerid), PCA[playerid]);} PCL[playerid][0] = PCP[playerid][0]; PCL[playerid][1] = PCP[playerid][1]; PCL[playerid][2] = PCP[playerid][2]; PCP[playerid][0] = PCP[playerid][0] - (5.0 * floatsin(-PCA[playerid], degrees)); PCP[playerid][1] = PCP[playerid][1] - (5.0 * floatcos(-PCA[playerid], degrees)); PCP[playerid][2] = PCP[playerid][2]+2.0; SetPlayerCameraPos(playerid, PCP[playerid][0], PCP[playerid][1], PCP[playerid][2]); SetPlayerCameraLookAt(playerid, PCL[playerid][0], PCL[playerid][1], PCL[playerid][2]); KeyTimer[playerid] = SetTimerEx("CheckKeyPress", 70, 1, "i", playerid); } } // ============ Cameras de Seguranзas By: Jonathan Feitosa ========================= if(dialogid == CSEGURANCA) { if(response) {// 22 if(listitem == 0) { ShowPlayerDialog(playerid, CSEGURANCA+1, DIALOG_STYLE_LIST, "{0000FF}Cameras - Lugares Importantes -", "{00F8FF}Departamento de Policia\n{FF6347}24-7\n{33CCFF}Loja de Armas\n{9ACD32}Hospital\n{FF0000}Banco", "Espionar", "Sair"); } if(listitem == 1) //Camera 2 { ShowPlayerDialog(playerid, CSEGURANCA+2, DIALOG_STYLE_LIST, "{0000FF}Cameras - Ruas Importantes", "{00F8FF}Bairro Centro de Los Santos\n{FF6347}Bairro Pequeno Mexico\n{33CCFF}Bairro Idlewood\n{9ACD32}Bairro Downtown Los Santos\n{FF0000}Bairro Morro\n{2641FE}Bairro Parque Gleen\n{00F600}Praia Santa Maria\n{FF0000}Rua Estaзгo", "Espionar", "Cancelar"); } if(listitem == 2) //Camera 2 { ShowPlayerDialog(playerid, CSEGURANCA+10, DIALOG_STYLE_LIST, "{0000FF}Cameras - Baladas", "{00F8FF}Alhamba\n{FF6347}Pig Pen", "Espionar", "Cancelar"); } if(listitem == 3) //Interiores { ShowPlayerDialog(playerid, CSEGURANCA+11, DIALOG_STYLE_LIST, "{0000FF}Cameras - Interiores", "{00F8FF}Departamento de Policia\n{FF6347}Prefeitura\n{33CCFF}Banco\n{9ACD32}Loja De Armas\n{FF0000}24-7", "Espionar", "Cancelar"); } if(listitem == 4) //Pedбgios { ShowPlayerDialog(playerid, CSEGURANCA+12, DIALOG_STYLE_LIST, "{0000FF}Cameras - Pedбgios", "{FF6347}Los Santos - San Fierro\n{00F8FF}San Fierro - Las Venturas\n{33CCFF}Las Venturas - Los Santos", "Espionar", "Cancelar"); } if(listitem == 5) //Camera Sair { TogglePlayerControllable(playerid,1); SetPlayerPos(playerid, 542.6953,-897.9803,1304.7952); SetPlayerInterior(playerid, 0); } } } // ============================================================================= if(dialogid == CSEGURANCA+1) { if(response) // Lugares Importantes ! { if(listitem == 0) // Departamento de Policia - JFS OWNA ! { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1540.8064,-1646.7190,21.9511); SetPlayerCameraLookAt(playerid, 1537.5170,-1650.7240,20.1858); SetPlayerPos(playerid, 1540.8064,-1646.7190,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } if(listitem == 1) // 24-7 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1365.2867,-1748.6545,22.7734); SetPlayerCameraLookAt(playerid, 1363.8175,-1748.6436,22.3906); SetPlayerPos(playerid, 1365.2867,-1748.6545,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } if(listitem == 2) // Loja de Arma { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1756.4012,-1172.3580,23.8281); SetPlayerCameraLookAt(playerid, 1758.6932,-1172.0590,23.8281); SetPlayerPos(playerid, 1756.4012,-1172.3580,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } if(listitem == 3) // Hospital { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1179.7465,-1353.2474,19.4560); SetPlayerCameraLookAt(playerid, 1181.5865,-1351.5922,19.4502); SetPlayerPos(playerid, 1179.7465,-1353.2474,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } if(listitem == 4) // Banco { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1419.8663,-1045.7428,27.3906); SetPlayerCameraLookAt(playerid, 1422.1774,-1044.4663,27.3906); SetPlayerPos(playerid, 1419.8663,-1045.7428,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } } } // ============================================================================= if(dialogid == CSEGURANCA+2) { if(response) // RUAS/BAIRROS { if(listitem == 0) // Bairro CENTRO { ShowPlayerDialog(playerid, CSEGURANCA+3, DIALOG_STYLE_LIST, "{33CCFF}Cameras - Bairro Centro de Los Santos", "{FFFF00}Rua Centro 1\n{00F600}Rua Centro 2", "Selecionar", "Cancelar"); } if(listitem == 1) // bAIRRO Pequeno Mexico { ShowPlayerDialog(playerid, CSEGURANCA+4, DIALOG_STYLE_LIST, "{33CCFF}Cameras - Bairro Pequeno Mexico", "{FFFF00}Rua Mexico 1\n{00F600}Rua Mexico 2", "Selecionar", "Cancelar"); } if(listitem == 2) // Bairro Idlewood { ShowPlayerDialog(playerid, CSEGURANCA+5, DIALOG_STYLE_LIST, "{33CCFF}Cameras - Bairro Idlewood", "{FFFF00}Rua Idlewood 1\n{00F600}Rua Idlewood 2\n{7491F6}Rua Idlewood 3\n{2641FE}Rua Idlewood 4\n{00D63D}Rua Idlewood 5", "Selecionar", "Cancelar"); } if(listitem == 3) // Bairro Downtown Los Santos { ShowPlayerDialog(playerid, CSEGURANCA+6, DIALOG_STYLE_LIST, "{33CCFF}Cameras - Bairro Downtown Los Santos", "{FFFF00}Rua Downtown 1\n{00F600}Rua Downtown 2\n{7491F6}Rua Downtown 3", "Selecionar", "Cancelar"); } if(listitem == 4) // Bairro Morro { ShowPlayerDialog(playerid, CSEGURANCA+7, DIALOG_STYLE_LIST, "{33CCFF}Cameras - Bairro Morro", "{FFFF00}Rua Morro 1\n{00F600}Rua Morro 2\n{7491F6}Rua Morro 3\nRua Morro 4", "Selecionar", "Cancelar"); } if(listitem == 5) // Parque Glee { ShowPlayerDialog(playerid, CSEGURANCA+8, DIALOG_STYLE_LIST, "{33CCFF}Cameras - Bairro Parque Gleen", "{FFFF00}Rua Parque Green 1\n{00F600}Rua Parque Green 2\n{7491F6}Rua Parque Green 3", "Selecionar", "Cancelar"); } if(listitem == 6) // Praia Santa Maria { ShowPlayerDialog(playerid, CSEGURANCA+9, DIALOG_STYLE_LIST, "{33CCFF}Cameras - Praia Santa Maria", "{FFFF00}Praia Santa Maria 1\n{00F600}Praia Santa Maria 2\n{7491F6}Praia Santa Maria 3", "Selecionar", "Cancelar"); } if(listitem == 7) // Rua Estacгo { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1938.3961,-1933.5433,13.3828); SetPlayerCameraLookAt(playerid, 934.4586,-1934.7949,13.3828); SetPlayerPos(playerid, 1938.3961,-1933.5433,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } } } // ==================================================================================== if(dialogid == CSEGURANCA+3) // Bairro Centro de Los Santos { if(response) { if(listitem == 0) // 1 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1671.9045,-1740.2220,13.5465); SetPlayerCameraLookAt(playerid, 1665.6132,-1739.1383,13.5450); SetPlayerPos(playerid, 1671.9045,-1740.2220,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } if(listitem == 1) // 2 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1744.9170,-1590.0386,13.5397); SetPlayerCameraLookAt(playerid, 1742.4379,-1590.1549,13.5423); SetPlayerPos(playerid, 1744.9170,-1590.0386,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } } } // ============================================================================= if(dialogid == CSEGURANCA+4) // Bairro Pequeno Mexico { if(response) { if(listitem == 0) // 1 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1727.5045,-1738.7094,13.5469); SetPlayerCameraLookAt(playerid, 1729.3236,-1737.5027,13.5469); SetPlayerPos(playerid, 1727.5045,-1738.7094,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } if(listitem == 1) // 2 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1805.2159,-1839.0151,13.5781); SetPlayerCameraLookAt(playerid, 1798.6588,-1837.9792,13.5781); SetPlayerPos(playerid, 1805.2159,-1839.0151,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } } } // ============================================================================= if(dialogid == CSEGURANCA+5) // Bairro idlwood { if(response) { if(listitem == 0) // 1 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1820.5284,-1605.0304,13.3766); SetPlayerCameraLookAt(playerid, 1821.2069,-1601.5466,13.3609); SetPlayerPos(playerid, 1820.5284,-1605.0304,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } if(listitem == 1) // 2 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1821.2452,-1848.9436,13.4141); SetPlayerCameraLookAt(playerid, 1820.7043,-1846.1687,13.4141); SetPlayerPos(playerid, 1821.2452,-1848.9436,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } if(listitem == 2) // 3 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1930.7804,-1764.3730,13.5391); SetPlayerCameraLookAt(playerid, 933.9102,-1763.2849,13.5469); SetPlayerPos(playerid, 1930.7804,-1764.3730,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } if(listitem == 3) // 4 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1862.5474,-1480.7346,13.3200); SetPlayerCameraLookAt(playerid, 1865.3745,-1481.5613,12.3825); SetPlayerPos(playerid, 1862.5474,-1480.7346,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } if(listitem == 4) // 5 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1805.2159,-1839.0151,13.5781); SetPlayerCameraLookAt(playerid, 1798.6588,-1837.9792,13.5781); SetPlayerPos(playerid, 1805.2159,-1839.0151,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } } } // ============================================================================= if(dialogid == CSEGURANCA+8) // Bairro Parque Gleen { if(response) { if(listitem == 0) // 1 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1855.3892,-1268.3625,13.3906); SetPlayerCameraLookAt(playerid, 1855.1689,-1271.5760,13.3934); SetPlayerPos(playerid, 1855.3892,-1268.3625,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } if(listitem == 1) // 2 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1874.3866,-1135.7489,23.7344); SetPlayerCameraLookAt(playerid, 1878.0491,-1135.7958,23.7632); SetPlayerPos(playerid, 1874.3866,-1135.7489,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } if(listitem == 2) // 3 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1842.3285,-1188.6066,23.6503); SetPlayerCameraLookAt(playerid, 1838.7637,-1187.7839,23.8281); SetPlayerPos(playerid, 1842.3285,-1188.6066,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } } } // ============================================================================= if(dialogid == CSEGURANCA+6) // Bairro Downtown Los Santos { if(response) { if(listitem == 0) // 1 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1581.3748,-1168.5712,24.0781); SetPlayerCameraLookAt(playerid, 1580.9467,-1166.5466,24.0781); SetPlayerPos(playerid, 1581.3748,-1168.5712,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } if(listitem == 1) // 2 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1376.6577,-1148.2861,23.8430); SetPlayerCameraLookAt(playerid, 1372.6255,-1148.2712,23.8430); SetPlayerPos(playerid, 1376.6577,-1148.2861,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } if(listitem == 2) // 3 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1453.2278,-952.8773,36.1234); SetPlayerCameraLookAt(playerid, 1458.9070,-953.4402,36.1235); SetPlayerPos(playerid, 1453.2278,-952.8773,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } } } // ============================================================================= if(dialogid == CSEGURANCA+7) // Bairro Morro { if(response) { if(listitem == 0) // 1 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1943.0764,-980.5031,48.1086); SetPlayerCameraLookAt(playerid, 1947.7219,-980.4798,47.6856); SetPlayerPos(playerid, 1943.0764,-980.5031,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } if(listitem == 1) // 2 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 2147.2004,-949.5068,72.7676); SetPlayerCameraLookAt(playerid, 2147.6794,-953.7840,72.1721); SetPlayerPos(playerid, 2147.2004,-949.5068,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } if(listitem == 2) // 3 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 2449.0688,-895.5662,100.0895); SetPlayerCameraLookAt(playerid, 2453.9451,-900.0700,98.8847); SetPlayerPos(playerid, 2449.0688,-895.5662,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } if(listitem == 3) // 4 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 2637.8315,-1005.6577,87.1044); SetPlayerCameraLookAt(playerid, 2635.7688,-1003.9021,87.1044); SetPlayerPos(playerid, 2637.8315,-1005.6577,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } } } //============================================================================== // Praia Santa Maria if(dialogid == CSEGURANCA+9) { if(response) { if(listitem == 0) // 1 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 985.5192,-1854.5796,12.7954); SetPlayerCameraLookAt(playerid, 977.3477,-1854.4637,12.4131); SetPlayerPos(playerid, 985.5192,-1854.5796,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } if(listitem == 1) // 2 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 836.1051,-1813.0375,12.4749); SetPlayerCameraLookAt(playerid, 836.4820,-1821.4585,12.2220); SetPlayerPos(playerid, 836.1051,-1813.0375,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } if(listitem == 2) // 3 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 795.8688,-1819.4578,13.0234); SetPlayerCameraLookAt(playerid, 795.9167,-1823.6200,13.0234); SetPlayerPos(playerid, 795.8688,-1819.4578,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid,0); } } } //============================================================================== // Interiores if(dialogid == CSEGURANCA+11) { if(response) { if(listitem == 0)// DP { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 242.9483,62.8970,1003.6406); SetPlayerCameraLookAt(playerid, 244.3916,63.9717,1003.6406); SetPlayerPos(playerid, 242.9483,62.8970,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid, 6); } if(listitem == 1) //PREFEITURA { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 358.6505,188.1288,1008.3828); SetPlayerCameraLookAt(playerid, 361.6689,183.9034,1008.3828); SetPlayerPos(playerid, 358.6505,188.1288,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid, 3); } if(listitem == 2) //BANCO { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 2316.6167,-0.2021,26.7422); SetPlayerCameraLookAt(playerid, 2314.6118,-4.0467,26.7422); SetPlayerPos(playerid, 2316.6167,-0.2021,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid, 0); } if(listitem == 3) //LOJA DE ARMAS { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 2169.2224,1627.6809,999.9674); SetPlayerCameraLookAt(playerid, 2170.7542,1625.0159,999.9720); SetPlayerPos(playerid, 2169.2224,1627.6809,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid, 1); } if(listitem == 4) //24-7 { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, -18.2992,-57.0826,1003.5469); SetPlayerCameraLookAt(playerid, -20.6372,-56.1016,1003.5469); SetPlayerPos(playerid, -18.2992,-57.0826,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid, 6); } } } //============================================================================== // Baladas if(dialogid == CSEGURANCA+10) { if(response) { if(listitem == 0)// Alhamba { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 499.5854,-23.9717,1000.6797); SetPlayerCameraLookAt(playerid, 495.9297,-20.8388,1000.6719); SetPlayerPos(playerid, 499.5854,-23.9717,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid, 17); } if(listitem == 1) //Pig Pen { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1218.7828,8.4408,1000.9219); SetPlayerCameraLookAt(playerid, 1217.8180,3.7467,1000.9219); SetPlayerPos(playerid, 1218.7828,8.4408,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid, 2); } } } //============================================================================== // Pedбgios if(dialogid == CSEGURANCA+12) { if(response) { if(listitem == 0)// LS - SF { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 115.1625,-1559.1655,8.2282); SetPlayerCameraLookAt(playerid, 109.5031,-1556.6415,7.6505); SetPlayerPos(playerid, 115.1625,-1559.1655,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid, 0); } if(listitem == 1) //SF - LS { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, -2697.8081,1350.8698,55.8125); SetPlayerCameraLookAt(playerid, -2695.5850,1341.1179,55.8125); SetPlayerPos(playerid,-2697.8081,1350.8698,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid, 0); } if(listitem == 2) //LV - LS { SendClientMessage(playerid, COLOR_WHITE, " >> Para Desligar a Camera Use: {2641FE}/desligarcamera <<"); SetPlayerCameraPos(playerid, 1728.3705,462.9771,30.4982); SetPlayerCameraLookAt(playerid, 1724.7896,453.3222,30.7527); SetPlayerPos(playerid, 1728.3705,462.9771,-100); TogglePlayerControllable(playerid,0); SetPlayerInterior(playerid, 0); } } } return 1; } public OnPlayerKeyStateChange(playerid,newkeys,oldkeys) { if ((newkeys==KEY_SECONDARY_ATTACK)) { OnPlayerCommandText(playerid,"/entrar");} OnPlayerCommandText(playerid,"/sair"); if(newkeys == KEY_CROUCH) { KeyState[playerid] = 1; } else if(newkeys == KEY_SPRINT) { KeyState[playerid] = 2; } else if(newkeys == (KEY_CROUCH+KEY_SPRINT)) { KeyState[playerid] = 3; } else if(newkeys == KEY_WALK) { KeyState[playerid] = 4; } else if(newkeys == (KEY_WALK+KEY_SPRINT)) { KeyState[playerid] = 5; } else { KeyState[playerid] = 0; } return 1; } forward CheckKeyPress(playerid); public CheckKeyPress(playerid) { new keys, updown, leftright; GetPlayerKeys(playerid, keys, updown, leftright); if(KeyState[playerid] == 1 || KeyState[playerid] == 3){ if(leftright == KEY_RIGHT){ if(KeyState[playerid] == 3){ PCA[playerid] = (PCA[playerid]-SPEED_ROTATE_LEFTRIGHT_FAST);}else{ PCA[playerid] = (PCA[playerid]-SPEED_ROTATE_LEFTRIGHT_SLOW);} if(PCA[playerid] <= 0){ PCA[playerid] = (360-PCA[playerid]);} MovePlayerCamera(playerid);} if(leftright == KEY_LEFT){ if(KeyState[playerid] == 3){ PCA[playerid] = (PCA[playerid]+SPEED_ROTATE_LEFTRIGHT_FAST);}else{ PCA[playerid] = (PCA[playerid]+SPEED_ROTATE_LEFTRIGHT_SLOW);} if(PCA[playerid] >= 360){ PCA[playerid] = (PCA[playerid]-360);} MovePlayerCamera(playerid);} if(updown == KEY_UP){ if(PCL[playerid][2] < (PCP[playerid][2]+5)){ if(KeyState[playerid] == 3){ PCL[playerid][2] = PCL[playerid][2]+SPEED_ROTATE_UPDOWN_FAST;}else{ PCL[playerid][2] = PCL[playerid][2]+SPEED_ROTATE_UPDOWN_SLOW;}} MovePlayerCamera(playerid);} if(updown == KEY_DOWN){ if(PCL[playerid][2] > (PCP[playerid][2]-5)){ if(KeyState[playerid] == 3){ PCL[playerid][2] = PCL[playerid][2]-SPEED_ROTATE_UPDOWN_FAST;}else{ PCL[playerid][2] = PCL[playerid][2]-SPEED_ROTATE_UPDOWN_SLOW;}} MovePlayerCamera(playerid);}} if(KeyState[playerid] == 4 || KeyState[playerid] == 5){ if(updown == KEY_UP){ if(KeyState[playerid] == 4){ PCP[playerid][2] = (PCP[playerid][2]+SPEED_MOVE_UPDOWN_SLOW); PCL[playerid][2] = (PCL[playerid][2]+SPEED_MOVE_UPDOWN_SLOW); SetPlayerCameraPos(playerid, PCP[playerid][0], PCP[playerid][1], PCP[playerid][2]); SetPlayerCameraLookAt(playerid, PCL[playerid][0], PCL[playerid][1], PCL[playerid][2]);} else if(KeyState[playerid] == 5){ PCP[playerid][2] = (PCP[playerid][2]+SPEED_MOVE_UPDOWN_FAST); PCL[playerid][2] = (PCL[playerid][2]+SPEED_MOVE_UPDOWN_FAST); SetPlayerCameraPos(playerid, PCP[playerid][0], PCP[playerid][1], PCP[playerid][2]); SetPlayerCameraLookAt(playerid, PCL[playerid][0], PCL[playerid][1], PCL[playerid][2]);}} if(updown == KEY_DOWN){ if(KeyState[playerid] == 4){ PCP[playerid][2] = (PCP[playerid][2]-SPEED_MOVE_UPDOWN_SLOW); PCL[playerid][2] = (PCL[playerid][2]-SPEED_MOVE_UPDOWN_SLOW); SetPlayerCameraPos(playerid, PCP[playerid][0], PCP[playerid][1], PCP[playerid][2]); SetPlayerCameraLookAt(playerid, PCL[playerid][0], PCL[playerid][1], PCL[playerid][2]);} else if(KeyState[playerid] == 5){ PCP[playerid][2] = (PCP[playerid][2]-SPEED_MOVE_UPDOWN_FAST); PCL[playerid][2] = (PCL[playerid][2]-SPEED_MOVE_UPDOWN_FAST); SetPlayerCameraPos(playerid, PCP[playerid][0], PCP[playerid][1], PCP[playerid][2]); SetPlayerCameraLookAt(playerid, PCL[playerid][0], PCL[playerid][1], PCL[playerid][2]);}}} else if(KeyState[playerid] == 2 || KeyState[playerid] == 0){ if(leftright == KEY_RIGHT){ new Float:Angle; Angle = PCA[playerid]; Angle -= 90.0; if(KeyState[playerid] == 2){ PCP[playerid][0] = PCP[playerid][0] + floatmul(floatsin(-Angle, degrees), SPEED_MOVE_LEFTRIGHT_FAST); PCP[playerid][1] = PCP[playerid][1] + floatmul(floatcos(-Angle, degrees), SPEED_MOVE_LEFTRIGHT_FAST); PCL[playerid][0] = PCL[playerid][0] + floatmul(floatsin(-Angle, degrees), SPEED_MOVE_LEFTRIGHT_FAST); PCL[playerid][1] = PCL[playerid][1] + floatmul(floatcos(-Angle, degrees), SPEED_MOVE_LEFTRIGHT_FAST);}else{ PCP[playerid][0] = PCP[playerid][0] + floatmul(floatsin(-Angle, degrees), SPEED_MOVE_LEFTRIGHT_SLOW); PCP[playerid][1] = PCP[playerid][1] + floatmul(floatcos(-Angle, degrees), SPEED_MOVE_LEFTRIGHT_SLOW); PCL[playerid][0] = PCL[playerid][0] + floatmul(floatsin(-Angle, degrees), SPEED_MOVE_LEFTRIGHT_SLOW); PCL[playerid][1] = PCL[playerid][1] + floatmul(floatcos(-Angle, degrees), SPEED_MOVE_LEFTRIGHT_SLOW);} SetPlayerCameraPos(playerid, PCP[playerid][0], PCP[playerid][1], PCP[playerid][2]); SetPlayerCameraLookAt(playerid, PCL[playerid][0], PCL[playerid][1], PCL[playerid][2]);} if(leftright == KEY_LEFT){ new Float:Angle; Angle = PCA[playerid]; Angle += 90.0; if(KeyState[playerid] == 2){ PCP[playerid][0] = PCP[playerid][0] + floatmul(floatsin(-Angle, degrees), SPEED_MOVE_LEFTRIGHT_FAST); PCP[playerid][1] = PCP[playerid][1] + floatmul(floatcos(-Angle, degrees), SPEED_MOVE_LEFTRIGHT_FAST); PCL[playerid][0] = PCL[playerid][0] + floatmul(floatsin(-Angle, degrees), SPEED_MOVE_LEFTRIGHT_FAST); PCL[playerid][1] = PCL[playerid][1] + floatmul(floatcos(-Angle, degrees), SPEED_MOVE_LEFTRIGHT_FAST);}else{ PCP[playerid][0] = PCP[playerid][0] + floatmul(floatsin(-Angle, degrees), SPEED_MOVE_LEFTRIGHT_SLOW); PCP[playerid][1] = PCP[playerid][1] + floatmul(floatcos(-Angle, degrees), SPEED_MOVE_LEFTRIGHT_SLOW); PCL[playerid][0] = PCL[playerid][0] + floatmul(floatsin(-Angle, degrees), SPEED_MOVE_LEFTRIGHT_SLOW); PCL[playerid][1] = PCL[playerid][1] + floatmul(floatcos(-Angle, degrees), SPEED_MOVE_LEFTRIGHT_SLOW);} SetPlayerCameraPos(playerid, PCP[playerid][0], PCP[playerid][1], PCP[playerid][2]); SetPlayerCameraLookAt(playerid, PCL[playerid][0], PCL[playerid][1], PCL[playerid][2]);} if(updown == KEY_UP){ new Float:X, Float:Y, Float:Z; if(KeyState[playerid] == 2){ GetCoordsOnLine3D(PCP[playerid][0], PCP[playerid][1], PCP[playerid][2], PCL[playerid][0], PCL[playerid][1], PCL[playerid][2], SPEED_MOVE_FORWARDBACKWARD_FAST, X, Y, Z); PCP[playerid][0] = X; PCP[playerid][1] = Y; PCP[playerid][2] = Z; X = 0.0; Y=0.0; Z=0.0; GetCoordsOnLine3D(PCP[playerid][0], PCP[playerid][1], PCP[playerid][2], PCL[playerid][0], PCL[playerid][1], PCL[playerid][2], 5.0, X, Y, Z); PCL[playerid][0] = X; PCL[playerid][1] = Y; PCL[playerid][2] = Z; SetPlayerCameraPos(playerid, PCP[playerid][0], PCP[playerid][1], PCP[playerid][2]); SetPlayerCameraLookAt(playerid, PCL[playerid][0], PCL[playerid][1], PCL[playerid][2]);}else{ GetCoordsOnLine3D(PCP[playerid][0], PCP[playerid][1], PCP[playerid][2], PCL[playerid][0], PCL[playerid][1], PCL[playerid][2], SPEED_MOVE_FORWARDBACKWARD_SLOW, X, Y, Z); PCP[playerid][0] = X; PCP[playerid][1] = Y; PCP[playerid][2] = Z; X = 0.0; Y=0.0; Z=0.0; GetCoordsOnLine3D(PCP[playerid][0], PCP[playerid][1], PCP[playerid][2], PCL[playerid][0], PCL[playerid][1], PCL[playerid][2], 5.0, X, Y, Z); PCL[playerid][0] = X; PCL[playerid][1] = Y; PCL[playerid][2] = Z; SetPlayerCameraPos(playerid, PCP[playerid][0], PCP[playerid][1], PCP[playerid][2]); SetPlayerCameraLookAt(playerid, PCL[playerid][0], PCL[playerid][1], PCL[playerid][2]);}} if(updown == KEY_DOWN){ new Float:X, Float:Y, Float:Z; if(KeyState[playerid] == 2){ GetCoordsOnLine3D(PCP[playerid][0], PCP[playerid][1], PCP[playerid][2], PCL[playerid][0], PCL[playerid][1], PCL[playerid][2], -SPEED_MOVE_FORWARDBACKWARD_FAST, X, Y, Z); PCP[playerid][0] = X; PCP[playerid][1] = Y; PCP[playerid][2] = Z; X = 0.0; Y=0.0; Z=0.0; GetCoordsOnLine3D(PCP[playerid][0], PCP[playerid][1], PCP[playerid][2], PCL[playerid][0], PCL[playerid][1], PCL[playerid][2], 5.0, X, Y, Z); PCL[playerid][0] = X; PCL[playerid][1] = Y; PCL[playerid][2] = Z; SetPlayerCameraPos(playerid, PCP[playerid][0], PCP[playerid][1], PCP[playerid][2]); SetPlayerCameraLookAt(playerid, PCL[playerid][0], PCL[playerid][1], PCL[playerid][2]);}else{ GetCoordsOnLine3D(PCP[playerid][0], PCP[playerid][1], PCP[playerid][2], PCL[playerid][0], PCL[playerid][1], PCL[playerid][2], -SPEED_MOVE_FORWARDBACKWARD_SLOW, X, Y, Z); PCP[playerid][0] = X; PCP[playerid][1] = Y; PCP[playerid][2] = Z; X = 0.0; Y=0.0; Z=0.0; GetCoordsOnLine3D(PCP[playerid][0], PCP[playerid][1], PCP[playerid][2], PCL[playerid][0], PCL[playerid][1], PCL[playerid][2], 5.0, X, Y, Z); PCL[playerid][0] = X; PCL[playerid][1] = Y; PCL[playerid][2] = Z; SetPlayerCameraPos(playerid, PCP[playerid][0], PCP[playerid][1], PCP[playerid][2]); SetPlayerCameraLookAt(playerid, PCL[playerid][0], PCL[playerid][1], PCL[playerid][2]); } } } } stock MovePlayerCamera(playerid) { PCL[playerid][0] = PCP[playerid][0] + (floatmul(5.0, floatsin(-PCA[playerid], degrees))); PCL[playerid][1] = PCP[playerid][1] + (floatmul(5.0, floatcos(-PCA[playerid], degrees))); SetPlayerCameraPos(playerid, PCP[playerid][0], PCP[playerid][1], PCP[playerid][2]); SetPlayerCameraLookAt(playerid, PCL[playerid][0], PCL[playerid][1], PCL[playerid][2]); } GetCoordsOnLine3D(Float:startX, Float:startY, Float:startZ, Float:endX, Float:endY, Float:endZ, Float:length, &Float:RX, &Float:RY, &Float:RZ) //Original function by Nubotron. Slightly edited by me. { RX = startX - endX; RY = startY - endY; RZ = startZ - endZ; new Float:sqrt = floatsqroot((RX * RX) + (RY * RY) + (RZ * RZ)); if (sqrt < 0.01) sqrt = 0.01; RX = -length * (RX / sqrt) + startX; RY = -length * (RY / sqrt) + startY; RZ = -length * (RZ / sqrt) + startZ; }