CMD:ban(playerid, params[])
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi mai intai.");
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 3)
{
new id,reason[128],string[200],giveplayer[30],sendername[30],Type,str[128];
if(sscanf(params, "uds[128]", id,Type,reason)) return SCM(playerid,COLOR_DS,"{B8DBFF}Syntax: /ban <Name/Playerid> <Type(1-account 2-permanent)> <reason>");
if(IsPlayerConnected(id))
{
if(id != INVALID_PLAYER_ID)
{
GetPlayerName(id, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(Type == 1)
{
if(id == playerid) return SendClientMessage(playerid, -1, "Nu te poti bana singur!");
format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", giveplayer, sendername, reason);
SendClientMessageToAll(COLOR_LIGHTRED, string);
PlayerInfo[id][pBanned] = 1;
SendClientMessage(id,COLOR_LIGHTRED,"[BAN INFO]: Poti face o cerere de unban pe forumul nostru.Forumul este http:.");
SendClientMessage(id,COLOR_LIGHTRED,"[HINT]: Te sfatuim sa faci o poza la aceste informatii,si sa o postezi cand faci cerere unban.Apasa F8 pentru a face poza.");
format(str,sizeof(str),"UPDATE users SET `Banned`='1' WHERE `name`='%s'",giveplayer);
mysql_query(SQL,str);
new ip[25];
GetPlayerIp(id, ip, sizeof(ip));
Banlog(ip,PlayerInfo[id][pSQLID],PlayerInfo[playerid][pSQLID],reason,0);
KickEx(id);
}
else if(Type == 2)
{
if(id == playerid) return SendClientMessage(playerid, -1, "Nu te poti bana singur!");
format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", giveplayer, sendername, reason);
SendClientMessageToAll(COLOR_LIGHTRED, string);
new giveplayerid;
if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_ERROR, "You cannot ban yourself.");
PlayerInfo[id][pBanned] = 1;
SendClientMessage(id,COLOR_LIGHTRED,"[BAN INFO]: Poti face o cerere de unban pe forumul nostru.Forumul este http://.");
SendClientMessage(id,COLOR_LIGHTRED,"[HINT]: Te sfatuim sa faci o poza la aceste informatii,si sa o postezi cand faci cerere unban.Apasa F8 pentru a face poza.");
format(str,sizeof(str),"UPDATE users SET `Banned`='1' WHERE `name`='%s'",giveplayer);
mysql_query(SQL,str);
new ip[25];
GetPlayerIp(id, ip, sizeof(ip));
Banlog(ip,PlayerInfo[id][pSQLID],PlayerInfo[playerid][pSQLID],reason,0);
Ban(id);
}
return 1;
}
}
else return SendClientMessage(playerid, COLOR_DS, "{FFFFCC}Error: Player not connected.");
}
else return SendClientMessage(playerid, COLOR_DS, AdminOnly);
}
return 1;
}
Poftim, trebuia sa adaugi if(id == playerid) return SendClientMessage(playerid, -1, "Nu te poti bana singur!");