30.07.2011, 18:58
or u can use it just like this:
if u have not tuped any word after playerid u cant ban that player xD
ignore the dini xD
pawn Код:
CMD:banid(playerid, params[])
{
if(IsPlayerAdmin2[playerid] == 2)
{
new targetid, reason[64], name[24], msg[64];
if(sscanf(params, "us[64]", targetid, reason)) return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /banid <playerid> <reason>");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, "That player is not connected");
GetPlayerName(targetid, name, sizeof(name));
format(msg, sizeof(msg), "%s (%d) was banned. Reason: %s", name, targetid, reason);
SendClientMessageToAll(COLOR_RED, msg);
if(GetPVarInt(targetid, "Logged"))
{
new filename[64];
format(filename, sizeof(filename), "MaceRP/users/%s.ini", PlayerName(targetid));
dini_IntSet(filename, "Banned", 1);
}
BanEx(targetid, reason);
GameTextForPlayer(targetid, "You has been banned", 4000, 3);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You can't use this command.");
return 1;
}
}
ignore the dini xD