Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2018
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. case DIALOG_CHOOSECLANNAME: {
  2. if(response)
  3. {
  4. if(strlen(inputtext) >= 3 && strlen(inputtext) <= 20)
  5. {
  6. new clanname[25],strings[128];
  7. mysql_real_escape_string(inputtext, clanname);
  8. strcpy(ClanInfo[PlayerInfo[playerid][pClan]][cClanName], clanname, sizeof(clanname));
  9. mysql_format(SQL, string, sizeof(string), "UPDATE clans SET `clanName`='%s' WHERE `clanID`='%d'", clanname, PlayerInfo[playerid][pClan]);
  10. mysql_tquery(SQL,string,"","");
  11. format(strings, sizeof(strings), "Clan name: %s.", clanname);
  12. SendClientMessage(playerid, COLOR_GENANNOUNCE, strings);
  13. ShowPlayerDialog(playerid, DIALOG_CHOOSECLANTAG, DIALOG_STYLE_INPUT, "Clan tag", "Insert clan tag in the box below:\n(You can't change it after that!)", "Ok", "");
  14. }
  15. else
  16. {
  17. ShowPlayerDialog(playerid, DIALOG_CHOOSECLANNAME, DIALOG_STYLE_INPUT, "Clan name", "Insert clan name in the box below:\nMinimum 3 characters and maximum 20 characters.\n(You can't change it after that!)", "Ok", "");
  18. return 1;
  19. }
  20. }
  21. }
  22.  
  23. case DIALOG_CHOOSECLANTAG: {
  24. if(response)
  25. {
  26. if(strlen(inputtext) >= 2 && strlen(inputtext) <= 15)
  27. {
  28. new clanname[25],strings[256];
  29. mysql_real_escape_string(inputtext, clanname);
  30. strcpy(ClanInfo[PlayerInfo[playerid][pClan]][cClanTag], clanname, sizeof(clanname));
  31. mysql_format(SQL, strings, sizeof(strings), "UPDATE clans SET `clanTag`='%s' WHERE `clanID`='%d'", clanname, PlayerInfo[playerid][pClan]);
  32. mysql_tquery(SQL,strings,"","");
  33. format(strings, sizeof(strings), "Clan tag: %s.", clanname);
  34. SendClientMessage(playerid, COLOR_GENANNOUNCE, strings);
  35. mysql_format(SQL, strings, sizeof(strings), "SELECT * FROM `clans`");
  36. mysql_tquery(SQL, strings, "LoadClanInfo", "");
  37. }
  38. else
  39. {
  40. ShowPlayerDialog(playerid, DIALOG_CHOOSECLANTAG, DIALOG_STYLE_INPUT, "Clan tag", "Insert clan tag in the box below:\nMinimum 2 characters and maximum 15 characters.\n(You can't change it after that!)", "Ok", "");
  41. return 1;
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement