Advertisement
focus123

Untitled

Feb 20th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. if(dialogid == DIALOG_USECODE)
  2. {
  3. if(!response) return SCM(playerid, COLOR_GREEN, "Ai inchis dialogul!");
  4. {
  5. if(!suntcodes(inputtext)) return SCM(playerid, COLOR_WHITE, "{008080}(Error){FFFFFF} Codul introdus este invalid sau a fost deja folosit!");
  6. format(query, sizeof(query), "SELECT * FROM `luckycodes` WHERE `code`='%s'", inputtext);
  7. new rand = random(310);
  8. new won[256];
  9. if(rand < 270)
  10. {
  11. new randmoney = 500000 + random(1000000);
  12. PlayerInfo[playerid][pCash] += randmoney;
  13. GivePlayerCash(playerid, randmoney);
  14. format(won, sizeof(won), "Ai castigat $%s din roll!", FormatNumber(randmoney));
  15. GiftMoney += randmoney;
  16. }
  17. else if(rand >= 270 && rand < 280)
  18. {
  19. new randrp = 10 + random(60);
  20. PlayerInfo[playerid][pPremiumPoints] += randrp;
  21. Update(playerid, pPremiumPointsx);
  22. format(won, sizeof(won), "Ai introdus un lucky code si ai castigat %d premium points!", randrp);
  23. GiftGold += randrp;
  24. format(string, sizeof(string), "(( AdmBot: %s a introdus un lucky code si a castigat %d premium points! ))", GetName(playerid), randrp);
  25. SendClientMessageToAll(COLOR_CLIENT, string);
  26. }
  27. else if(rand >= 280 && rand < 297)
  28. {
  29. new randrp = 1 + random(4);
  30. PlayerInfo[playerid][pExp] += randrp;
  31. Update(playerid, pRP);
  32. format(won, sizeof(won), "Ai castigat %d respect points din roll!", randrp);
  33. GiftRP += randrp;
  34. UpdateProgress(playerid, 0);
  35. }
  36. else if(rand >= 297 && rand <= 300) {
  37. if(GiftVehicle < 60) {
  38. if(GetSlots(playerid) == GetVehicles(playerid)) {
  39. new randmoney = 1000000 + random(3000000);
  40. PlayerInfo[playerid][pCash] += randmoney;
  41. GivePlayerCash(playerid, randmoney);
  42. format(won, sizeof(won), "Ai introdus un lucky code si ai castigat $%s !", FormatNumber(randmoney));
  43. GiftMoney += randmoney;
  44. }
  45. else {
  46. LuckyVehicle++;
  47. format(won, sizeof(won), "Ai introdus un lucky code si ai castigat un vehicul de tip Banshee.");
  48. GiveVehicle(playerid, 492);
  49. format(string, sizeof(string), "(( AdmBot: %s a introdus un lucky code si a castigat un Banshee! ))", GetName(playerid));
  50. SendClientMessageToAll(COLOR_CLIENT, string);
  51. format(string, sizeof(string), "(( AdmBot: Mai sunt %d vehicule disponibile. ))", 60-LuckyVehicle);
  52. SendClientMessageToAll(COLOR_CLIENT, string);
  53. }
  54. }
  55. }
  56. ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Lucky Codes", won, "Ok", "");
  57.  
  58. new str1[200];
  59. mysql_format(SQL,str1, sizeof(str1), "DELETE FROM `LuckyCodes` WHERE `code`='%s'", inputtext);
  60. mysql_tquery(SQL,str1,"","");
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement