Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 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. }
  11. return 1;
  12. }
  13.  
  14. id = InRangeOfHouse(playerid);
  15. if(id != 0)
  16. {
  17. if(Character[playerid][House] == id)
  18. {
  19. if(Houses[id][Locked] == 0)
  20. {
  21. format(str, sizeof(str), "* %s places the key in the door, locking it.*", GetRoleplayName(playerid), str);
  22. SendLocalMessage(playerid, str, Range_Short, COLOR_RP, COLOR_RP);
  23. Houses[id][Locked] = 1;
  24. MYSQL_Update_Interger(Houses[id][SQLID], "Houses", "Locked", 1);
  25. return 1;
  26. }
  27. else
  28. {
  29. format(str, sizeof(str), "* %s places the key in the door, unlocking it.*", GetRoleplayName(playerid), str);
  30. SendLocalMessage(playerid, str, Range_Short, COLOR_RP, COLOR_RP);
  31. Houses[id][Locked] = 0;
  32. MYSQL_Update_Interger(Houses[id][SQLID], "Houses", "Locked", 0);
  33. return 1;
  34. }
  35. }
  36. }
  37.  
  38. id = InRangeOfBiz(playerid);
  39. if(id != 0)
  40. {
  41. if(Character[playerid][Business_1] == id || Character[playerid][Business_2] == id)
  42. {
  43. if(Business[id][Locked] == 0)
  44. {
  45. format(str, sizeof(str), "* %s places the key in the door, locking it.*", GetRoleplayName(playerid), str);
  46. SendLocalMessage(playerid, str, Range_Short, COLOR_RP, COLOR_RP);
  47. Business[id][Locked] = 1;
  48. MYSQL_Update_Interger(Houses[id][SQLID], "Business", "Locked", 1);
  49. return 1;
  50. }
  51. else
  52. {
  53. format(str, sizeof(str), "* %s places the key in the door, unlocking it.*", GetRoleplayName(playerid), str);
  54. SendLocalMessage(playerid, str, Range_Short, COLOR_RP, COLOR_RP);
  55. MYSQL_Update_Interger(Houses[id][SQLID], "Business", "Locked", 1);
  56. Business[id][Locked] = 0;
  57. return 1;
  58. }
  59. }
  60. }
  61.  
  62. return 0;
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement