Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
- *
- * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
- * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
- *
- * Codigo Creado Por OTACON
- *
- * CREDITOS:
- * OTACON: Realizacion y Idea de creacion del code.
- * TÙ: Modificacion libremente respetando lo mencionado ;).
- *
- * NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
- *
- * Prohibido TOTALMENTE el Robo de Créditos o la
- * Publicación de este FILTERSCRIPT sin Mi Permiso.
- */
- /*
- * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
- *
- * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
- * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
- *
- * Code Created By OTACON
- *
- * CREDITS:
- * OTACON: Idea Making and code creation.
- * YOUR: Modification freely respecting the above ;).
- *
- * NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
- *
- * FULLY spaces Theft Credit or
- * Publication of this FILTERSCRIPT without my permission.
- */
- /*
- www.youtube.com/watch?v=EoVesYgtqhs
- */
- native IsValidVehicle(vehicleid);
- #include <a_samp>
- #include <zcmd>
- #define TIMER:%0(%1) forward%0(%1); public%0(%1)
- #define VEHICULO_VOLADOR (604)
- #define TIEMPO_CARGAR (170)
- enum vuelo {
- bool:Invisibilidad,
- bool:ActivarCoche,
- Float:VidaCoche,
- ObjetoCoche, };
- static CocheVolador[MAX_VEHICLES][vuelo],
- MatarCocheVolador[MAX_PLAYERS],
- CrearCocheVolador[MAX_PLAYERS];
- public OnPlayerStateChange(playerid, newstate, oldstate){
- new vehicleid = GetPlayerVehicleID(playerid);
- switch(GetVehicleModel(vehicleid)){
- case VEHICULO_VOLADOR:{
- switch(CocheVolador[vehicleid][ActivarCoche]){
- case true:{
- switch(GetPlayerState(playerid)){
- case PLAYER_STATE_DRIVER:{KillTimer(MatarCocheVolador[playerid]); MatarCocheVolador[playerid]=SetTimerEx("ActualizarCocheVolador", TIEMPO_CARGAR, true, "d", playerid);}
- case PLAYER_STATE_ONFOOT:{KillTimer(MatarCocheVolador[playerid]);}
- }
- }
- }
- }
- } return true;
- }
- COMMAND:car(playerid, params[]){
- new Float:pos[4];
- GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
- GetPlayerFacingAngle(playerid,pos[3]);
- DestroyVehicle(CrearCocheVolador[playerid]);
- CrearCocheVolador[playerid]=CreateVehicle(VEHICULO_VOLADOR,pos[0],pos[1],pos[2],pos[3],-1,-1,999999);
- PutPlayerInVehicle(playerid,CrearCocheVolador[playerid],0);
- return true;
- }
- COMMAND:fly(playerid, params[]){
- new vehicleid = GetPlayerVehicleID(playerid);
- switch(GetPlayerState(playerid)){
- case PLAYER_STATE_DRIVER:{
- if(GetVehicleModel(vehicleid)!=VEHICULO_VOLADOR) return SendClientMessage(playerid,-1,"INFO: Este vehiculo no tiene sistema de vuelo!.");
- switch(CocheVolador[vehicleid][ActivarCoche]){
- case false:{
- CocheVolador[vehicleid][ActivarCoche]=true;
- new Float:health;
- GetVehicleHealth(vehicleid, health);
- CocheVolador[vehicleid][VidaCoche]=health;
- SetVehicleHealth(vehicleid, (Float:0x7F800000));
- SetVehicleVelocity(vehicleid,0,0,0);
- KillTimer(MatarCocheVolador[playerid]);
- MatarCocheVolador[playerid] = SetTimerEx("ActualizarCocheVolador", TIEMPO_CARGAR, true, "d", playerid);
- DestroyObject(CocheVolador[vehicleid][ObjetoCoche]);
- CocheVolador[vehicleid][ObjetoCoche]=CreateObject(18725,0,0,0,0,0,0);
- AttachObjectToVehicle(CocheVolador[vehicleid][ObjetoCoche],vehicleid,-0.5,-1.0,1.0,0.0,180.0,0.0);
- SendClientMessage(playerid,-1,"INFO: Sistema de vuelo activado!.");
- }
- case true:{
- CocheVolador[vehicleid][ActivarCoche]=false;
- SetVehicleHealth(vehicleid, CocheVolador[vehicleid][VidaCoche]);
- CocheVolador[vehicleid][VidaCoche]=0;
- SetVehicleVelocity(vehicleid,0,0,0);
- KillTimer(MatarCocheVolador[playerid]);
- DestroyObject(CocheVolador[vehicleid][ObjetoCoche]);
- SendClientMessage(playerid,-1,"INFO: Sistema de vuelo desactivado!.");
- }
- }
- } default:{SendClientMessage(playerid,-1,"INFO: Usted no se encuentra a pie!.");}
- } return true;
- }
- COMMAND:invisible(playerid, params[]){
- new vehicleid = GetPlayerVehicleID(playerid);
- switch(GetPlayerState(playerid)){
- case PLAYER_STATE_DRIVER:{
- switch(GetVehicleModel(vehicleid)){
- case VEHICULO_VOLADOR:{
- switch(CocheVolador[vehicleid][ActivarCoche]){
- case true:{
- switch(CocheVolador[vehicleid][Invisibilidad]){
- case false:{
- LinkVehicleToInterior(vehicleid, 6);
- CocheVolador[vehicleid][Invisibilidad]=true;}
- case true:{
- LinkVehicleToInterior(vehicleid, 0);
- CocheVolador[vehicleid][Invisibilidad]=false;}
- }
- }
- }
- } default:{SendClientMessage(playerid,-1,"INFO: Este vehiculo no tiene sistema de vuelo!.");}
- }
- } default:{SendClientMessage(playerid,-1,"INFO: Usted no se encuentra en un vehiculo, o usted no es el conductor del vehiculo!.");}
- } return true;
- }
- TIMER: ActualizarCocheVolador(playerid){
- new vehicleid = GetPlayerVehicleID(playerid);
- switch(GetVehicleModel(vehicleid)){
- case VEHICULO_VOLADOR:{
- static TeclasCoche[3], Float:PosicionCoche[2][3];
- GetPlayerKeys(playerid,TeclasCoche[0],TeclasCoche[1],TeclasCoche[2]);
- if(TeclasCoche[0] & KEY_HANDBRAKE && CocheVolador[vehicleid][ActivarCoche]==true){
- GetPlayerCameraPos(playerid, PosicionCoche[1][0],PosicionCoche[1][1],PosicionCoche[1][2]);
- GetPlayerCameraFrontVector(playerid, PosicionCoche[0][0],PosicionCoche[0][1],PosicionCoche[0][2]);
- SetVehicleToFacePos(vehicleid, PosicionCoche[0][0] + PosicionCoche[1][0], PosicionCoche[0][1]+PosicionCoche[1][1]);
- SetVehicleVelocity(vehicleid, PosicionCoche[0][0]*1.0, PosicionCoche[0][1]*1.0, PosicionCoche[0][2]*1.0);
- }
- }
- } return true;
- }
- TIMER: Float:SetVehicleToFacePos(vehicleid, Float:X, Float:Y){
- new Float:pX, Float:pY, Float:pZ, Float:ang;
- if(!IsValidVehicle(vehicleid)) return 0.0;
- GetVehiclePos(vehicleid, pX, pY, pZ);
- if( Y > pY ) ang = (-acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
- else if( Y < pY && X < pX ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 450.0);
- else if( Y < pY ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
- if(X > pX) ang = (floatabs(floatabs(ang) + 180.0));
- else ang = (floatabs(ang) - 180.0);
- ang += 180.0;
- SetVehicleZAngle(vehicleid, ang);
- return ang;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement