Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- /*CreateObject(971, 2644.538086, -2039.156250, 12.855463, 0.0000, 0.0000, 0.0000);
- CreateObject(971, 1042.446411, -1026.004761, 31.101563, 0.0000, 0.0000, 0.0000);
- CreateObject(971, -2716.016113, 217.545639, 3.295407, 0.0000, 0.0000, 269.7591);*/
- #define FILTERSCRIPT
- #if defined FILTERSCRIPT
- #define GREEN 0x21DD00FF
- #define RED 0xE60000FF
- #define ADMIN_RED 0xFB0000FF
- #define YELLOW 0xFFFF00FF
- #define ORANGE 0xF97804FF
- #define LIGHTRED 0xFF8080FF
- #define LIGHTBLUE 0x00C2ECFF
- #define PURPLE 0xB360FDFF
- #define BLUE 0x1229FAFF
- #define LIGHTGREEN 0x38FF06FF
- #define DARKPINK 0xE100E1FF
- #define DARKGREEN 0x008040FF
- #define AQUAGREEN 0x00CACAFB
- #define NICESKY 0x99FFFFAA
- #define GREY 0xCECECEFF
- #define WHITE 0xFFFFFFFF
- new Float:q, Float:w, Float:e;
- new tune1;
- new tune2;
- forward tunea(playerid);
- forward tuneb(playerid);
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- CreateObject(971, 2644.538086, -2039.156250, 12.855463, 0.0000, 0.0000, 0.0000);
- CreateObject(971, 1042.446411, -1026.004761, 31.101563, 0.0000, 0.0000, 0.0000);
- CreateObject(971, -2716.016113, 217.545639, 3.295407, 0.0000, 0.0000, 269.7591);
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmdtext,"/tune", true) == 0)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(!IsPlayerInTransfenderVehicle(playerid, vehicleid))
- {
- GetPlayerPos(playerid, q, w, e);
- SetPlayerVirtualWorld(playerid,playerid+1);
- SetVehiclePos(vehicleid,1041.1611,-1020.1884,31.9751);
- SetVehicleZAngle(vehicleid, 359.6632);
- SetVehicleVirtualWorld(vehicleid, playerid+1);
- tune1 = SetTimer("tunea",1000,true);
- SendClientMessage(playerid, PURPLE, "When you are finished modifying your car please exit the garage");
- }
- else if(!IsPlayerInLocolowVehicle(playerid, vehicleid))
- {
- GetPlayerPos(playerid, q, w, e);
- SetPlayerVirtualWorld(playerid,playerid+1);
- SetVehiclePos(vehicleid,2644.7661,-2042.4143,13.2611);
- SetVehicleZAngle(vehicleid, 178.4298);
- SetVehicleVirtualWorld(vehicleid, playerid+1);
- tune1 = SetTimer("tunea",1000,true);
- SendClientMessage(playerid, PURPLE, "When you are finished modifying your car please exit the garage");
- }
- else if(!IsPlayerInWAAVehicle(playerid, vehicleid))
- {
- GetPlayerPos(playerid, q, w, e);
- SetPlayerVirtualWorld(playerid,playerid+1);
- SetVehiclePos(vehicleid,-2721.9834,217.1915,4.3515);
- SetVehicleZAngle(vehicleid, 92.3493);
- SetVehicleVirtualWorld(vehicleid, playerid+1);
- tune1 = SetTimer("tunea",1000,true);
- SendClientMessage(playerid, PURPLE, "When you are finished modifying your car please exit the garage");
- }
- else
- {
- SendClientMessage(playerid, RED, "You are either not in a vehicle or not in a vehicle that can be modded");
- }
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- if(!IsPlayerInTransfenderVehicle(playerid, vehicleid))
- {
- SendClientMessage(playerid, PURPLE, "Type /tune to mod your vehicle, when finished you will be brought back to your location!");
- }
- else if(!IsPlayerInLocolowVehicle(playerid, vehicleid))
- {
- SendClientMessage(playerid, PURPLE, "Type /tune to mod your vehicle, when finished you will be brought back to your location!");
- }
- else if(!IsPlayerInWAAVehicle(playerid, vehicleid))
- {
- SendClientMessage(playerid, PURPLE, "Type /tune to mod your vehicle, when finished you will be brought back to your location!");
- }
- return 1;
- }
- IsPlayerInTransfenderVehicle(playerid,vehicleid)
- {
- #define MAX_VALID_TRANSFENDER_VEHICLES 65
- new InTransfenderVehicle[MAX_VALID_TRANSFENDER_VEHICLES] =
- {
- 400,401,402,404,405,409,410,411,415,418,419,420,421,422,424,426,436,438,439,
- 442,445,451,458,466,467,474,475,477,478,479,480,489,491,492,496,500,505,506,
- 507,516,517,518,527,526,529,533,540,541,542,545,546,547,549,550,551,555,575,
- 579,580,585,587,589,600,602,603
- };
- vehicleid = GetPlayerVehicleID(playerid);
- if(IsPlayerInVehicle(playerid,vehicleid))
- {
- for(new i = 0; i < MAX_VALID_TRANSFENDER_VEHICLES; i++)
- {
- if(GetVehicleModel(vehicleid) == InTransfenderVehicle[i])
- {
- return 0;
- }
- }
- }
- return 1;
- }
- IsPlayerInLocolowVehicle(playerid,vehicleid)
- {
- #define MAX_VALID_LOCOLOW_VEHICLES 7
- new InLocolowVehicle[MAX_VALID_LOCOLOW_VEHICLES] =
- {
- 412,534,535,536,566,567,576
- };
- vehicleid = GetPlayerVehicleID(playerid);
- if(IsPlayerInVehicle(playerid,vehicleid))
- {
- for(new i = 0; i < MAX_VALID_LOCOLOW_VEHICLES; i++)
- {
- if(GetVehicleModel(vehicleid) == InLocolowVehicle[i])
- {
- return 0;
- }
- }
- }
- return 1;
- }
- IsPlayerInWAAVehicle(playerid,vehicleid)
- {
- #define MAX_VALID_WAA_VEHICLES 6
- new InWAAVehicle[MAX_VALID_WAA_VEHICLES] =
- {
- 558,559,560,561,562,565
- };
- vehicleid = GetPlayerVehicleID(playerid);
- if(IsPlayerInVehicle(playerid,vehicleid))
- {
- for(new i = 0; i < MAX_VALID_WAA_VEHICLES; i++)
- {
- if(GetVehicleModel(vehicleid) == InWAAVehicle[i])
- {
- return 0;
- }
- }
- }
- return 1;
- }
- public tunea(playerid)
- {
- if (PlayerToPoint(20, playerid,617.5380,-1.9900,1000.6829))
- {
- tune2 = SetTimer("tuneb",1000,true);
- }
- else if (PlayerToPoint(20, playerid,616.7820,-74.8151,997.6350))
- {
- tune2 = SetTimer("tuneb",1000,true);
- }
- else if (PlayerToPoint(20, playerid,615.2851,-124.2390,997.6350))
- {
- tune2 = SetTimer("tuneb",1000,true);
- }
- return 1;
- }
- public tuneb(playerid)
- {
- KillTimer(tune1);
- new vehicleid = GetPlayerVehicleID(playerid);
- if (PlayerToPoint(20, playerid,1041.1611,-1020.1884,31.9751))
- {
- KillTimer(tune1);
- SetVehiclePos(vehicleid, q, w, e);
- SetPlayerVirtualWorld(playerid,0);
- SetVehicleVirtualWorld(vehicleid, 0);
- KillTimer(tune2);
- }
- else if (PlayerToPoint(20, playerid,-2721.9834,217.1915,4.3515))
- {
- KillTimer(tune1);
- SetVehiclePos(vehicleid, q, w, e);
- SetPlayerVirtualWorld(playerid,0);
- SetVehicleVirtualWorld(vehicleid, 0);
- KillTimer(tune2);
- }
- else if (PlayerToPoint(20, playerid,2644.7661,-2042.4143,13.2611))
- {
- KillTimer(tune1);
- SetVehiclePos(vehicleid, q, w, e);
- SetPlayerVirtualWorld(playerid,0);
- SetVehicleVirtualWorld(vehicleid, 0); //KillTimer()
- KillTimer(tune2);
- }
- return 1;
- }
- PlayerToPoint(Float:radius, playerid, Float:X, Float:Y, Float:Z)
- {
- new Float:oldpos[3], Float:temppos[3];
- GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
- temppos[0] = (oldpos[0] -X);
- temppos[1] = (oldpos[1] -Y);
- temppos[2] = (oldpos[2] -Z);
- if(((temppos[0] < radius) && (temppos[0] > -radius)) && ((temppos[1] < radius) && (temppos[1] > -radius)) && ((temppos[2] < radius) && (temppos[2] > -radius)))
- {
- return true;
- }
- return false;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement