Advertisement
Guest User

JOB CONSTRUCTOR v2

a guest
Apr 29th, 2014
2,841
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.67 KB | None | 0 0
  1. // cretids DuMBaSS
  2. ////Editado by
  3. //vegaltasendailadies
  4. #include <a_samp>
  5.  
  6. new PlayerInJob[MAX_PLAYERS];
  7. new Constructor[MAX_PLAYERS];
  8. new Mescla[MAX_PLAYERS];
  9. new obrero1;
  10. new obrero2;
  11. new obrero3;
  12. new Oldskin2[MAX_PLAYERS];
  13. new carConstructor[2];
  14.  
  15. #define COLOR_RED 0xAA3333AA
  16. #define COLOR_SYSTEM 0xEFEFF7AA
  17. #define COLOR_LIGHTBLUE 0x33CCFFAA
  18.  
  19. #pragma tabsize 0
  20.  
  21.  
  22.  
  23. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  24. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  25. {
  26. if(IsPlayerConnected(playerid))
  27. {
  28. new Float:oldposx, Float:oldposy, Float:oldposz;
  29. new Float:tempposx, Float:tempposy, Float:tempposz;
  30. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  31. tempposx = (oldposx -x);
  32. tempposy = (oldposy -y);
  33. tempposz = (oldposz -z);
  34.  
  35. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  36. {
  37. return 1;
  38. }
  39. }
  40. return 0;
  41. }
  42.  
  43. public OnFilterScriptInit()
  44. {
  45. //los amdamios
  46. ///doety construccion job
  47. CreateObject(16317, -2045.42285, 250.05060, 33.69996, 0.00000, 0.00000, 105.12000);//grave y mescla
  48. CreateObject(11010, -2047.59314, 303.24390, 40.13972, 0.00000, 0.00000, 0.00000);
  49. CreateObject(9618, -2027.27527, 298.45770, 45.48360, 0.00000, 0.00000, 273.00000);
  50. CreateObject(9817, -2027.48059, 298.37659, 45.52235, 0.00000, 0.00000, -86.00000);
  51. ///casita
  52. CreateObject(9361, -2073.34326, 213.05653, 37.10638, 0.00000, 0.00000, 135.00000);
  53. CreateObject(15037, -2071.09814, 213.46312, 34.94680, 0.00000, 0.00000, 168.00000);
  54. CreateObject(1702, -2075.02783, 210.67334, 34.60570, 0.00000, 0.00000, 178.00000);
  55. CreateObject(2196, -2070.44556, 213.99489, 35.35581, 0.00000, 0.00000, 0.00000);
  56. CreateObject(2894, -2071.00391, 213.10210, 35.36160, 0.00000, 0.00000, 0.00000);
  57. CreateObject(2200, -2069.70093, 210.68997, 34.74070, 0.00000, 0.00000, 179.00000);
  58. CreateObject(2427, -2072.33569, 210.11861, 34.73150, 0.00000, 0.00000, 178.00000);
  59. CreateObject(1736, -2072.43555, 210.34270, 36.43350, 0.00000, 0.00000, 175.00000);
  60. CreateObject(1819, -2075.87964, 211.95470, 34.73410, 0.00000, 0.00000, 0.00000);
  61. CreateObject(1702, -2077.42334, 214.09639, 34.60570, 0.00000, 0.00000, 0.00000);
  62. CreateObject(2690, -2074.00488, 209.93336, 36.25890, 0.00000, 0.00000, 91.00000);
  63. CreateObject(3472, -2075.48340, 215.85941, 34.92170, 0.00000, 0.00000, 40.00000);
  64.  
  65. ///tablas barrera y demas
  66. CreateObject(17050, -2028.33936, 302.11938, 29.95620, 0.00000, 0.00000, 280.00000);
  67. CreateObject(17050, -2017.46155, 303.11719, 34.00740, 0.00000, 0.00000, 280.00000);
  68. ///////
  69. obrero1 = CreatePickup(1239, 23, -2070.4971,211.5426,35.7314, -1);////te pones uniforme y empiezas
  70. obrero2 = CreatePickup(1239, 23, -2073.0662,210.3388,35.7314, -1);///tequitas uniforme
  71. obrero3 = CreatePickup(1239, 23, 2182.0974121094,-2252.8625488281,14.7734375, -1);///letrero de bienvenida en la entrada llegando a la obra
  72. Create3DTextLabel("[Aqui pides empleo y te pones uniforme",0x0000FFAA,-2073.0662,210.3388,35.7314,20.0,0, 1);
  73. Create3DTextLabel("[Entregas uniforme y recibir paga aqui",0x0000FFAA,-2070.4971,211.5426,35.7314,20.0,0, 1);
  74. Create3DTextLabel("Bienvenidos a obreros SA pasa a la oficina para pedir empleo",0x0000FFAA,-2035.3964,231.3907,35.0084,20.0,0, 1);
  75. carConstructor[0] = AddStaticVehicleEx(486, -2087.9299, 261.1356, 35.9089, 309.0000, -1, -1, 100);//borren ya que cualquiera puede suar
  76. carConstructor[1] = AddStaticVehicleEx(524, -2088.8799, 250.3840, 36.6111, 0.0000, -1, -1, 100);///estos dos vehiculos o agregen segun su gm
  77.  
  78. return 1;
  79. }
  80.  
  81. public OnPlayerDisconnect(playerid, reason)
  82. {
  83. PlayerInJob[playerid] = 0;
  84. Mescla[playerid] = 0;
  85. Constructor[playerid] = 0;
  86. Oldskin2[playerid] = 0;
  87. return 1;
  88. }
  89.  
  90. public OnPlayerUpdate(playerid)
  91. {
  92.  
  93. new animlib[32];
  94. new animname[32];
  95.  
  96. if(Mescla[playerid] == 1 && !PlayerToPoint(2.0,playerid,-2048.0684,256.7028,35.6630)){///aca recojes la mescla
  97. GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
  98. if(strcmp(animname, "IDLE_STANCE", true) != 0 && strcmp(animname, "RUN_CIVI", true) != 0 && strcmp(animname, "WALK_CIVI", true) != 0 && strcmp(animname, "crry_prtial", true) != 0 && strcmp(animname, "SPRINT_PANIC", true) != 0 && strcmp(animname, "RUN_PLAYER", true) != 0 && strcmp(animname, "WALK_PLAYER", true) != 0 && strcmp(animname, "SPRINT_CIVI", true) != 0){
  99. Mescla[playerid] = 0;
  100. SendClientMessage(playerid, COLOR_RED, "Has tirado la mescla,Regresa donde la tomaste,se te desconto un 10%!");
  101. if(IsPlayerAttachedObjectSlotUsed(playerid,2)) RemovePlayerAttachedObject(playerid,2);///esto esta bien
  102. ApplyAnimation(playerid,"CARRY","crry_prtial",4.1,0,1,1,0,1);
  103. SetPlayerCheckpoint(playerid,-2048.0684,256.7028,35.6630,2.0);///aca el checkpint recojes mescla
  104. }
  105. }
  106. return 1;
  107. }
  108.  
  109.  
  110. public OnPlayerPickUpPickup(playerid, pickupid)
  111. {
  112. if(pickupid == obrero1) {
  113. ShowPlayerDialog(playerid,102,DIALOG_STYLE_MSGBOX,"Quieres","Trabajar aqui?","Si","No");
  114. }
  115.  
  116. if(pickupid == obrero2) {
  117. ShowPlayerDialog(playerid,103,DIALOG_STYLE_MSGBOX,"Terminas","El turno? Recibiras tu paga","Si","No");
  118. }
  119.  
  120. if(pickupid == obrero3) {
  121. ShowPlayerDialog(playerid,104,DIALOG_STYLE_MSGBOX,"Aviso","1. Este trabajo consiste en\n2. Recojer mescla y\n3. Llevarla arriba de la obra\n4. Si se te cae uno bote de mescla\nTendras que ir por otro","Suerte","");
  122. }
  123. return 1;
  124. }
  125.  
  126. public OnPlayerEnterCheckpoint(playerid)
  127. {
  128. new string[256];
  129. if(PlayerToPoint(2.0, playerid,-2048.0684,256.7028,35.6630))///igual recojes mesclas
  130. {
  131. Mescla[playerid] = 1;
  132. ApplyAnimation(playerid,"CARRY","crry_prtial",4.1,0,1,1,1,1);//revisado que esta bien
  133. SetPlayerAttachedObject(playerid, 2, 1329, 1,0.20,0.36,0.0,0.0,90.0, 0.0, 0.4, 0.3, 0.6);
  134. SetPlayerCheckpoint(playerid,-2019.7251,303.4937,54.9075,2.0);///aca entregas las mesclas
  135.  
  136. } ////-2020.4305, 303.4898, 54.2458
  137.  
  138. if(PlayerToPoint(2.0, playerid,-2019.7251,303.4937,54.9075))///entregas mesclas
  139. {
  140. Mescla[playerid] = 0;
  141. ///RemovePlayerAttachedObject(playerid,1);
  142. //ApplyAnimation(playerid,"CARRY","putdwn",4.1,0,1,1,1,1);/// falla algo de la animacion
  143. ApplyAnimation(playerid,"CARRY","putdwn",1,0,0,0,0,0);
  144. Constructor[playerid]++;
  145. if(IsPlayerAttachedObjectSlotUsed(playerid,2)) RemovePlayerAttachedObject(playerid,2);
  146. format(string, sizeof(string), "Entregaste la mescla ve por mas {A52A2A}%d",Constructor[playerid]);
  147. SendClientMessage(playerid, COLOR_SYSTEM, string);
  148. SetPlayerCheckpoint(playerid,-2048.0684,256.7028,35.6630,2.0);///recojes otra vez mas
  149.  
  150. }
  151.  
  152. return 1;
  153. }
  154.  
  155.  
  156. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  157. {
  158.  
  159. if(dialogid == 103)
  160. {
  161. new string[128];
  162. if(response){
  163. if(!PlayerInJob[playerid]){
  164. SendClientMessage(playerid, COLOR_RED, "Terminaste la jornada");
  165. SendClientMessage(playerid, COLOR_RED, "Para volver a trabajar ve a ponerte el uniforme");
  166. return 1;
  167. }
  168. PlayerInJob[playerid] = 0;
  169. SetPlayerSkin(playerid, Oldskin2[playerid]);
  170. DisablePlayerCheckpoint(playerid);
  171. GivePlayerCash(playerid, Constructor[playerid]*50); //esto mdifiquen es el pago,tomen en cuenta que se les cae facil la mescla asi que un buen pago seria justo.
  172. format(string, sizeof(string), "{FFFAFA}Tu ganancia fue de {228B22}%d$ {FFFAFA}Ok? {A52A2A}%d {FFFAFA}Gracias por trabajar en esta empresa)",Constructor[playerid]*50,Constructor[playerid]);
  173. SendClientMessage(playerid, COLOR_SYSTEM, string);
  174. Constructor[playerid] = 0;
  175. }
  176. return 1;
  177. }
  178.  
  179. if(dialogid == 102)
  180. {
  181. if(response){
  182. if(PlayerInJob[playerid]){
  183. SendClientMessage(playerid, COLOR_RED, "Ve afuera");
  184. SendClientMessage(playerid, COLOR_RED, "Ya eres empleado");
  185. return 1;
  186. }
  187. PlayerInJob[playerid] = 1;
  188. Oldskin2[playerid] = GetPlayerSkin(playerid);
  189. SetPlayerSkin(playerid, 260);
  190. SetPlayerCheckpoint(playerid,-2048.0684,256.7028,35.6630,2.0);////recojes mas xd
  191. SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ve por mesclas para empezar a trabajar");
  192. SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ya tienes el uniforme y empleo ve afuera a trabajar");
  193. }
  194. return 1;
  195. }
  196. return 1;
  197. }
  198. //============[Stock]==========
  199. stock GivePlayerCash(playerid, money)
  200. {
  201. SetPVarInt(playerid, "Cash", GetPVarInt(playerid, "Cash")+money);
  202. GivePlayerMoney(playerid, money);
  203. return 1;
  204. }
  205.  
  206. stock ResetPlayerCash(playerid)
  207. {
  208. SetPVarInt(playerid, "Cash", 0);
  209. return 1;
  210. }
  211.  
  212. // (c)DuMBaSS All rights reserved
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement