Advertisement
Guest User

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

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