Advertisement
Angix

Auto System per DM/STUNT - by Angix -

Jun 13th, 2011
159
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 7.21 KB | None
  1. /*
  2. Xevo - Vehicle Control by Angix
  3. */
  4. #define VEHICLE_PARAMS_OFF  0
  5. #define FILTERSCRIPT
  6. #include <a_samp>
  7. #define VEHICLE_PARAMS_ON   1
  8. #define COLOR_BLUE 0x00a8ff
  9. #define COLOR_GREEN 0x0be600
  10. #define COLOR_RED 0xff0000
  11. #define VEHICLE_PARAMS_UNSET    -1
  12. #define CAR1 1337
  13. #define CAR2 1338
  14. #define CAR3 1339
  15. #define CAR4 1400
  16. #define CAR5 1401
  17. #define CAR6 1402
  18. #define CAR7 1403
  19. new engine,lights,alarm,doors,bonnet,boot,objective;
  20. public OnFilterScriptInit()
  21. {
  22.     print("\n--------------------------------------");
  23.     print("--- Veicoli Control by Angix -----");
  24.     print("--------------------------------------\n");
  25.     return 1;
  26. }
  27.  
  28. public OnFilterScriptExit()
  29. {
  30.     return 1;
  31. }
  32.  
  33. public OnPlayerConnect(playerid)
  34. {
  35.     SendClientMessage(playerid, COLOR_GREEN, "Questo server utilizza lo xevo auto system, by Angix");
  36.     SendClientMessage(playerid, COLOR_RED, "Utilizza /automenu");
  37.     return 1;
  38. }
  39.  
  40. public OnPlayerCommandText(playerid, cmdtext[])
  41. {
  42.     if (strcmp("/automenu", cmdtext, true, 10) == 0)
  43.     {
  44.         if(IsPlayerInAnyVehicle(playerid))
  45.         {
  46.             if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
  47.             {
  48.                 SendClientMessage(playerid, COLOR_RED, "Non sei il proprietario del veicolo.");
  49.                 return 1;
  50.             }
  51.             ShowPlayerDialog(playerid, CAR1, DIALOG_STYLE_LIST, "Xevo Veicoli Control - By Angix","Motore\nFari\nCofano\nCofano2\nAllarme\nPorte","Seleziona","Annulla");
  52.         }
  53.         else
  54.         {
  55.             SendClientMessage(playerid, COLOR_BLUE, "Non hai un veicolo, compralo alla concessionaria!");
  56.             return 1;
  57.         }
  58.         return 1;
  59.     }
  60.     return 0;
  61. }
  62.  
  63. public OnPlayerStateChange(playerid, newstate, oldstate)
  64. {
  65.     if(newstate == PLAYER_STATE_DRIVER)
  66.     {
  67.         SendClientMessage(playerid, COLOR_GREEN, "Usa: /automenu > e scegli un componente del dialogo.");
  68.         return 1;
  69.     }
  70.     return 1;
  71. }
  72. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  73. {
  74.  
  75.     if(dialogid == CAR5)
  76.     {
  77.         if(response)
  78.         {
  79.             new vid = GetPlayerVehicleID(playerid);
  80.             GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  81.             SetVehicleParamsEx(vid,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
  82.             SendClientMessage(playerid, COLOR_GREEN, "Il tuo cofano2 è aperto!");
  83.         }
  84.         if(!response)
  85.         {
  86.             new vid = GetPlayerVehicleID(playerid);
  87.             GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  88.             SetVehicleParamsEx(vid,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
  89.             SendClientMessage(playerid, COLOR_RED, "Il tuo cofano2 è chiuso!");
  90.         }
  91.     }
  92.     if(dialogid == CAR6)
  93.     {
  94.         if(response)
  95.         {
  96.             new vid = GetPlayerVehicleID(playerid);
  97.             GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  98.             SetVehicleParamsEx(vid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
  99.             SendClientMessage(playerid, COLOR_BLUE, "Il tuo allarme è attivato!");
  100.         }
  101.         if(!response)
  102.         {
  103.             new vid = GetPlayerVehicleID(playerid);
  104.             GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  105.             SetVehicleParamsEx(vid,engine,lights,VEHICLE_PARAMS_OFF,doors,bonnet,boot,objective);
  106.             SendClientMessage(playerid, COLOR_RED, "Il tuo allarme è disattivato!");
  107.         }
  108.     }
  109.     if(dialogid == CAR7)
  110.     {
  111.         if(response)
  112.         {
  113.             new vid = GetPlayerVehicleID(playerid);
  114.             GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  115.             SetVehicleParamsEx(vid,engine,lights,alarm,VEHICLE_PARAMS_OFF,bonnet,boot,objective);
  116.             SendClientMessage(playerid, COLOR_BLUE, "Il tuo veicolo è chiuso!");
  117.         }
  118.         if(!response)
  119.         {
  120.             new vid = GetPlayerVehicleID(playerid);
  121.             GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  122.             SetVehicleParamsEx(vid,engine,lights,alarm,VEHICLE_PARAMS_ON,bonnet,boot,objective);
  123.             SendClientMessage(playerid, COLOR_BLUE, "Il tuo veicolo è aperto!");
  124.         }
  125.     }
  126.     if(dialogid == CAR2)
  127.     {
  128.         if(response)
  129.         {
  130.             new vid = GetPlayerVehicleID(playerid);
  131.             GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  132.             SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
  133.             SendClientMessage(playerid, COLOR_BLUE, "Il motore della tua auto è accesso!");
  134.         }
  135.         if(!response)
  136.         {
  137.             new vid = GetPlayerVehicleID(playerid);
  138.             GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  139.             SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
  140.             SendClientMessage(playerid, COLOR_GREEN, "Il motore della tua auto è spento!");
  141.         }
  142.     }
  143.     if(dialogid == CAR3)
  144.     {
  145.         if(response)
  146.         {
  147.             new vid = GetPlayerVehicleID(playerid);
  148.             GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  149.             SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
  150.             SendClientMessage(playerid, COLOR_BLUE, "I fari tua auto sono accessi!");
  151.         }
  152.         if(!response)
  153.         {
  154.             new vid = GetPlayerVehicleID(playerid);
  155.             GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  156.             SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
  157.             SendClientMessage(playerid, COLOR_RED, "I fari della tuo auto sono spenti! ");
  158.         }
  159.     }
  160.     if(dialogid == CAR4)
  161.     {
  162.         if(response)
  163.         {
  164.             new vid = GetPlayerVehicleID(playerid);
  165.             GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  166.             SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
  167.             SendClientMessage(playerid, COLOR_RED, "Apri il cofano della tua auto!");
  168.         }
  169.         if(!response)
  170.         {
  171.             new vid = GetPlayerVehicleID(playerid);
  172.             GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  173.             SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
  174.             SendClientMessage(playerid, COLOR_BLUE, "Chiudi il cofano della tua auto!");
  175.         }
  176.     }
  177.     if(dialogid == CAR1)
  178.     {
  179.         if(response)
  180.         {
  181.             if(listitem == 0)
  182.             {
  183.                 ShowPlayerDialog(playerid, CAR2, DIALOG_STYLE_MSGBOX, "Motore","Accendi/Spegni il motore delle tua auto.","Accendi","Spegni");
  184.             }
  185.             if(listitem == 1)
  186.             {
  187.                 ShowPlayerDialog(playerid, CAR3, DIALOG_STYLE_MSGBOX, "Fari","Accendi/Spegni i fari della tua auto! ","Accendi","Spegni");
  188.             }
  189.             if(listitem == 2)
  190.             {
  191.                 ShowPlayerDialog(playerid, CAR4, DIALOG_STYLE_MSGBOX, "Cofano","Apri/Chiudi il cofano della tua auto!","Open","Close");
  192.             }
  193.             if(listitem == 3)
  194.             {
  195.                 ShowPlayerDialog(playerid, CAR5, DIALOG_STYLE_MSGBOX, "Cofano2","Apri/Chiudi il cofano della tua auto!","Apri","Chiudi");
  196.             }
  197.             if(listitem == 4)
  198.             {
  199.                 ShowPlayerDialog(playerid, CAR6, DIALOG_STYLE_MSGBOX, "Allarme","Attiva/Disattiva l'allarme della tua auto!","Attiva","Disattiva");
  200.             }
  201.             if(listitem == 5)
  202.             {
  203.                 ShowPlayerDialog(playerid, CAR7, DIALOG_STYLE_MSGBOX, "Porte","Apri/Chiudi le porte della tua auto!","Chiudi","Apri");
  204.             }
  205.         }
  206.     }
  207.     return 1;
  208. }
  209.  
  210. // ---------- Xevo Auto byA Angix AnD Alex ------------------- //
Advertisement
RAW Paste Data Copied
Advertisement