pawn Код:
if(strcmp(cmd, "/ban", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /ban [id] [motivo]");
return true;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pAdmin] >= 3001)
{
SendClientMessage(playerid, COLOR_GRAD1, "{FFEA00}[{00FF00}INFO{FFEA00}] Vocк nгo pode banir este admin!");
return true;
}
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;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /ban [id] [motivo]");
return true;
}
getdate(year, month, day);
if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
{
format(string, sizeof(string), "AdmCmd: %s foi banido por %s, Motivo: %s (%d-%d-%d)", giveplayer, sendername, (result),day,month,year);
BanLog(string);
format(string, sizeof(string), "AdmCmd: %s foi banido por %s, Motivo: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
}
else
{
format(string, sizeof(string), "AdmCmd: %s foi banido por %s, Motivo: %s (%d-%d-%d)", giveplayer, sendername, (result),day,month,year);
BanLog(string);
format(string, sizeof(string), "AdmCmd: %s foi banido por %s, Motivo: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
}
PlayerInfo[giveplayerid][pBan] = 1;
TextDrawShowForPlayer(giveplayerid, TextBan[giveplayerid]);
SBan(giveplayerid, result, PlayerName(playerid));
return true;
}
}//not connected
}
else
{
QQIssoNovinha;
}
}
return true;
}
"{FFEA00}[{00FF00}INFO{FFEA00}] O player {00FF00}%s {FFEA00}foi banido por {00FF00}%s{FFEA00}, Motivo: {00FF00}%s {FFEA00}({00FF00}%d-%d-%d{FFEA00})", giveplayer, sendername, (result),day,month,year);