Код:
if(strcmp(cmd, "/ban", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 1337 && PlayerInfo[playerid][pAdmin] <= 12000)
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ban [playerid/PartOfName] [reason]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
giveplayerid = ReturnUser(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playa][pAdmin] >= 1338 && PlayerInfo[playa][pAdmin] <= 12000)
{
SendClientMessage(playerid, COLOR_GREY, " That player cannot be banned.");
format(string, 256, "AdmWarning: %s incearca comanda /ban pe %s. dar nu reuseste pentru ca are admin cu imunitate (5000 - 9000)", sendername, giveplayer);
ABroadCast(COLOR_YELLOW,string,1);
return 1;
}
if (PlayerInfo[playerid][pAdmin] >= 1337 && PlayerInfo[playerid][pAdmin] <= 12000)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
for(new s = 0; s < num_words; s++)
{
new pos;
while((pos = strfind(result,Swears[s],true)) != -1) for(new i = pos, j = pos + strlen(Swears[s]); i < j; i++)
{
result[i] = '*';
}
}
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ban [playerid/PartOfName] [reason]");
return 1;
}
new targetid;
new accounts = PlayerInfo[targetid][pAccount];
new respect = PlayerInfo[targetid][pExp];
new levels = PlayerInfo[targetid][pLevel];
new warnws = PlayerInfo[targetid][pWarns];
new year, month,day;
getdate(year, month, day);
new hour,minuite,sec;
gettime(hour,minuite,sec);
format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
BanLog(string);
format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
PlayerInfo[giveplayerid][pAdmin] = PlayerInfo[giveplayerid][pLevel];
PlayerInfo[giveplayerid][pLevel] = -999;
new plrIP[16];
GetPlayerIp(giveplayerid,plrIP, sizeof(plrIP));
SendClientMessage(playa,COLOR_YELLOW,"* BAN INFO ->");
format(string, sizeof(string), "* Numele tau: %s, Level: [%d], Respect Points: [%d], Bank: [$%d], Warns: [%d]", giveplayer, levels, respect, accounts, warnws);
SendClientMessage(playa, COLOR_PURPLE, string);
format(string, sizeof(string), "* Ai fost banat de catre adminul: %s", sendername);
SendClientMessage(playa, COLOR_PURPLE, string);
format(string, sizeof(string), "* Ai fost banat pentru urmatorul motiv: %s.", (result));
SendClientMessage(giveplayerid, COLOR_PURPLE, string);
format(string, sizeof(string), "* IP-ul tau este: %s.", plrIP);
SendClientMessage(giveplayerid, COLOR_PURPLE, string);
format(string, sizeof(string), "* Data la care ai luat banul: (%02d-%d-%d), (%02d:%02d:%02d)", day, month, year, hour, minuite, sec);
SendClientMessage(playa, COLOR_PURPLE, string);
SendClientMessage(playa,COLOR_YELLOW,"* Unban ->");
SendClientMessage(playa,COLOR_LIGHTRED,"* Poti face o cerere pentru unban pe forumul nostru www.Cyber-Network.ro");
SendClientMessage(playa,COLOR_LIGHTRED,"* Fa o poza la aceste informatii, o postezi cand faci cererea de unban .Apasa F8 pentru a face poza");
Ban(giveplayerid);
return 1;
}
}//not connected
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
i hope 60000 is 1 minute...