Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.46 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3.  
  4.  
  5. //NEW
  6. new Pizza[MAX_PLAYERS];
  7.  
  8. //CORES
  9. #define Vermelho 0xF60000AA
  10. #define Amarelo 0xFFA500AA
  11.  
  12.  
  13.  
  14.  
  15. //Random
  16. new Float: CheckPointsP[11][10] =
  17. {
  18. {2495.0688,-1681.3324,13.3388, 3.0},
  19. {2361.8752,-1656.0962,13.3823, 3.0},
  20. {2098.6462,-1296.8459,23.5474, 3.0},
  21. {1343.8706,-1066.8330,25.7208, 3.0},
  22. {1258.5720,-1075.5701,27.6053, 3.0},
  23. {1086.2402,-1094.2687,25.0111, 3.0},
  24. {993.4932,-1042.5382,30.3029, 3.0},
  25. {321.8023,-1190.8622,76.0567, 3.0},
  26. {261.6847,-1328.1899,52.8384, 3.0},
  27. {852.6542,-1409.2745,12.8647, 3.0},
  28. {892.4968,-1648.3091,13.2740, 3.0}
  29. };
  30.  
  31. public OnGameModeInit()
  32. {
  33. AddStaticVehicleEx(448,2098.090820,-1821.328002,12.983078,89.726402,3,3,30); // Entregador de pizza
  34. return 1;
  35. }
  36.  
  37.  
  38. public OnPlayerRequestClass(playerid, classid)
  39. {
  40. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  41. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  42. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  43. return 1;
  44. }
  45.  
  46. public OnFilterScriptExit()
  47. {
  48. return 1;
  49. }
  50.  
  51.  
  52. public OnPlayerConnect(playerid)
  53. {
  54. Pizza[playerid] = 0;
  55. return 1;
  56. }
  57.  
  58. public OnPlayerEnterRaceCheckpoint(playerid)
  59. {
  60. if(Pizza[playerid] == 1)
  61. {
  62. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
  63. {
  64. SetTimer("EntregarPizza", 10000, false);
  65. TogglePlayerControllable(playerid,0);
  66. SendClientMessage(playerid,Amarelo,"| INFO | Entregando Pizza, aguarde alguns segundos");
  67. }else return SendClientMessage(playerid,Vermelho,"| ERRO | Você não esta com a moto do MotoBoy");
  68. }
  69. return 1;
  70. }
  71.  
  72.  
  73.  
  74.  
  75. CMD:ir(playerid, params[])
  76. {
  77. SetPlayerPos(playerid,2094.7395,-1817.1388, 13.3828);
  78. return 1;
  79. }
  80.  
  81.  
  82. CMD:pizza(playerid, params[])
  83. {
  84. if(Pizza[playerid] == 1) {
  85. SendClientMessage(playerid,Vermelho,"| ERRO | Você já pegou uma pizza, entregue-a!");
  86. return 1;
  87. }
  88. if(IsPlayerInRangeOfPoint(playerid, 10.0, 2094.7395,-1817.1388, 13.3828))
  89. {
  90. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
  91. {
  92. new string[128];
  93. new rand = random(sizeof(CheckPointsP));
  94. Pizza[playerid] = 1;
  95. new Float: Distancia = GetPlayerDistanceFromPoint(playerid,CheckPointsP[rand][0],CheckPointsP[rand][1],CheckPointsP[rand][2]);
  96. SetPlayerRaceCheckpoint(playerid, 1, CheckPointsP[rand][0],CheckPointsP[rand][1],CheckPointsP[rand][2], 0, 0, 0, 3.10);
  97. format(string,sizeof(string),"{FFFFFF}Uma pizza para entregar a {30F72D}%0.2f {FFFFFF}metros ,siga o checkpoint",Distancia);
  98. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "{FFA500}Pizzaria", string, "Pegar", "");
  99. return 1;
  100. }
  101. else return SendClientMessage(playerid, Vermelho,"| ERRO | Você não esta na moto do MotoBoy");
  102. }
  103. else return SendClientMessage(playerid,Vermelho,"| ERRO | Você não esta no local de pegar a pizza");
  104. }
  105.  
  106. forward EntregarPizza(playerid);
  107. public EntregarPizza(playerid)
  108. {
  109. new string[250];
  110. new GranaPizza = random(30);
  111. new Gorjeta = random(5);
  112. DisablePlayerRaceCheckpoint(playerid);
  113. Pizza[playerid] = 0;
  114. format(string, sizeof(string), "| PIZZA - ENTREGUE | {FFFFFF}Você entregou a pizza com sucesso e ganhou {1CEB00}$%d {FFFFFF}e mais {1CEB00}$%d {FFFFFF}de gorjeta",GranaPizza,Gorjeta);
  115. SendClientMessage(playerid,0xFFA500AA, string);
  116. GivePlayerMoney(playerid, GranaPizza);
  117. GivePlayerMoney(playerid, Gorjeta);
  118. TogglePlayerControllable(playerid,1);
  119. return 1;
  120. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement