Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. CMD:lock(playerid, params[])
  2. {
  3. new str[128], id = GetNearestVehicle(playerid, 5.0);
  4. if(id != INVALID_VEHICLE_ID)
  5. {
  6. if(Vehicles[id][Locked] == 0)
  7. {
  8. SetVehicleParamsEx(id, Engine[id], Lights[id], alarm[id], 1, bonnet[id], boot[id], objective[id]);
  9. doors[id] = 1;
  10. format(str, sizeof(str), "* %s locked the car door.*", GetRoleplayName(playerid), str);
  11. SendLocalMessage(playerid, str, Range_Short, COLOR_RP, COLOR_RP);
  12. }
  13. if(Vehicles[id][Locked] == 1)
  14. {
  15. SetVehicleParamsEx(id, Engine[id], Lights[id], alarm[id], 1, bonnet[id], boot[id], objective[id]);
  16. doors[id] = 0;
  17. format(str, sizeof(str), "* %s unlocked the car door.*", GetRoleplayName(playerid), str);
  18. SendLocalMessage(playerid, str, Range_Short, COLOR_RP, COLOR_RP);
  19. }
  20. return 1;
  21. }
  22.  
  23. id = InRangeOfHouse(playerid);
  24. if(id != 0)
  25. {
  26. if(Character[playerid][House] == id)
  27. {
  28. if(Houses[id][Locked] == 0)
  29. {
  30. format(str, sizeof(str), "* %s places the key in the door, locking it.*", GetRoleplayName(playerid), str);
  31. SendLocalMessage(playerid, str, Range_Short, COLOR_RP, COLOR_RP);
  32. Houses[id][Locked] = 1;
  33. MYSQL_Update_Interger(Houses[id][SQLID], "Houses", "Locked", 1);
  34. return 1;
  35. }
  36. else
  37. {
  38. format(str, sizeof(str), "* %s places the key in the door, unlocking it.*", GetRoleplayName(playerid), str);
  39. SendLocalMessage(playerid, str, Range_Short, COLOR_RP, COLOR_RP);
  40. Houses[id][Locked] = 0;
  41. MYSQL_Update_Interger(Houses[id][SQLID], "Houses", "Locked", 0);
  42. return 1;
  43. }
  44. }
  45. }
  46.  
  47. id = InRangeOfBiz(playerid);
  48. if(id != 0)
  49. {
  50. if(Character[playerid][Business_1] == id || Character[playerid][Business_2] == id)
  51. {
  52. if(Business[id][Locked] == 0)
  53. {
  54. format(str, sizeof(str), "* %s places the key in the door, locking it.*", GetRoleplayName(playerid), str);
  55. SendLocalMessage(playerid, str, Range_Short, COLOR_RP, COLOR_RP);
  56. Business[id][Locked] = 1;
  57. MYSQL_Update_Interger(Houses[id][SQLID], "Business", "Locked", 1);
  58. return 1;
  59. }
  60. else
  61. {
  62. format(str, sizeof(str), "* %s places the key in the door, unlocking it.*", GetRoleplayName(playerid), str);
  63. SendLocalMessage(playerid, str, Range_Short, COLOR_RP, COLOR_RP);
  64. MYSQL_Update_Interger(Houses[id][SQLID], "Business", "Locked", 1);
  65. Business[id][Locked] = 0;
  66. return 1;
  67. }
  68. }
  69. }
  70.  
  71. return 0;
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement