Advertisement
Guest User

car name

a guest
Jul 11th, 2015
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. enum carData {
  2. carID,
  3. carExists,
  4. carModel,
  5. carOwner,
  6. Float:carPos[4],
  7. carColor1,
  8. carColor2,
  9. carPaintjob,
  10. carLocked,
  11. carMods[14],
  12. carImpounded,
  13. carImpoundPrice,
  14. carFaction,
  15. carWeapons[5],
  16. carAmmo[5],
  17. carVehicle,
  18. carSign[32]
  19. };
  20. ////////////////////
  21.  
  22. Car_GetCount(playerid)
  23. {
  24. new
  25. count = 0;
  26.  
  27. for (new i = 0; i != MAX_DYNAMIC_CARS; i ++)
  28. {
  29. if (CarData[i][carExists] && CarData[i][carOwner] == PlayerData[playerid][pID])
  30. {
  31. count++;
  32. }
  33. }
  34. return count;
  35. }
  36.  
  37. //////////////////////
  38. Car_IsOwner(playerid, carid)
  39. {
  40. if (!PlayerData[playerid][pLogged] || PlayerData[playerid][pID] == -1)
  41. return 0;
  42.  
  43. if ((CarData[carid][carExists] && CarData[carid][carOwner] != 0) && CarData[carid][carOwner] == PlayerData[playerid][pID])
  44. return 1;
  45.  
  46. return 0;
  47. }
  48. ////////////////////
  49. if (Car_IsOwner(playerid, id) || (PlayerData[playerid][pFaction] != -1 && CarData[id][carFaction] == GetFactionType(playerid)))
  50. {
  51. if (!CarData[id][carLocked])
  52. {
  53. CarData[id][carLocked] = true;
  54. Car_Save(id);
  55.  
  56. ShowPlayerFooter(playerid, "You have ~r~locked~w~ the vehicle!");
  57. PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
  58.  
  59. SetVehicleParamsEx(CarData[id][carVehicle], engine, lights, alarm, 1, bonnet, boot, objective);
  60. }
  61. else
  62. {
  63. CarData[id][carLocked] = false;
  64. Car_Save(id);
  65.  
  66. ShowPlayerFooter(playerid, "You have ~g~unlocked~w~ the vehicle!");
  67. PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
  68.  
  69. SetVehicleParamsEx(CarData[id][carVehicle], engine, lights, alarm, 0, bonnet, boot, objective);
  70. }
  71. }
  72. }
  73. else SendErrorMessage(playerid, "You are not in range of anything you can lock.");
  74. return 1;
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement