Advertisement
Guest User

Untitled

a guest
Jun 4th, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. if(listitem == 11)
  2. {
  3. new i,stringyy[500];
  4. if(PlayerInfo[playerid][pPremiumPoints] >= 100)
  5. {
  6. if(PlayerInfo[playerid][pClan] == 0)
  7. {
  8. PlayerInfo[playerid][pPremiumPoints] -= 100;
  9. format(stringyy, sizeof(stringyy), "You have bought a clan! (-100 premium points)");
  10. SendClientMessage(playerid, COLOR_YELLOW, stringyy);
  11. PlayerInfo[playerid][pCRank] = 7;
  12.  
  13. new Cache: resultoccc = mysql_query(SQL, "INSERT INTO `clans` (`clanName`) VALUES('New Clan')");
  14.  
  15. print("Trece de primul query");
  16. i = cache_insert_id();
  17. cache_delete(resultoccc);
  18.  
  19. ClanInfo[i][cClanExpire] = gettime() + (90*86400);
  20.  
  21. PlayerInfo[playerid][pClan] = i;
  22.  
  23. mysql_format(SQL, stringyy, sizeof(stringyy), "UPDATE `clans` SET `clanExpire`='%d' WHERE `clanID`='%d'",ClanInfo[i][cClanExpire],i);
  24. mysql_tquery(SQL, stringyy, "", "");
  25. print("Trece de al 2-lea query");
  26.  
  27. mysql_format(SQL, stringyy, sizeof(stringyy), "UPDATE users SET `CRank`='7',`Clan`='%d',`PremiumPoints`='%d',`ClanJoin`='%d' WHERE `name`='%s'", PlayerInfo[playerid][pClan], PlayerInfo[playerid][pPremiumPoints], gettime(), PlayerInfo[playerid][pNormalName]);
  28. mysql_tquery(SQL,stringyy,"","");
  29. print("Trece de al 3-lea query");
  30.  
  31. mysql_format(SQL, stringyy, sizeof(stringyy), "UPDATE `clans` SET `clanSlots`='25' WHERE `clanID`='%d'",i);
  32. mysql_tquery(SQL, stringyy, "", "");
  33. print("Trece de al 4-lea query");
  34.  
  35.  
  36. new strings[200];
  37. format(strings, sizeof(strings), "/shop: %s created a new clan.", GetName(playerid));
  38. ABroadCast(COLOR_YELLOW, strings, 6);
  39. ShowPlayerDialog(playerid, DIALOG_CHOOSECLANNAME, DIALOG_STYLE_INPUT, "Clan name", "Insert clan name in the box below:\n(You can't change it after that!)", "Ok", "");
  40. }
  41. else return SCM(playerid,COLOR_WHITE,"You already are in a clan! Use /quitclan first.");
  42. }
  43. else return ShowPlayerDialog(playerid, DIALOG_NOPP, DIALOG_STYLE_MSGBOX, "Not enough points", "You don't have enough premium points to do this.", "Close", "");
  44. }
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement