Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Dieser Filterscript wurde von Phyber erstellt. Bei Fragen oder Probleme meldet euch einfach in Skype bei mir: peter02238.
- Bitte diese Credits nicht löschen, man sieht diese ja nicht :)
- Funktionen:
- q = links blinken
- e = rechts blinken
- /warnblinken = Warnblinker*/
- #include <a_samp>
- enum AutoControl
- {
- phyberLeftBlink,
- phyberRightBlink,
- phyberBlink[4],
- }
- new VehInfo[MAX_VEHICLES][AutoControl];
- new Blinker[5];
- #define rot 0xFF0000FF
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blinkersystem von Phyber");
- print("--------------------------------------\n");
- Blinker[0] = CreateObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,100.0);
- Blinker[1] = CreateObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,100.0);
- Blinker[2] = CreateObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,100.0);
- Blinker[3] = CreateObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,100.0);
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- DestroyObject(VehInfo[vehicleid][phyberBlink][0]);
- DestroyObject(VehInfo[vehicleid][phyberBlink][1]);
- VehInfo[vehicleid][phyberRightBlink] = 0;
- DestroyObject(VehInfo[vehicleid][phyberBlink][2]);
- DestroyObject(VehInfo[vehicleid][phyberBlink][3]);
- VehInfo[vehicleid][phyberLeftBlink] = 0;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/warnblinken", cmdtext, true, 10) == 0)
- {
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,rot,"Zu Fuß kann man nicht blinken ;D");
- new carid = GetPlayerVehicleID(playerid);
- if(IsVehACar(carid) || IsVehACar2(carid))
- {
- new vid = GetPlayerVehicleID(playerid);
- if(VehInfo[vid][phyberLeftBlink] == 0 && VehInfo[vid][phyberRightBlink] == 0)
- {
- VehInfo[vid][phyberLeftBlink] = 1; VehInfo[vid][phyberRightBlink] = 1;
- VehInfo[vid][phyberBlink][0] = CreateObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,100.0);
- VehInfo[vid][phyberBlink][1] = CreateObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,100.0);
- AttachObjectToVehicle(VehInfo[vid][phyberBlink][0], vid, 0.9, 2.5, 0.1, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(VehInfo[vid][phyberBlink][1], vid, 0.9, -2.7, 0.1, 0.0, 0.0, 0.0);
- VehInfo[vid][phyberRightBlink] = 1;
- VehInfo[vid][phyberBlink][2] = CreateObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,100.0);
- VehInfo[vid][phyberBlink][3] = CreateObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,100.0);
- AttachObjectToVehicle(VehInfo[vid][phyberBlink][2], vid, -0.9, 2.5, 0.1, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(VehInfo[vid][phyberBlink][3], vid, -0.9, -2.7, 0.1, 0.0, 0.0, 0.0);
- VehInfo[vid][phyberLeftBlink] = 1;
- }
- else
- {
- if(VehInfo[vid][phyberLeftBlink] == 1 && VehInfo[vid][phyberRightBlink] == 1)
- {
- VehInfo[vid][phyberLeftBlink] = 0; VehInfo[vid][phyberRightBlink] = 0;
- DestroyObject(VehInfo[vid][phyberBlink][0]);
- DestroyObject(VehInfo[vid][phyberBlink][1]);
- VehInfo[vid][phyberRightBlink] = 0;
- DestroyObject(VehInfo[vid][phyberBlink][2]);
- DestroyObject(VehInfo[vid][phyberBlink][3]);
- VehInfo[vid][phyberLeftBlink] = 0;
- }
- if(VehInfo[vid][phyberLeftBlink] == 1)
- {
- VehInfo[vid][phyberLeftBlink] = 0;
- DestroyObject(VehInfo[vid][phyberBlink][2]);
- DestroyObject(VehInfo[vid][phyberBlink][3]);
- VehInfo[vid][phyberLeftBlink] = 0;
- }
- if(VehInfo[vid][phyberRightBlink] == 1)
- {
- VehInfo[vid][phyberRightBlink] = 0;
- DestroyObject(VehInfo[vid][phyberBlink][0]);
- DestroyObject(VehInfo[vid][phyberBlink][1]);
- VehInfo[vid][phyberRightBlink] = 0;
- }
- }
- }
- else
- {
- SendClientMessage(playerid,rot,"Dein Fahrzeug kann nicht blinken!");
- }
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- new carid = GetPlayerVehicleID(playerid);
- new vid = GetPlayerVehicleID(playerid);
- if(newkeys == (KEY_LOOK_RIGHT)) //rechts gucken im auto
- {
- if(!IsPlayerInAnyVehicle(playerid)) return 1;
- if(VehInfo[vid][phyberRightBlink] == 0)
- {
- if(IsVehACar(carid) || IsVehACar2(carid))
- {
- VehInfo[vid][phyberLeftBlink] = 0; //Linker Blinker ausschalten
- DestroyObject(VehInfo[vid][phyberBlink][2]);
- DestroyObject(VehInfo[vid][phyberBlink][3]);
- VehInfo[vid][phyberLeftBlink] = 0;
- VehInfo[vid][phyberRightBlink] = 1;
- VehInfo[vid][phyberBlink][0] = CreateObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,100.0);
- VehInfo[vid][phyberBlink][1] = CreateObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,100.0);
- AttachObjectToVehicle(VehInfo[vid][phyberBlink][0], vid, 0.9, 2.5, 0.1, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(VehInfo[vid][phyberBlink][1], vid, 0.9, -2.7, 0.1, 0.0, 0.0, 0.0);
- VehInfo[vid][phyberRightBlink] = 1;
- }
- else {return 1;}
- }
- else
- {
- VehInfo[vid][phyberRightBlink] = 0;
- DestroyObject(VehInfo[vid][phyberBlink][0]);
- DestroyObject(VehInfo[vid][phyberBlink][1]);
- VehInfo[vid][phyberRightBlink] = 0;
- }
- }
- if(newkeys == (KEY_LOOK_LEFT)) //links gucken im auto
- {
- if(!IsPlayerInAnyVehicle(playerid)) return 1;
- if(VehInfo[vid][phyberLeftBlink] == 0)
- {
- if(IsVehACar(carid) || IsVehACar2(carid))
- {
- VehInfo[vid][phyberRightBlink] = 0; //rechter blinker aus
- DestroyObject(VehInfo[vid][phyberBlink][0]);
- DestroyObject(VehInfo[vid][phyberBlink][1]);
- VehInfo[vid][phyberRightBlink] = 0;
- VehInfo[vid][phyberLeftBlink] = 1;
- VehInfo[vid][phyberBlink][2] = CreateObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,100.0);
- VehInfo[vid][phyberBlink][3] = CreateObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,100.0);
- AttachObjectToVehicle(VehInfo[vid][phyberBlink][2], vid, -0.9, 2.5, 0.1, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(VehInfo[vid][phyberBlink][3], vid, -0.9, -2.7, 0.1, 0.0, 0.0, 0.0);
- VehInfo[vid][phyberLeftBlink] = 1;
- return 1;
- }
- else {return 1;}
- }
- else
- {
- VehInfo[vid][phyberLeftBlink] = 0;
- DestroyObject(VehInfo[vid][phyberBlink][2]);
- DestroyObject(VehInfo[vid][phyberBlink][3]);
- VehInfo[vid][phyberLeftBlink] = 0;
- }
- return 1;
- }
- return 1;
- }
- //stocks
- stock IsVehACar(vehicleid)
- {
- new result;
- new model = GetVehicleModel(vehicleid);
- switch(model)
- {
- case 400,401,402,404,409,410,411,412,413,414,415,416,418,419,420,421,422,423,424,426,427,428,429,434,436,438,439,440,442,445,451,457,458,459,466,467,470,471,474,475,477,478,479,480,482,483,485,486,489,490,491,492,494,495,496,498,499,500,502,503,504: result= model;
- default: result = 0;
- }
- return result;
- }
- stock IsVehACar2(vehicleid)
- {
- new result;
- new model = GetVehicleModel(vehicleid);
- switch(model)
- {
- case 505,507,508,516,517,518,525,526,527,528,529,530,531,533,534,535,536,539,540,541,542,543,545,546,547,549,550,551,552,554,555,558,559,560,561,562,565,566,567,568,571,572,573,574,575,576,579,580,582,583,585,587,588,589,596,597,598,599,600,601,602,603,604,605,609: result= model;
- default: result = 0;
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement