Advertisement
Guest User

.:: Sistema de Prêmios - [KoS]Shickcard ::.

a guest
Jul 31st, 2011
735
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.54 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define MAXPLAYERS 40
  4.  
  5. #define CorVermelho 0xE31919FF
  6.  
  7. public OnFilterScriptInit()
  8. {
  9. print("\n--------------------------------------");
  10. print(" [FS] Sistema de Prêmios\n");
  11. print(" Desenvolvido por Shickcard\n");
  12. print("--------------------------------------\n");
  13. CreatePickup(1276, 1, 1960.5267,1342.8904,15.3746, 0);
  14. Create3DTextLabel("Prêmio\nPressione 'F' para pegar seu presente!", 0x9400D3FF, 1960.5267,1342.8904,15.3746, 40.0, 0);
  15. return 1;
  16. }
  17.  
  18. main()
  19. {
  20. print("\n----------------------------------");
  21. print(" [FS] Sistema de Prêmios\n");
  22. print(" Desenvolvido por Shickcard\n");
  23. print("----------------------------------\n");
  24. }
  25.  
  26. new SPremio[MAXPLAYERS];
  27. new PremioBloqueado;
  28. new Random;
  29.  
  30. public OnPlayerConnect(playerid)
  31. {
  32. SPremio[playerid] = 0;
  33. return 1;
  34. }
  35.  
  36. public OnPlayerDisconnect(playerid, reason)
  37. {
  38. SPremio[playerid] = 0;
  39. return 1;
  40. }
  41.  
  42. public OnPlayerCommandText(playerid, cmdtext[])
  43. {
  44. if(strcmp("/bloquearpremios", cmdtext, true) == 0)
  45. {
  46. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, CorVermelho, "(!) {FFFFFF}Você não é Admin!");
  47. if(PremioBloqueado == 0)
  48. {
  49. PremioBloqueado = 1;
  50. SendClientMessage(playerid, CorVermelho, "(!) {FFFFFF}Os Prêmios foram bloqueados com sucesso!");
  51. }
  52. else if(PremioBloqueado == 1)
  53. {
  54. PremioBloqueado = 0;
  55. SendClientMessage(playerid, CorVermelho, "(!) {FFFFFF}Os Prêmios foram desbloqueados com sucesso!");
  56. }
  57. return true;
  58. }
  59. if(strcmp("/creditosfs", cmdtext, true) == 0)
  60. {
  61. SendClientMessage(playerid, 0xFFD700FF, "~. Créditos [FS] .~");
  62. SendClientMessage(playerid, 0xEE7621FF, "- [KoS]Shickcard");
  63. return true;
  64. }
  65. return 0;
  66. }
  67.  
  68. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  69. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  70. {
  71. if(IsPlayerConnected(playerid))
  72. {
  73. new Float:oldposx, Float:oldposy, Float:oldposz, Float:tempposx, Float:tempposy, Float:tempposz;
  74. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  75. tempposx = (oldposx -x);
  76. tempposy = (oldposy -y);
  77. tempposz = (oldposz -z);
  78. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  79. {
  80. return 1;
  81. }
  82. }
  83. return 0;
  84. }
  85.  
  86. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  87. {
  88. new string[128];
  89. if(newkeys == 16 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  90. {
  91. if(IsPlayerInRangeOfPoint(playerid, 7.0, 1960.5267,1342.8904,15.3746))
  92. {
  93. new Dinheiro = 1000 + random(10000);
  94. if(SPremio[playerid] == 1) return SendClientMessage(playerid, -1, "Você já pegou seu prêmio no intervalo de 5 minutos!");
  95. if(PremioBloqueado != 1) return SendClientMessage(playerid, -1, "Prêmios bloqueados!");
  96. Random = random(14);
  97. if(Random == 0)
  98. {
  99. GivePlayerWeapon(playerid, 35, 999);
  100. format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 Bazuca", pNome(playerid));
  101. SendClientMessageToAll(CorVermelho ,string);
  102. SetTimerEx("Bazuca", 300000, false, "playerid", playerid);
  103. }
  104. if(Random == 1)
  105. {
  106. GivePlayerMoney(playerid, Dinheiro);
  107. format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}$%d", pNome(playerid), Dinheiro);
  108. SendClientMessageToAll(CorVermelho ,string);
  109. }
  110. else if(Random == 2)
  111. {
  112. SetPlayerHealth(playerid, 100);
  113. format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}100 de Health", pNome(playerid));
  114. SendClientMessageToAll(CorVermelho ,string);
  115. }
  116. else if(Random == 3)
  117. {
  118. SetPlayerArmour(playerid, 100);
  119. format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}100 de Colete", pNome(playerid));
  120. SendClientMessageToAll(CorVermelho ,string);
  121. }
  122. else if(Random == 4)
  123. {
  124. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT,".:: Prêmio - Veículo ::.","Seu prêmio foi um veículo insira o modelo na box:","Spawnar","Cancelar");
  125. format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 vale veículo", pNome(playerid));
  126. SendClientMessageToAll(CorVermelho ,string);
  127. }
  128. else if(Random == 5)
  129. {
  130. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT,".:: Prêmio - Armas ::.","Seu prêmio foi uma arma insira o modelo na box:","Armar-se","Cancelar");
  131. format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 arma", pNome(playerid));
  132. SendClientMessageToAll(CorVermelho ,string);
  133. }
  134. else if(Random == 6)
  135. {
  136. SetPlayerHealth(playerid, 100);
  137. SetPlayerArmour(playerid, 100);
  138. format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}100 de Health e 100 de Colete", pNome(playerid));
  139. SendClientMessageToAll(CorVermelho ,string);
  140. }
  141. else if(Random == 7)
  142. {
  143. SetPlayerSpecialAction(playerid, 2);
  144. format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 Jetpack", pNome(playerid));
  145. SendClientMessageToAll(CorVermelho ,string);
  146. }
  147. else if(Random == 8)
  148. {
  149. SetPlayerHealth(playerid, 99999);
  150. format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 vale invencibilidade por 10min", pNome(playerid));
  151. SendClientMessageToAll(CorVermelho ,string);
  152. SetTimerEx("Invencivel", 600000, false, "i", playerid);
  153. }
  154. else if(Random == 9)
  155. {
  156. format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 tapa", pNome(playerid));
  157. SendClientMessageToAll(CorVermelho ,string);
  158. new Float:pX, Float:pY, Float:pZ;
  159. GetPlayerPos(playerid, pX, pY, pZ);
  160. SetPlayerPos(playerid, pX, pY, pZ+12);
  161. }
  162. else if(Random == 10)
  163. {
  164. new Float:bX, Float:bY, Float:bZ;
  165. GetPlayerPos(playerid, bX, bY, bZ);
  166. CreateExplosion(bX, bY , bZ+3, 1, 3);
  167. format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 explosão", pNome(playerid));
  168. SendClientMessageToAll(CorVermelho ,string);
  169. }
  170. else if(Random == 11)
  171. {
  172. ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT,".:: Prêmio - Spec ::.","Seu prêmio foi ficar spec em um player por 1 min, Insira o ID do player e aperte em 'Spec' :","Spec","Cancelar");
  173. format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 spec", pNome(playerid));
  174. SendClientMessageToAll(CorVermelho ,string);
  175. }
  176. else if(Random == 12)
  177. {
  178. SetPlayerDrunkLevel(playerid, 5000);
  179. format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 minuto alcoolatra", pNome(playerid));
  180. SendClientMessageToAll(CorVermelho ,string);
  181. SetTimerEx("MinAlcoolatra", 60000, false, "i", playerid);
  182. }
  183. else if(Random == 13)
  184. {
  185. SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
  186. format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}1 Score", pNome(playerid));
  187. SendClientMessageToAll(CorVermelho ,string);
  188. }
  189. else if(Random == 14)
  190. {
  191. ShowPlayerDialog(playerid, 4, DIALOG_STYLE_INPUT,".:: Prêmio - Hora ::.","Seu prêmio foi ficar setar o seu horário no servidor :","Setar","Cancelar");
  192. format(string, sizeof(string), "Jogador: %s pegou seu Prêmio nele continha {FFE4E1}setar horário", pNome(playerid));
  193. SendClientMessageToAll(CorVermelho ,string);
  194. }
  195. SPremio[playerid] = 1;
  196. SetTimerEx("PremiosBlockedS", 300000, false, "i", playerid);
  197. }
  198. }
  199. return 1;
  200. }
  201.  
  202. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  203. {
  204. new string[65];
  205. if(dialogid == 1)
  206. {
  207. if(response)
  208. {
  209. new vehicleid = GetPlayerVehicleID(playerid);
  210. vehicleid = CreateVehicle(strval(inputtext), 1955.4830,1343.2509,15.3746, 40.5183, 1, 1, -1);
  211. PutPlayerInVehicle(playerid, vehicleid, 0);
  212. format(string, sizeof(string), "Você escolheu como veículo o modelo %d, Parabéns pela escolha!", strval(inputtext));
  213. SendClientMessage(playerid, CorVermelho, string);
  214. }
  215. else if(!response) return SendClientMessage(playerid, CorVermelho, "Você não quis resgatar um veículo!");
  216. }
  217. if(dialogid == 2)
  218. {
  219. if(response)
  220. {
  221. GivePlayerWeapon(playerid, strval(inputtext), 999);
  222. format(string, sizeof(string), "Você escolheu a arma modelo %d, Parabéns pela escolha!", strval(inputtext));
  223. SendClientMessage(playerid, CorVermelho, string);
  224. }
  225. else if(!response) return SendClientMessage(playerid, CorVermelho, "Você não quis resgatar uma arma!");
  226. }
  227. if(dialogid == 3)
  228. {
  229. if(response)
  230. {
  231. TogglePlayerSpectating(playerid, 1);
  232. PlayerSpectatePlayer(playerid, strval(inputtext));
  233. SetTimer("AcabouSpec", 60000, false);
  234. }
  235. else if(!response) return SendClientMessage(playerid, CorVermelho, "Você não quis ficar de spec em um player!");
  236. }
  237. if(dialogid == 4)
  238. {
  239. if(response)
  240. {
  241. SetPlayerTime(playerid, strval(inputtext) ,0);
  242. format(string, sizeof(string), "Você setou a hora para %d:00, Seu horário foi setado!", strval(inputtext));
  243. SendClientMessage(playerid, CorVermelho, string);
  244. }
  245. else if(!response) return SendClientMessage(playerid, CorVermelho, "Você não quis setar a hora!");
  246. }
  247. return 1;
  248. }
  249.  
  250. forward Invencivel(playerid);
  251. public Invencivel(playerid)
  252. {
  253. SendClientMessage(playerid, CorVermelho, "Seu estado de invencibilidade se esgotou!");
  254. SetPlayerHealth(playerid, 100);
  255. return 1;
  256. }
  257.  
  258. forward PremiosBlockedS(playerid);
  259. public PremiosBlockedS(playerid)
  260. {
  261. SPremio[playerid] = 0;
  262. SendClientMessage(playerid, 0x87CEFAFF, "Você já pode pegar outro prêmio!");
  263. return 1;
  264. }
  265.  
  266. forward AcabouSpec(playerid);
  267. public AcabouSpec(playerid)
  268. {
  269. TogglePlayerSpectating(playerid, 0);
  270. SendClientMessage(playerid, CorVermelho, "Seu estado de spec se esgotou!");
  271. return 1;
  272. }
  273.  
  274. forward MinAlcoolatra(playerid);
  275. public MinAlcoolatra(playerid)
  276. {
  277. SendClientMessage(playerid, CorVermelho, "Seu minuto alcoolatra acabou =(");
  278. SetPlayerDrunkLevel(playerid, 0);
  279. return 1;
  280. }
  281.  
  282. forward Bazuca(playerid);
  283. public Bazuca(playerid)
  284. {
  285. GivePlayerWeapon(playerid, 35, 0);
  286. SendClientMessage(playerid, CorVermelho, "Sua bazuca acabou e.e");
  287. return 1;
  288. }
  289.  
  290. stock pNome(playerid)
  291. {
  292. new nome[25];
  293. GetPlayerName(playerid, nome, sizeof(nome));
  294. return nome;
  295. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement