Share Pastebin
Guest
Public paste!

Henk

By: a guest | Feb 9th, 2010 | Syntax: None | Size: 1.04 KB | Hits: 32 | Expires: Never
Copy text to clipboard
  1. stock BanPlayerID(playerid,bannedby,reason[],unbandate)
  2. {
  3.         if(bannedby == 255)
  4.         {
  5.                 format(string, sizeof(string), "* %s is permbanned from the server by the system (reason: %s)", PlayerName[playerid],reason);
  6.                 SendClientMessageToAll(COLOR_DARKORANGE,string);
  7.         }
  8.         else
  9.         {
  10.                 if(unbandate == 255)
  11.                 {
  12.                         format(string, sizeof(string), "* %s is permbanned from the server by %s (reason: %s)", PlayerName[playerid],PlayerName[bannedby],reason);
  13.                         SendClientMessageToAll(COLOR_DARKORANGE,string);
  14.                 }
  15.                 if(unbandate == 255)
  16.                 {
  17.                         format(string, sizeof(string), "* %s is banned from the server by %s (reason: %s)", PlayerName[playerid],PlayerName[bannedby],reason);
  18.                         SendClientMessageToAll(COLOR_DARKORANGE,string);
  19.                 }
  20.         }
  21.         new BanFile[128];
  22.         GetPlayerIp(playerid, PlayerIP, sizeof(PlayerIP));
  23.         format(BanFile, sizeof(BanFile), "/accounts/banned/%s.sav", PlayerIP);
  24.         dini_Create(BanFile);
  25.         dini_Set(BanFile, "Reason", reason);
  26.         dini_IntSet(BanFile, "BannedBy", bannedby);
  27.         dini_IntSet(BanFile, "UnBanDate", unbandate);
  28.        
  29.         Kick(playerid);
  30. }