Guest User

ShowFlags.pwn

a guest
Jul 21st, 2012
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.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:    1.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  4500
  22. #define FLAGS_DISPLAY_STYLE 3
  23.  
  24. /* /flags command which is only accessable by RCON-Admins, feel free to change it to your own Admin System */
  25. COMMAND:flags(playerid,params[])
  26. {
  27.     if (IsPlayerAdmin(playerid)) ShowPlayerDialog(playerid,DIALOG_FLAGS,DIALOG_STYLE_LIST,"Select Country:","Germany\nFrance\nSpain\nU.S.\nItaly\nNetherlands\nSweden\nPoland","Select","Close");
  28.     else
  29.         return 0;
  30.        
  31.     return 1;
  32. }
  33.  
  34. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  35. {
  36.     if (dialogid == DIALOG_FLAGS) {
  37.         if(!response) return 1;
  38.        
  39.         switch (listitem)
  40.         {
  41.             case 0: // Germany
  42.                 GameTextForAll("~l~]]]]]]]]]~n~~r~]]]]]]]]]~n~~y~]]]]]]]]]~n~~n~~w~GERMANY", FLAGS_DISPLAY_TIME, FLAGS_DISPLAY_STYLE);
  43.             case 1: // France
  44.                 GameTextForAll("~b~]]]~w~]]]~r~]]]~n~~b~]]]~w~]]]~r~]]]~n~~b~]]]~w~]]]~r~]]]~n~~n~~w~FRANCE", FLAGS_DISPLAY_TIME, FLAGS_DISPLAY_STYLE);
  45.             case 2: // Spain
  46.                 GameTextForAll("~r~]]]]]]]]]~n~~y~]]]]]]]]]~n~~r~]]]]]]]]]~n~~n~~w~SPAIN", FLAGS_DISPLAY_TIME, FLAGS_DISPLAY_STYLE);
  47.             case 3: // U.S.
  48.                 GameTextForAll("~b~]]]~r~]]]]]]~n~~b~]]]~w~]]]]]]~n~~b~]]]~r~]]]]]]~n~~w~]]]]]]]]]~n~~r~]]]]]]]]]~n~~n~~w~U.S.", FLAGS_DISPLAY_TIME, FLAGS_DISPLAY_STYLE);
  49.             case 4: // Italy
  50.                 GameTextForAll("~g~]]]~w~]]]~r~]]]~n~~g~]]]~w~]]]~r~]]]~n~~g~]]]~w~]]]~r~]]]~n~~n~~w~ITALY", FLAGS_DISPLAY_TIME, FLAGS_DISPLAY_STYLE);
  51.             case 5: // Netherlands
  52.                 GameTextForAll("~r~]]]]]]]]]~n~~w~]]]]]]]]]~n~~b~]]]]]]]]]~n~~n~~w~Netherlands", FLAGS_DISPLAY_TIME, FLAGS_DISPLAY_STYLE);
  53.             case 6: // Sweden
  54.                 GameTextForAll("~b~]]]~y~]]~b~]]]]]~n~~b~]]]~y~]]~b~]]]]]~n~~y~]]]]]]]]]]~n~~b~]]]~y~]]~b~]]]]]~n~~b~]]]~y~]]~b~]]]]]~n~~n~~w~Sweden", FLAGS_DISPLAY_TIME, FLAGS_DISPLAY_STYLE);
  55.             case 7: // Poland
  56.                 GameTextForAll("~w~]]]]]]]]]~n~~w~]]]]]]]]]~n~~r~]]]]]]]]]~n~~r~]]]]]]]]]~n~~n~~w~Poland", FLAGS_DISPLAY_TIME, FLAGS_DISPLAY_STYLE);
  57.         }
  58.     }
  59.    
  60.     return 1;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment