Advertisement
Guest User

Untitled

a guest
Mar 4th, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1.  
  2. CMD:newpoll(playerid, params[]) {
  3. if(PlayerInfo[playerid][pAdmin] >= 999999) {
  4. new string[225],faq[128];
  5. if(sscanf(params,"s[128]",faq)) return SendClientMessage(playerid, -1,"Usage: /newpol [question]");
  6. format(string,sizeof(string),"*POLLING: {FFFF00}%s\n{FFFFFF}Use {FFFF00}/yes {FFFFFF}or {FFFF00}/no", faq);
  7. SendClientMessageToAll(COLOR_LIGHTBLUE,string);
  8. VoteAvailable = 1;
  9. SetTimer("VotingTime", 45000, false);
  10. return 1;
  11. }
  12. CMD:yes(playerid, params[]) {
  13. if(VoteAvailable == 1) {
  14. if(AlreadyVoted[playerid] == 1) {
  15. PlayersThatSaidYes++;
  16. SendClientMessage(playerid, COLOR_WHITE,"SERVER: You said {FFFF00}yes{FFFFFF}, thank your participant");
  17. AlreadyVoted[playerid] = 1;
  18. }
  19. else SendClientMessage(playerid, COLOR_GRAD2,"ERORR: Kamu telah melakukan vote sebelumnya");
  20. }
  21. else SendClientMessage(playerid, -1,"No vote avelible.");
  22. return 1;
  23. }
  24.  
  25. CMD:no(playerid, params[]) {
  26. if(VoteAvailable == 1) {
  27. if(AlreadyVoted[playerid] == 1) {
  28. PlayersThatSaidNo++;
  29. SendClientMessage(playerid, COLOR_WHITE,"SERVER: You said {FFFF00}no{FFFFFF}, thank your participant");
  30. AlreadyVoted[playerid] = 1;
  31. }
  32. else SendClientMessage(playerid, COLOR_GRAD2,"ERORR: Kamu telah melakukan vote sebelumnya");
  33. }
  34. else SendClientMessage(playerid, -1,"No vote avelible.");
  35. return 1;
  36. }
  37. public VotingTime() {
  38. new String[50];
  39. SendClientMessageToAll(0xff000019, "Vote: Vote telah selesai dan hasilnya:");
  40. format(String, sizeof String, "POLLING:{FFFFFF}Yes {FFFF00}%d{FFFFFF} people", PlayersThatSaidYes);
  41. SendClientMessageToAll(COLOR_LIGHTBLUE, String);
  42. format(String, sizeof String, "POLLING:{FFFFFF}No {FFFF00}%d{FFFFFF} people", PlayersThatSaidNo);
  43. SendClientMessageToAll(COLOR_LIGHTBLUE, String);
  44. VoteAvailable = 0;
  45. for ( new i = 0; i < MAX_PLAYERS; i++ ) {
  46. AlreadyVoted[i] = 0;
  47. PlayersThatSaidYes = 0;
  48. PlayersThatSaidNo = 0;
  49. }
  50. return 1;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement