BAN Command
#1

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

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

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.
Reply
#4

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
Reply
#5

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;

Reply
#6

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.
Reply
#7

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.
Reply
#8

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?
Reply
#9

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.
Reply
#10

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)