Advertisement
Guest User

Kicker and Banner

a guest
Apr 11th, 2011
430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.59 KB | None | 0 0
  1.             if (strcmp("/kick", cmdtext, true) == 0)
  2.         {
  3.             if(IsPlayerAdmin(playerid))
  4.             {
  5.             new kickid[30],kickreason[30],kickername[30],kickedname[30];
  6.             SSCANF(params,"ss",kickid,kickreason);
  7.             GetPlayerName(playerid,kickername,sizeof(kickername));
  8.             GetPlayerName(kickid,kickedname,sizeof(kickedname));
  9.                 if (IsPlayerConnected(kickid))
  10.                 {
  11.                     if (!IsPlayerAdmin(kickid))
  12.                     {
  13.                         if (kickid!=playerid)
  14.                         {
  15.                         new kickerstring[20];
  16.                         format(kickerstring,sizeof(kickerstring),"Administrator \"%s\" has kicked \"%s\". (Reason: %s)", kickername,kickedname,kickreason);
  17.                         SendClientMessageToAll(red,kickerstring);
  18.                         Kick(kickid);
  19.                         } else { SendClientMessage(playerid,red,"Error: You can't kick yourself!"); }
  20.                     } else {
  21.                     new kickerrorstring1[40], kickerrorstring2[40];
  22.                     format(kickerrorstring1,sizeof(kickerrorstring1),"You can't kick administrator \"%s\"! Message sent for him / her about your attempt.", kickedname);
  23.                     format(kickerrorstring2,sizeof(kickerrorstring2), "%s has just tried to kick you, but failed.",kickername);
  24.                     SendClientMessage(playerid,red,kickerrorstring1);
  25.                     SendClientMessage(id,orange,kickerrorstring2);
  26.                     }
  27.                 } else { SendClientMessage(playerid,red,"Player is not connected."); }
  28.         }
  29.        
  30.                     if (strcmp("/ban", cmdtext, true) == 0)
  31.         {
  32.             if(IsPlayerAdmin(playerid))
  33.             {
  34.             new banid[30],banreason[30],bannername[30],bannedname[30];
  35.             SSCANF(params,"ss",banid,reason);
  36.             GetPlayerName(playerid,bannername,sizeof(bannername));
  37.             GetPlayerName(banid,bannedname,sizeof(bannedname));
  38.                 if (IsPlayerConnected(id))
  39.                 {
  40.                     if (!IsPlayerAdmin(banid))
  41.                     {
  42.                         if (banid!=playerid)
  43.                         {
  44.                         new bannerstring[20];
  45.                         format(bannerstring,sizeof(bannerstring),"Administrator \"%s\" has banned \"%s\". (Reason: %s)", bannername,bannedname,banreason);
  46.                         SendClientMessageToAll(red,bannerstring);
  47.                         Ban(banid);
  48.                         } else { SendClientMessage(playerid,red,"Error: You can't ban yourself!"); }
  49.                     } else {
  50.                     new errorstring1[40], errorstring2[40];
  51.                     format(banerrorstring1,sizeof(banerrorstring1),"You can't ban administrator \"%s\"! Message sent for him / her about your attempt.", bannedname);
  52.                     format(banerrorstring2,sizeof(banerrorstring2), "%s has just tried to ban you, but failed.",bannername);
  53.                     SendClientMessage(playerid,red,banerrorstring1);
  54.                     SendClientMessage(id,orange,banerrorstring2);
  55.                     }
  56.                 } else { SendClientMessage(playerid,red,"Player is not connected."); }
  57.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement