SA-MP Forums Archive
BAN Command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: BAN Command (/showthread.php?tid=624070)



BAN Command - SeanDenZYR - 10.12.2016

can someone teach me how to make a ban command? with ZCMD please.


Re: BAN Command - SyS - 10.12.2016

No one taught anyone here most of them learned by themselves. Like that you should also try. This isn't a herculean task.


Re: BAN Command - saffierr - 10.12.2016

This section is to help you with the code you've scripted yourself. I'd suggest you to learn the basics first. Read/Watch tutorials, that's how you can learn.


Re: BAN Command - silverms - 10.12.2016

if u need to learn how to make ban command u first need to know the basics of zcmd and then basics of Ban(variable)
and then u will be good to go if u need to ask u need to ask on something that rly need help from other not a ban command



Re: BAN Command - Luicy. - 11.12.2016

PHP код:
// Open a command ofc
CMD:ban(playeridparams[]) { // Notice the "params[]", they're needed.
   
if(IsPlayerAdmin(playerid)) { // check if player is rcon
      
new targetid// empty int
      
if(sscanf(params"i"targetid)) { // check if the input was like /ban 0
          
Ban(playerid); // ban him using the samp func
      
}
      else
            
SendClientMessage(playerid, -1"SYNTAX: /ban playerid");
   }
   return 
1;




Re: BAN Command - ISmokezU - 11.12.2016

Quote:
Originally Posted by Luicy.
Посмотреть сообщение
PHP код:
// Open a command ofc
CMD:ban(playeridparams[]) { // Notice the "params[]", they're needed.
   
if(IsPlayerAdmin(playerid)) { // check if player is rcon
      
new targetid// empty int
      
if(sscanf(params"i"targetid)) { // check if the input was like /ban 0
          
Ban(playerid); // ban him using the samp func
      
}
      else
            
SendClientMessage(playerid, -1"SYNTAX: /ban playerid");
   }
   return 
1;

are you an idiot? why would you ban the "playerid" instead of the targetid,lol.

Do what the others said and try and understand by yourself and if you get any problems,check back here,List Of Bans Commands.


Re: BAN Command - BiosMarcel - 11.12.2016

Quote:
Originally Posted by ISmokezU
Посмотреть сообщение
are you an idiot? why would you ban the "playerid" instead of the targetid,lol.

Do what the others said and try and understand by yourself and if you get any problems,check back here,List Of Bans Commands.
No need to call him an idiot, everyone makes mistakes.


Re: BAN Command - ISmokezU - 11.12.2016

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
No need to call him an idiot, everyone makes mistakes.
Yeah true my bad,sorry but isn't he a girl "luicy" what kind of guy has a girl name?


Re: BAN Command - BiosMarcel - 11.12.2016

Quote:
Originally Posted by ISmokezU
Посмотреть сообщение
Yeah true my bad,sorry but isn't he a girl "luicy" what kind of guy has a girl name?
Er .... why the hell would anyone care about his/her gender I don't get your point.


Re: BAN Command - DJefferson - 09.03.2018

CMD:ban(playerid, params[])
{
new targetid, reason[128];

if(PlayerInfo[playerid][pAdmin] < 2)
{
return SendClientMessage(playerid, COLOR_IVORY, "You are not authorized to use this command.");
}
if(sscanf(params, "us[128]", targetid, reason))
{
return SendClientMessage(playerid, COLOR_IVORY, "USAGE: /ban [playerid] [reason]");
}
if(!IsPlayerConnected(targetid))
{
return SendClientMessage(playerid, COLOR_IVORY, "The player specified is disconnected.");
}
if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin])
{
return SendClientMessage(playerid, COLOR_IVORY, "The player specified has a higher admin level than you. They cannot be banned.");
}

Log_Write("log_punishments", "%s (uid: %i) banned %s (uid: %i), reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], reason);

SendClientMessageToAllEx(COLOR_IVORY, "AdmCmd: %s was banned by %s, reason: %s", GetPlayerRPName(targetid), GetPlayerRPName(playerid), reason);
BanPlayer(targetid, GetPlayerNameEx(playerid), reason);
return 1;
}