Guest User

ShowFlags.pwn (updated)

a guest
Jul 22nd, 2012
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.35 KB | None | 0 0
  1. /*
  2.     FilterScript
  3.    
  4.     Author:     malaka | http://forum.sa-mp.com/member.php?u=112277
  5.     Name:       Simple FS to show flags
  6.     Version:    Float:2.0
  7.     Desc:       Shows a flag for all player on the server
  8.     License:    CC BY-NC | http://creativecommons.org/licenses/by-nc/3.0/
  9.    
  10.     Credits:
  11.     * SA-MP Team
  12.     * Creater of zcmd - Zeex (http://forum.sa-mp.com/showthread.php?t=91354)
  13. */
  14.  
  15. // Includes
  16. #include <a_samp>
  17. #include <zcmd>
  18.  
  19. // Defines
  20. #define DIALOG_FLAGS        7337
  21. #define FLAGS_DISPLAY_TIME  1000 * 5 // Flag will be shown for 5 seconds
  22. #define FLAGS_DISPLAY_STYLE 3 // Only use 3,4 and 5 if you want to change this
  23.  
  24. // Global variables
  25. enum FDCountry
  26. {
  27.     Name[20],
  28.     String[140]
  29. }
  30. new CountryNames[][FDCountry] =
  31. {
  32.     {"Germany","~l~]]]]]]]]]~n~~l~]]]]]]]]]~n~~r~]]]]]]]]]~n~~r~]]]]]]]]]~n~~y~]]]]]]]]]~n~~y~]]]]]]]]]"},
  33.     {"France","~b~]]]~w~]]]~r~]]]~n~~b~]]]~w~]]]~r~]]]~n~~b~]]]~w~]]]~r~]]]~n~~b~]]]~w~]]]~r~]]]~n~~b~]]]~w~]]]~r~]]]"},
  34.     {"Spain","~r~]]]]]]]]]~n~~r~]]]]]]]]]~n~~y~]]]]]]]]]~n~~y~]]]]]]]]]~n~~r~]]]]]]]]]~n~~r~]]]]]]]]]"},
  35.     {"U.S.","~b~]]]~r~]]]]]]~n~~b~]]]~w~]]]]]]~n~~b~]]]~r~]]]]]]~n~~w~]]]]]]]]]~n~~r~]]]]]]]]]"},
  36.     {"Italy","~g~]]]~w~]]]~r~]]]~n~~g~]]]~w~]]]~r~]]]~n~~g~]]]~w~]]]~r~]]]~n~~g~]]]~w~]]]~r~]]]~n~~g~]]]~w~]]]~r~]]]"},
  37.     {"Netherlands","~r~]]]]]]]]]~n~~r~]]]]]]]]]~n~~w~]]]]]]]]]~n~~w~]]]]]]]]]~n~~b~]]]]]]]]]~n~~b~]]]]]]]]]"},
  38.     {"Sweden","~b~]]]~y~]]~b~]]]]]~n~~b~]]]~y~]]~b~]]]]]~n~~y~]]]]]]]]]]~n~~b~]]]~y~]]~b~]]]]]~n~~b~]]]~y~]]~b~]]]]]"},
  39.     {"Poland","~w~]]]]]]]]]~n~~w~]]]]]]]]]~n~~r~]]]]]]]]]~n~~r~]]]]]]]]]"},
  40.     {"Russia","~w~]]]]]]]]]~n~~w~]]]]]]]]]~n~~b~]]]]]]]]]~n~~b~]]]]]]]]]~n~~r~]]]]]]]]]~n~~r~]]]]]]]]]"},
  41.     {"Finland","~w~]]]~b~]]~w~]]]]]~n~~w~]]]~b~]]~w~]]]]]~n~~b~]]]]]]]]]]~n~~w~]]]~b~]]~w~]]]]]~n~~w~]]]~b~]]~w~]]]]]"},
  42.     {"Turkey", "~r~]]]]]]]]~n~~r~]]~w~]]~r~]]]]~n~~r~]~w~]~r~]]]~w~]~r~]]~n~~r~]]~w~]]~r~]]]]~n~~r~]]]]]]]]"},
  43.     {"Denmark","~r~]]]~w~]]~r~]]]]]~n~~r~]]]~w~]]~r~]]]]]~n~~w~]]]]]]]]]]~n~~r~]]]~w~]]~r~]]]]]~n~~r~]]]~w~]]~r~]]]]]"},
  44.     {"Austria","~r~]]]]]]]]]~n~~r~]]]]]]]]]~n~~w~]]]]]]]]]~n~~w~]]]]]]]]]~n~~r~]]]]]]]]]~n~~r~]]]]]]]]]"},
  45.     {"Switzerland","~r~]]]]]~n~~r~]]~w~]~r~]]~n~~r~]~w~]]]~r~]~n~~r~]]~w~]~r~]]~n~~r~]]]]]~n~"},
  46.     {"Lithuania","~y~]]]]]]]]]~n~~y~]]]]]]]]]~n~~g~]]]]]]]]]~n~~g~]]]]]]]]]~n~~r~]]]]]]]]]~n~~r~]]]]]]]]]"},
  47.     {"Romania","~b~]]]~y~]]]~r~]]]~n~~b~]]]~y~]]]~r~]]]~n~~b~]]]~y~]]]~r~]]]~n~~b~]]]~y~]]]~r~]]]~n~~b~]]]~y~]]]~r~]]]"},
  48.     {"Hungary","~r~]]]]]]]]]~n~~r~]]]]]]]]]~n~~w~]]]]]]]]]~n~~w~]]]]]]]]]~n~~g~]]]]]]]]]~n~~g~]]]]]]]]]"},
  49.     {"Czech","~b~]~w~]]]]]]]]~n~~b~]]~w~]]]]]]]~n~~b~]]~r~]]]]]]]~n~~b~]~r~]]]]]]]]"},
  50.     {"Luxembourg","~r~~h~]]]]]]]]]~n~~r~~h~]]]]]]]]]~n~~w~]]]]]]]]]~n~~w~]]]]]]]]]~n~~b~~h~]]]]]]]]]~n~~b~~h~]]]]]]]]]"},
  51.     {"Latvia","~r~]]]]]]]]]~n~~r~]]]]]]]]]~n~~w~]]]]]]]]]~n~~r~]]]]]]]]]~n~~r~]]]]]]]]]"},
  52.     {"Malta","~w~]]]]~r~]]]]~n~~w~]]]]~r~]]]]~n~~w~]]]]~r~]]]]~n~~w~]]]]~r~]]]]"},
  53.     {"Portugal","~g~]]]~r~]]]]]~n~~g~]]]~r~]]]]]~n~~g~]]]~r~]]]]]~n~~g~]]]~r~]]]]]"},
  54.     {"Estonia","~b~~h~]]]]]]]]]~n~~b~~h~]]]]]]]]]~n~~l~]]]]]]]]]~n~~l~]]]]]]]]]~n~~w~]]]]]]]]]~n~~w~]]]]]]]]]"},
  55.     {"Bulgaria","~w~]]]]]]]]]~n~~w~]]]]]]]]]~n~~g~]]]]]]]]]~n~~g~]]]]]]]]]~n~~r~]]]]]]]]]~n~~r~]]]]]]]]]"},
  56.     {"Belgium","~l~]]]~y~]]]~r~]]]~n~~l~]]]~y~]]]~r~]]]~n~~l~]]]~y~]]]~r~]]]~n~~l~]]]~y~]]]~r~]]]~n~~l~]]]~y~]]]~r~]]]"}   
  57. };
  58.  
  59. /* /flags command which is only accessable by RCON-Admins, feel free to change it to your own Admin System */
  60. COMMAND:flags(playerid,params[])
  61. {
  62.     new
  63.         CountryList[2000];
  64.    
  65.     for (new i = 0; i < sizeof(CountryNames); i++) {
  66.         format(CountryList, sizeof(CountryList),"%s%s\n",CountryList,CountryNames[i][Name]);
  67.     }
  68.    
  69.     if (IsPlayerAdmin(playerid)) ShowPlayerDialog(playerid,DIALOG_FLAGS,DIALOG_STYLE_LIST,"Select Country:",CountryList,"Select","Close");
  70.     else
  71.         return 0;
  72.        
  73.     return 1;
  74. }
  75.  
  76. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  77. {
  78.     if (dialogid == DIALOG_FLAGS) {
  79.         if(!response) return 1;
  80.        
  81.         new
  82.             FLAGS_DISPLAY_TEXT[256];
  83.        
  84.         if (strlen(CountryNames[listitem][Name]) > 3 && strlen(CountryNames[listitem][String]) > 5)
  85.         {
  86.             format(FLAGS_DISPLAY_TEXT, sizeof(FLAGS_DISPLAY_TEXT), "%s~n~~n~~w~%s",CountryNames[listitem][String],CountryNames[listitem][Name]);
  87.             GameTextForAll(FLAGS_DISPLAY_TEXT, FLAGS_DISPLAY_TIME, FLAGS_DISPLAY_STYLE);
  88.         } else {
  89.             SendClientMessage(playerid,0xDCDCDCFF, "Invalid Selection");
  90.         }
  91.     }
  92.    
  93.     return 1;
  94. }
Advertisement
Add Comment
Please, Sign In to add comment