Advertisement
slenderm48

Pizza Boy

Jul 4th, 2015
701
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.99 KB | None | 0 0
  1. - Tìm dòng OnPlayerUpdate rồi add phía dưới
  2.  
  3. if(GetPVarInt(playerid, "Pizza") > 0 && IsPlayerInRangeOfPoint(playerid, 18.0, HouseInfo[GetPVarInt(playerid, "Pizza")][hExteriorX], HouseInfo[GetPVarInt(playerid, "Pizza")][hExteriorY], HouseInfo[GetPVarInt(playerid, "Pizza")][hExteriorZ]))
  4. {
  5. new vehicleid = GetPlayerVehicleID(playerid);
  6. if(IsPlayerInAnuVehicle(playerid && GetPVarInt(playerid, "DenDichXuongXe") == 0)
  7. {
  8. // new vehicleid = GetPlayerVehicleID(playerid);
  9. new lights,alarm,bonnet,objective;
  10. new Float:vehx, Float:vehy, Float:vehz;
  11. SetPVarInt(playerid, "XePizza",vehicleid);
  12. SetVehiclePos(vehicleid, vehx, vehy, vehz);
  13. SetVehiclePos(vehicleid, vehx, vehy, vehz);
  14. SetVehicleParamsEx(GetPVarInt(playerid, "XePizza"),VEHICLE_PARAMS_OFF,lights,alarm,1,bonnet,0,objective);
  15. RemovePlayerFromVehicle(playerid);
  16. GameTextForPlayer(playerid, "~w~An nut ~r~Y~w~ de lay banh.", 6000, 5);
  17. SetPVarInt(playerid, "DenDichXuongXe", 1);
  18. return 1;
  19. }
  20. }
  21.  
  22. - Tìm tiếp dòng if(GetPVarType(playerid, "Pizza") && !(IsAPizzaCar(vehicleid)))
  23.  
  24. if(GetPVarInt(playerid, "Pizza"))
  25. {
  26. if(!IsAPizzaCar(vehicleid) && GetPVarInt(playerid, "DenDichXuongXe") == 0)
  27. {
  28. new Float:slx, Float:sly, Float:slz;
  29. GetPlayerPos(playerid, slx, sly, slz);
  30. SetPlayerPos(playerid, slx, sly, slz+1.3);
  31. PlayerPlaySound(playerid, 1130, slx, sly, slz+1.3);
  32. RemovePlayerFromVehicle(playerid);
  33. SendClientMessageEx(playerid, COLOR_GRAD2, "Ban can o PizzaBoy khi cung cap banh pizza!");
  34. return 1;
  35. }
  36. }
  37.  
  38. - Tìm tiếp dòng Pizza Delivery
  39.  
  40. if(GetPVarInt(playerid, "Pizza") > 0 && IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[GetPVarInt(playerid, "Pizza")][hExteriorX], HouseInfo[GetPVarInt(playerid, "Pizza")][hExteriorY], HouseInfo[GetPVarInt(playerid, "Pizza")][hExteriorZ]) && GetPlayerInterior(playerid) == HouseInfo[GetPVarInt(playerid, "Pizza")][hExtIW] && GetPlayerVirtualWorld(playerid) == HouseInfo[GetPVarInt(playerid, "Pizza")][hExtVW])
  41. {
  42. new string[128],lights,alarms,bonnet,objective;
  43. if (GetPVarInt(playerid, "tpPizzaTimer") != 0)
  44. {
  45. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly teleport pizzarunning.", GetPlayerNameEx(playerid), playerid);
  46. ABroadCast( COLOR_YELLOW, string, 2 );
  47. // format(string, sizeof(string), "%s (ID %d) is possibly teleport pizzarunning.", GetPlayerNameEx(playerid), playerid);
  48. // Log("logs/hack.log",string);
  49. }
  50. format(string, sizeof(string), "Ban da giao banh pizza thanh cong! Ban nhan duoc $%d.", (GetPVarInt(playerid, "pizzaTimer") * 70));
  51. Misc_Save();
  52. GivePlayerCash(playerid, floatround((GetPVarInt(playerid, "pizzaTimer") * 70), floatround_round));
  53. SendClientMessageEx(playerid, COLOR_WHITE, string);
  54. DeletePVar(playerid, "Pizza");
  55. DisablePlayerCheckPoint(playerid);
  56. RemovePlayerAttachedObject(playerid, 0);
  57. SetVehicleParamsEx(GetPVarInt(playerid, "XePizza"),VEHICLE_PARAMS_OFF,lights,alarm,0,bonnet,0,objective);
  58. DeletePVar(playerid, "Pizza");
  59. DeletePVar(playerid, "DaLayBanh");
  60. DeletePVar(playerid, "XePizza");
  61. DeletePVar(playerid, "DenDichXuongXe");
  62. }
  63.  
  64. - Tìm tiếp cmd:laybanh
  65.  
  66. - Ở đây mình làm bánh /lqybanh LS, các bạn lấy ý rồi add nhé.
  67.  
  68. cmd:laybanh(playerid, params[])
  69. {
  70. if(PlayeridInfo[playerid][pJob] == 21 || PlayerInfo[playerid][pJob2] == 21)
  71. {
  72. if(!GetPVarType(playerid, "Pizza"))
  73. {
  74. if(IsPlayerInAnyVehicle(playerid))
  75. {
  76. if(IsPlayerInRangeOfPoint(playerid, 3.0, 2092.5635, -1802.7292, 13.5488))
  77. {
  78. if(GetPlayerSkin(playerid) != 155)
  79. {
  80. SendClientMessageEx(playerid, COLOR_YELLOW, "Ban khong mac quan ao Pizza Boy khong the lam viec.");
  81. return 1;
  82. }
  83. if(!IsAPizzaCar(GetPlayerVehicleID(playerid)))
  84. {
  85. SendClientMessageEx(playerid, COLOR_YELLOW, "Ban khong chay Pizza Stack khong the lam viec.");
  86. return 1;
  87. }
  88. new rand = random(30);
  89. while(!(HouseInfo[rand][hExteriorZ] <= 100 && HouseInfo[rand][hExteriorX] > 159.6704 && HouseInfo[rand][hExteriorX] < 2881.3550 && HouseInfo[rand][hExteriorY] < - 1221.3380 && HouseInfo[rand][hExteriorY] > -1766.5830)) {
  90. if(++rand >= 30) {
  91. rand = 1;
  92. }
  93. }
  94.  
  95. new
  96. iDist = floatround(GetPlayerDistanceFromPoint(playerid, HouseInfo[rand][hExteriorX], HouseInfo[rand][hExteriorY], HouseInfo[rand][hExteriorZ])),
  97. szMessage[512];
  98.  
  99. SetPVarInt(playerid, "tpPizzaTimer", iDist / 80);
  100. SetPVarInt(playerid, "pizzaTotal", iDist / 10);
  101. SetPVarInt(playerid, "pizzaTimer", iDist / 10);
  102. SetPVarInt(playerid, "Pizza", rand);
  103.  
  104. SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPPIZZARUNTIMER);
  105. SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_PIZZATIMER);
  106. SetPVarInt(playerid, "DaLayBanh", 1);
  107. format(szMessage, sizeof(szMessage), "Ban da nhan duoc banh Pizza va giao cho %s. Ban co %d giay de thuc hien!", StripUnderscore(HouseInfo[rand][hOwnerName]), iDist / 10);
  108. SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
  109.  
  110. SetPlayerCheckPoint(playerid, HouseInfo[rand][hExteriorX], HouseInfo[rand][hExteriorY], HouseInfo[rand][hExteriorZ], 5);
  111. }
  112. }
  113. else return SendClientMessageEx(playerid, COLOR_WHITE,"Ban dang cung cap pizza.");
  114. }
  115. else return SendClientMessageEx(playerid, COLOR_WHITE,"Ban phai o tren xe de lay banh.");
  116. }
  117. else return SendClientMessageEx(playerid, COLOR_WHITE,"Ban khong phai la PizzaBoy.");
  118. return 1;
  119. }
  120.  
  121. - Tìm tiếp dòng OnPlayerKeyStateChange
  122.  
  123. if(newkeys & KEY_YES && GetPVarInt(playerid, "DaLayBanh") == 1)
  124. {
  125. if(IsPlayerInRangeOfPoint(playerid, 20.0, HouseInfo[GetPVarInt(playerid, "Pizza")][hExteriorX], HouseInfo[GetPVarInt(playerid, "Pizza")][hExteriorY], HouseInfo[GetPVarInt(playerid, "Pizza")][hExteriorZ]))
  126. {
  127. if(!IsPlayerInAnyVehicle(playerid))
  128. {
  129. if(GetPlayerSkin(playerid) == 155)
  130. {
  131. SetPlayerAttachedObject(playerid, 0, 1582, 5, 0.219000, 0.000000, 0.145000, -82.599922, 0.000000, 102.000038, 1.000000, 1.000000, 1.000000, 0, 0);
  132. ApplyAnimation(playerid,"CARRY","crry_prtial",4.1,1,0,0,1,1);
  133. SendClientMessageEx(playerid, COLOR_GRAD1,"He Thong: Hay xuong xe va su dung nut Y de lay banh ra khoi xe.");
  134. SetPVarInt(playerid,"DaLayBanh", 2);
  135. return 1;
  136. }
  137. else
  138. {
  139. SendClientMessageEx(playerid, COLOR_GRAD1:"He Thong: Ban khong mac trang phuc cua nguoi dua banh.");
  140. }
  141. }
  142. else return SendClientMessageEx(playerid, COLOR_GRAD1:"He Thong: Ban can phai xuong xe moi co the lay banh ra xe.");
  143. }
  144. else return SendClientMessageEx(playerid, COLOR_GRAD1:"He Thong: Ban can phai trong khoang cach 20 met voi muc tieu giao Pizza de lay banh.");
  145. }
  146.  
  147. - Lưu ý, mình không làm Filescipt nhé, add thẳng vào Model nhé.
  148.  
  149. - Chúc các bạn thành công.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement