PDA

View Full Version : BAN Command


SeanDenZYR
10/12/2016, 01:05 PM
can someone teach me how to make a ban command? with ZCMD please.

SyS
10/12/2016, 01:33 PM
No one taught anyone here most of them learned by themselves. Like that you should also try. This isn't a herculean task.

saffierr
10/12/2016, 02:07 PM
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.

silverms
10/12/2016, 06:03 PM
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
http://www.game-state.com/88.198.53.218:7804/560x95_FFFFFF_3E2ABF_000000_000000.png (http://www.game-state.com/88.198.53.218:7804/)

Luicy.
11/12/2016, 12:22 PM
// Open a command ofc
CMD:ban(playerid, params[]) { // 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;
}

ISmokezU
11/12/2016, 12:43 PM
// Open a command ofc
CMD:ban(playerid, params[]) { // 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. (https://www.******.com.vc/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=ban%20commands%20samp%20forums)

BiosMarcel
11/12/2016, 12:58 PM
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. (https://www.******.com.vc/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=ban%20commands%20samp%20forums)

No need to call him an idiot, everyone makes mistakes.

ISmokezU
11/12/2016, 01:25 PM
Marcel;3812006']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?

BiosMarcel
11/12/2016, 01:31 PM
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.

ISmokezU
11/12/2016, 01:43 PM
Marcel;3812019']Er .... why the hell would anyone care about his/her gender ??? I don't get your point.

Point is that he's a girl.

BiosMarcel
11/12/2016, 02:13 PM
Point is that he's a girl.

How does it matter? Even if he/she'd be a cat, i wouldn't care, also doesn't anyone else here i think (you excluded, whyever that is so).

DJefferson
09/03/2018, 08:30 PM
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;
}

aoky
09/03/2018, 08:32 PM
Point is that he's a girl.

"he" is a girl... :confused::confused::confused::confused:

RogueDrifter
09/03/2018, 08:46 PM
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;
}
Wow seriously? lol...