Advertisement
Kovacs_Bela

[FS] Textdraw Ban

May 29th, 2012
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.89 KB | None | 0 0
  1. /*
  2. ___________              __      .___                      __________
  3. \__    ___/___ ___  ____/  |_  __| _/___________ __  _  __ \______   \_____    ____
  4.   |    |_/ __ \\  \/  /\   __\/ __ |\_  __ \__  \\ \/ \/ /  |    |  _/\__  \  /    \
  5.   |    |\  ___/ >    <  |  | / /_/ | |  | \// __ \\     /   |    |   \ / __ \|   |  \
  6.   |____| \___  >__/\_ \ |__| \____ | |__|  (____  /\/\_/    |______  /(____  /___|  /
  7.              \/      \/           \/            \/                 \/      \/     \/
  8. */
  9. //fordította: danix99
  10.  
  11. #include <a_samp>
  12. #include <sscanf2>
  13.  
  14. //DCMD:
  15. //---Command processor---//
  16. #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 // The dcmd define
  17.  
  18. //Színek:
  19. //---Colors---//
  20. #define COLOR_WHITE  0xFFFFFFAA
  21. #define COL_GREEN "{6EF83C}"
  22. #define COL_RED "{F81414}"
  23.  
  24. //Változók
  25. //---Variables---//
  26. new Text:Box[MAX_PLAYERS];
  27. new Text:BannedNotice[MAX_PLAYERS];
  28. new Text:Info[MAX_PLAYERS];
  29. new Text:Site[MAX_PLAYERS];
  30.  
  31. //Parancsok
  32. //---Commands---//
  33. dcmd_ban(playerid, params[]) {
  34.     new pName[MAX_PLAYER_NAME] , pName2[MAX_PLAYER_NAME] , targetid , reason[64] , string[128] , stringbig[256] , YEAR_string[5], Year, Month, Day;
  35.     GetPlayerName(targetid, pName, sizeof(pName));\
  36.     GetPlayerName(playerid, pName2, sizeof(pName2));
  37.     getdate(Year, Month, Day);
  38.     if(!IsPlayerAdmin(playerid)) return 0;
  39.     if(sscanf(params, "us[80]", targetid ,reason))  return SendClientMessage(playerid, COLOR_WHITE, "Szerver: "COL_GREEN"/ban [playerid/név] [indok]");
  40.     if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, "Szerver: "COL_RED" A játékos nincs csatlakozva!");
  41.     format(string, sizeof(string), "SERVER: "COL_RED"%s "COL_GREEN"bannolva lett! "COL_RED"(Reason: %s)",pName, reason);
  42.     SendClientMessageToAll(COLOR_WHITE, string);
  43.     format(YEAR_string, sizeof(YEAR_string), "%d", Year);
  44.     strdel(YEAR_string, 0, 2);
  45.     format(stringbig, sizeof(stringbig),"~r~ Indok: ~w~ %s ~n~~r~Bannolt: ~w~ %s ~n~~r~Datum: ~w~ %d.%d%d",reason,pName2,YEAR_string, Month, Date);
  46.     TextDrawSetString(Info[playerid] , stringbig);
  47.     TextDrawShowForPlayer(playerid, Info[playerid]);
  48.     TextDrawShowForPlayer(playerid, Box[playerid]);
  49.     TextDrawShowForPlayer(playerid, BannedNotice[playerid]);
  50.     TextDrawShowForPlayer(playerid, Site[playerid]);
  51.     Ban(targetid);
  52.     return 1;
  53. }
  54.  
  55. public OnPlayerCommandText(playerid, cmdtext[]) {
  56.     dcmd(ban, 3, cmdtext);
  57.     return 0;
  58. }
  59.  
  60. public OnFilterScriptInit() {
  61.     for(new playerid; playerid < MAX_PLAYERS; playerid ++) {
  62.         Box[playerid] = TextDrawCreate(2.000000, 0.000000, "~n~");
  63.         TextDrawBackgroundColor(Box[playerid], 255);
  64.         TextDrawFont(Box[playerid], 1);
  65.         TextDrawLetterSize(Box[playerid], 0.500000, 49.700004);
  66.         TextDrawColor(Box[playerid], -1);
  67.         TextDrawSetOutline(Box[playerid], 0);
  68.         TextDrawSetProportional(Box[playerid], 1);
  69.         TextDrawSetShadow(Box[playerid], 1);
  70.         TextDrawUseBox(Box[playerid], 1);
  71.         TextDrawBoxColor(Box[playerid], 255);
  72.         TextDrawTextSize(Box[playerid], 637.000000, 20.000000);
  73.  
  74.         BannedNotice[playerid] = TextDrawCreate(120.000000, 129.000000, "~r~Bannolva lettel a szerverrol!");
  75.         TextDrawBackgroundColor(BannedNotice[playerid], 255);
  76.         TextDrawFont(BannedNotice[playerid], 1);
  77.         TextDrawLetterSize(BannedNotice[playerid], 0.600000, 5.000000);
  78.         TextDrawColor(BannedNotice[playerid], -1);
  79.         TextDrawSetOutline(BannedNotice[playerid], 0);
  80.         TextDrawSetProportional(BannedNotice[playerid], 1);
  81.         TextDrawSetShadow(BannedNotice[playerid], 1);
  82.  
  83.         Info[playerid] = TextDrawCreate(182.000000, 207.000000, "~r~Indok: ~w~ ~n~~r~Bannolt: ~w~ ~n~~r~Datum: ~w~ ");
  84.         TextDrawBackgroundColor(Info[playerid], 255);
  85.         TextDrawFont(Info[playerid], 1);
  86.         TextDrawLetterSize(Info[playerid], 0.500000, 1.800000);
  87.         TextDrawColor(Info[playerid], -1);
  88.         TextDrawSetOutline(Info[playerid], 0);
  89.         TextDrawSetProportional(Info[playerid], 1);
  90.         TextDrawSetShadow(Info[playerid], 1);
  91.         TextDrawUseBox(Info[playerid], 1);
  92.         TextDrawBoxColor(Info[playerid], 1681016400);
  93.         TextDrawTextSize(Info[playerid], 410.000000, -30.000000);
  94.  
  95.         Site[playerid] = TextDrawCreate(20.000000, 420.000000, "Fenykepezd ezt le az ~g~ F8 ~w~ megnyomasaval, es toltsd fel a kepet egy hostra! (kepfeltoltes.hu)");
  96.         TextDrawBackgroundColor(Site[playerid], 255);
  97.         TextDrawFont(Site[playerid], 1);
  98.         TextDrawLetterSize(Site[playerid], 0.400000, 1.000000);
  99.         TextDrawColor(Site[playerid], -1);
  100.         TextDrawSetOutline(Site[playerid], 0);
  101.         TextDrawSetProportional(Site[playerid], 1);
  102.         TextDrawSetShadow(Site[playerid], 1);
  103.     }
  104.     return 1;
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement