Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 KB | None | 0 0
  1. case DIALOG_CLAN: {
  2. if(!response) return ShowShop(playerid);
  3. if(ExistaNumeClan(inputtext)) return SCM(playerid, COLOR_WARNING, "Exista deja un clan inregistrat cu acest nume!");
  4.  
  5. if(strlen(inputtext) < 2 || strlen(inputtext) > 20) {
  6. SendClientMessage(playerid, COLOR_GREY, "Numele clanului trebuie sa aiba intre 3 si 20 caractere.");
  7. if(sSlot[playerid] == 10) {
  8. ShowPlayerDialog(playerid, DIALOG_CLAN, DIALOG_STYLE_INPUT, "Shop:", "Esti pe cale sa-ti creezi un clan cu 10 locuri disponibile.\nTot ce trebuie sa faci in acest moment,\
  9. este sa-ti alegi numele clanului.\nNumele clanului trebuie sa contina intre 3 si 10 caractere.", "Ok", "Back");
  10. }
  11. else if(sSlot[playerid] == 20) {
  12. ShowPlayerDialog(playerid, DIALOG_CLAN, DIALOG_STYLE_INPUT, "Shop:", "Esti pe cale sa-ti creezi un clan cu 20 locuri disponibile.\nTot ce trebuie sa faci in acest moment,\
  13. este sa-ti alegi numele clanului.\nNumele clanului trebuie sa contina intre 3 si 10 caractere.", "Ok", "Back");
  14. }
  15. else if(sSlot[playerid] == 40) {
  16. ShowPlayerDialog(playerid, DIALOG_CLAN, DIALOG_STYLE_INPUT, "Shop:", "Esti pe cale sa-ti creezi un clan cu 40 locuri disponibile.\nTot ce trebuie sa faci in acest moment,\
  17. este sa-ti alegi numele clanului.\nNumele clanului trebuie sa contina intre 3 si 10 caractere.", "Ok", "Back");
  18. }
  19. return 1;
  20. }
  21.  
  22. switch(sSlot[playerid]) {
  23. case 10: {
  24. if(PlayerInfo[playerid][pPremiumPoints] < 2000) return SCM(playerid, -1, "Nu ai destule Diamonds.");
  25. else {
  26. PlayerInfo[playerid][pPremiumPoints] -= 2000;
  27. Update(playerid, pPremiumPointsx);
  28. }
  29. }
  30. case 20: {
  31. if(PlayerInfo[playerid][pPremiumPoints] < 3000)return SCM(playerid, -1, "Nu ai destule Diamonds.");
  32. else {
  33. PlayerInfo[playerid][pPremiumPoints] -= 3000;
  34. Update(playerid, pPremiumPointsx);
  35. }
  36. }
  37. case 40: {
  38. if(PlayerInfo[playerid][pPremiumPoints] < 4000)return SCM(playerid, -1, "Nu ai destule Diamonds.");
  39. else {
  40. PlayerInfo[playerid][pPremiumPoints] -= 4000;
  41. Update(playerid, pPremiumPointsx);
  42. }
  43. }
  44. }
  45.  
  46. new
  47. szDate[180],
  48. Year, Month, Day, Hour, Minute, Second;
  49.  
  50. getdate(Year, Month, Day);
  51. gettime(Hour, Minute, Second);
  52.  
  53. format(szDate, sizeof(szDate), "%02d/%02d/%d - %02d:%02d:%02d", Day, Month, Year, Hour, Minute, Second);
  54. mysql_format(SQL, query, sizeof(query), "INSERT INTO `clans` (`Name`, `Owner`, `OwnerSQL`, `RegisterDate`, `Color`, `Slots`) VALUES ('%e', '%e', '%d', '%e', 'FFFFFF', '%d')", inputtext, PlayerInfo[playerid][pUsername], PlayerInfo[playerid][pSQLID], szDate, sSlot[playerid]);
  55. new Cache: result = mysql_query(SQL, query);
  56. new i = cache_insert_id();
  57. cache_delete(result);
  58.  
  59. ClanInfo[i][clSlots] = sSlot[playerid];
  60. format(ClanInfo[i][clName], 64, inputtext);
  61. format(ClanInfo[i][clOwner], 256, PlayerInfo[playerid][pUsername]);
  62. format(ClanInfo[i][clRegisterDate], 256, szDate);
  63. format(ClanInfo[i][clColor], 256, "FFFFFF");
  64. ClanMembers[i] ++;
  65. PlayerInfo[playerid][pClan] = i;
  66. PlayerInfo[playerid][pClanRank] = 6;
  67. ClanInfo[i][clDays] = 60;
  68. new szText[180];
  69. format(szText, sizeof(szText), "Numele ales de tine este: %s.\nCel de-al doilea pas, este de a alege tagul clanului.\nTagul clanului trebuie sa contina intre 3 si 6 caractere.", inputtext);
  70. ShowPlayerDialog(playerid, DIALOG_CLAN2, DIALOG_STYLE_INPUT, "Shop:", szText, "Ok", "");
  71.  
  72. format(query, sizeof(query), "UPDATE `users` SET `Clan`='%d', `ClanRank`='%d' WHERE `Name`='%s'", PlayerInfo[playerid][pClan], PlayerInfo[playerid][pClanRank], PlayerInfo[playerid][pUsername]);
  73. mysql_query(SQL, query);
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement