Advertisement
DeTix

Announce System For Admin By DeTix

Oct 9th, 2012
1,199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. //Includes
  2. #include <a_samp>
  3. #include <zcmd>
  4. #include <sscanf2>
  5.  
  6. //Defines
  7. #define COLOR_GREEN 0x33AA33AA
  8.  
  9. //Command
  10. CMD:announce(playerid, params[])
  11. {
  12. if(!IsPlayerAdmin(playerid))
  13. return SendClientMessage(playerid, COLOR_GREEN, "You are not allowed to use this command!");
  14.  
  15. new text[64], time, style;
  16. if (sscanf(params, "iis[64]", style, time, text)) return
  17. SendClientMessage(playerid, COLOR_GREEN, "Usage: /announce <style[0-6]> <time in ms> <text>");
  18. if (strlen(text) > 64) return
  19. SendClientMessage(playerid, COLOR_GREEN, "Message too long please shorten it!");
  20. if(style == 2) return SendClientMessage(playerid, COLOR_GREEN, "Bug with style 2 don't use it!");
  21. if (style < 0 || style > 6) return
  22. SendClientMessage(playerid, COLOR_GREEN,"Invalid style!");
  23. if (time > 20*1000) return
  24. SendClientMessage(playerid, COLOR_GREEN, "No longer than 20 seconds!");
  25. GameTextForAll(text, time, style);
  26. return 1;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement