Advertisement
Hellrocker

Untitled

Apr 17th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. global:adminChangeMode(mode)
  2. {
  3. if(currMissionTime < 10 || missionFinished) return 0;
  4. missionMode = mode;
  5. if(mode == MISSION_MODE_IDORDER)
  6. {
  7. new lookupQuery[256];
  8. format(lookupQuery, 256, "SELECT * FROM `"MYSQLTABLE_MISSIONS"` WHERE `id` > %d AND `disabled` != 1", currMissionID);
  9. mysql_function_query(1, lookupQuery, true, "setupMissionSequence", "iiis", MISSION_MODE_IDORDER, 0, 0, "no_irc_user"); //request method = 0
  10. }
  11. if(mode == MISSION_MODE_RANDOM)
  12. {
  13. new lookupQuery[256];
  14. format(lookupQuery, 256, "SELECT * FROM `"MYSQLTABLE_MISSIONS"` WHERE `disabled` != 1 AND `type` != %d ORDER BY RAND() LIMIT 1", currMissionType);
  15. mysql_function_query(1, lookupQuery, true, "setupMissionSequence", "iiis", MISSION_MODE_RANDOM, 0, 0, "no_irc_user"); //request method = 0
  16. }
  17. if(mode == MISSION_MODE_LASTPLAYED)
  18. {
  19. new lookupQuery[256];
  20. format(lookupQuery, 256, "SELECT * FROM `"MYSQLTABLE_MISSIONS"` ORDER BY `lastplayed` AND `disabled` != 1 ASC LIMIT 1", 0);
  21. mysql_function_query(1, lookupQuery, true, "setupMissionSequence", "iiis", MISSION_MODE_LASTPLAYED, 0, 0, "no_irc_user"); //request method = 0
  22. }
  23. if(mode == MISSION_MODE_VOTE)
  24. {
  25.  
  26. new missionString[128];
  27. format(missionString, 128, "~y~%s ~>~~g~TBA", currMissionName);
  28. TextDrawSetString(missionStatus, missionString);
  29. }
  30.  
  31.  
  32. return 1;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement