Advertisement
Guest User

Simple License Plate System

a guest
Jan 12th, 2013
766
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.62 KB | None | 0 0
  1. /*
  2. ======        ===  ======         ======       ====       ========      ============  =======
  3. =======       ===  === ===       === ===     ===  ===     ===   ====    ============  ========
  4. ===  ===      ===  ===  ===     ===  ===     ===  ===     ===    ====   ===           ===   ===
  5. ===   ===     ===  ===   ===   ===   ===    ===    ===    ===     ====  =====         ===   ====
  6. ===    ===    ===  ===    === ===    ===    ==========    ===     ====  ========      ===   ===
  7. ===     ===   ===  ===     =====     ===   ============   ===     ====  =====         =========
  8. ===      ===  ===  ===               ===   ===      ===   ===    ====   ===           =======
  9. ===       =======  ===               ===  ===        ===  ===   ====    ============  === ====
  10. ===        ======  ===               ===  ===        ===  ========      ============  ===  ====
  11. */
  12. #define FILTERSCRIPT
  13. #include <a_samp>
  14.  
  15. #if defined FILTERSCRIPT
  16.  
  17. new PlatePossible[][] ={"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};
  18.  
  19. forward SpawnPlates(vehicleid);
  20.  
  21. public OnFilterScriptInit()
  22. {
  23.     print("\n--------------------------------------");
  24.     print(" Simple License Plate System by Nmader");
  25.     print("--------------------------------------\n");
  26.     SetTimer("SpawnPlates", 1000, false);
  27.     return 1;
  28. }
  29.  
  30. public OnFilterScriptExit()
  31. {
  32.     return 1;
  33. }
  34. #endif
  35.  
  36. public OnVehicleSpawn(vehicleid)
  37. {
  38.     //NOTE: IN ORDER TO GET THREE+ DIGIT NUMBERS IN YOUR LICENSE PLATES UNCOMMENT THE LINES BELOW AND MAKE THE TRADITIONAL POSSIBILITY A COMMENT!
  39.     new string[128];
  40.     new randdr = random(sizeof(PlatePossible));
  41.     //===================================[Three+ Digit Number Plates]=======================/
  42.     if(vehicleid <= 0 && vehicleid <= 873)
  43.     {
  44.         new calculation = vehicleid += 126;
  45.         format(string, sizeof(string), "%s%s%s %d", PlatePossible[randdr], PlatePossible[randdr], PlatePossible[randdr], calculation);
  46.     }
  47.     if(vehicleid > 873)
  48.     {
  49.         new calculation = vehicleid -= 827; // If you have a vehicle ID of 1965 the calculation will read the three numbers
  50.         format(string, sizeof(string), "%s%s%s %d", PlatePossible[randdr], PlatePossible[randdr], PlatePossible[randdr], calculation);
  51.     }
  52.     //===================================[TRADITIONAL LICENSE PLATE NUMBERS]================/
  53.     /*format(string, sizeof(string), "%s%s%s %d", PlatePossible[randdr], vehicleid); //traditional Example: AVIF [VEHICLE ID]
  54.     SetVehicleNumberPlate(vehicleid, string);*/
  55.     return 1;
  56. }
  57.  
  58. public SpawnPlates(vehicleid)
  59. {
  60.     for(new i=1; i<MAX_VEHICLES; i++)
  61.     {
  62.         SetVehicleToRespawn(i);
  63.     }
  64.     return 1;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement