Advertisement
Guest User

Shop

a guest
Oct 26th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. if(listitem == 19)
  2. {
  3. if(PlayerInfo[playerid][pPremiumPoints] <= 19)
  4. {
  5. ShowPlayerDialog(playerid, DIALOG_NOPP, DIALOG_STYLE_MSGBOX, "Not enough points", "You don't have enough premium points to do this.", "Close", "");
  6. return 1;
  7. }
  8. PlayerInfo[playerid][pPremiumPoints] -= 20;
  9. Update(playerid, pPremiumPointsx);
  10. PlayerInfo[playerid][pCase] += 5;
  11. new str2[300],strings[200],name[30],stringss[200];
  12. mysql_format(SQL,str2,sizeof(str2),"UPDATE users SET `PremiumPoints`='%d',`Case`='%d' WHERE `name`='%s'",PlayerInfo[playerid][pPremiumPoints],PlayerInfo[playerid][pCase],PlayerInfo[playerid][pNormalName]);
  13. mysql_tquery(SQL,str2,"","");
  14. SendClientMessage(playerid, COLOR_YELLOW, "You have bought 5 cases (-20 Drawn points)");
  15. GetPlayerName(playerid, name, sizeof(name));
  16. format(strings, sizeof(strings), "/shop: %s bought 5 cases",name);
  17. ABroadCast(COLOR_YELLOW,strings,7);
  18. mysql_real_escape_string(strings, stringss);
  19. mysql_format(SQL,str2,sizeof(str2), "INSERT INTO `shop_logs` (`playerid`,`Message`) VALUES('%d','%s')",PlayerInfo[playerid][pSQLID],stringss);
  20. mysql_tquery(SQL,str2,"","");
  21. }
  22. if(listitem == 20)
  23. {
  24. if(PlayerInfo[playerid][pPremiumPoints] <= 14)
  25. {
  26. ShowPlayerDialog(playerid, DIALOG_NOPP, DIALOG_STYLE_MSGBOX, "Not enough points", "You don't have enough premium points to do this.", "Close", "");
  27. return 1;
  28. }
  29. PlayerInfo[playerid][pPremiumPoints] -= 15;
  30. Update(playerid, pPremiumPointsx);
  31. PlayerInfo[playerid][pCKey] += 5;
  32. new str2[300],strings[200],name[30],stringss[200];
  33. mysql_format(SQL,str2,sizeof(str2),"UPDATE users SET `PremiumPoints`='%d',`CKey`='%d' WHERE `name`='%s'",PlayerInfo[playerid][pPremiumPoints],PlayerInfo[playerid][pCKey],PlayerInfo[playerid][pNormalName]);
  34. mysql_tquery(SQL,str2,"","");
  35. SendClientMessage(playerid, COLOR_YELLOW, "You have bought 5 keys (-15 Drawn points)");
  36. GetPlayerName(playerid, name, sizeof(name));
  37. format(strings, sizeof(strings), "/shop: %s bought 5 keys",name);
  38. ABroadCast(COLOR_YELLOW,strings,7);
  39. mysql_real_escape_string(strings, stringss);
  40. mysql_format(SQL,str2,sizeof(str2), "INSERT INTO `shop_logs` (`playerid`,`Message`) VALUES('%d','%s')",PlayerInfo[playerid][pSQLID],stringss);
  41. mysql_tquery(SQL,str2,"","");
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement