17.11.2012, 00:02
Como eu faco para impedir de kick/Ban felipe_mr ??
pawn Код:
if(strcmp(cmd, "/ban", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
MSGPLAYER(playerid, COLOR_GRAD2, "USE: /ban [id] [motivo]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 4)
{
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1341)
{
MSGPLAYER(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/pa)");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pAdmin] >= 1340)
{
MSGPLAYER(playerid, COLOR_GRAD1, "Vocк nгo pode banir um Admin Dono !");
return 1;
}
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))
{
MSGPLAYER(playerid, COLOR_GRAD2, "USE: /ban [id] [motivo]");
return 1;
}
getdate(year, month, day);
if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
{
format(string, sizeof(string), "{FF0000}AdmCmd: {FFFFFF}%s {FF0000}foi Banido pelo Admin {FFFFFF}ADMIN_BOOT(ModoCia), {FF0000}Motivo: {00FA9A}%s (%d-%d-%d)", giveplayer,(result),day,month,year);
BanLog(string);
format(string, sizeof(string), "{FF0000}AdmCmd: {FFFFFF}%s {FF0000}foi Banido pelo Admin {FFFFFF}ADMIN_BOOT, {FF0000}Motivo: {00FA9A}%s", giveplayer,(result));
MSGPARATODOS(COLOR_LIGHTRED, string);
}
else
{
pban[playerid] += 1;
if(pban[playerid] >= 3)
{
SBan(playerid, "Baniu mais de 3", "Automatico");
return 1;
}
format(string, sizeof(string), "{FF0000}AdmCmd: {FFFFFF}%s {FF0000}foi Banido pelo Admin {FFFFFF}%s, {FF0000}Motivo: {00FA9A}%s (%d-%d-%d)", giveplayer, sendername, (result),day,month,year);
BanLog(string);
format(string, sizeof(string), "{FF0000}AdmCmd: {FFFFFF}%s {FF0000}foi Banido pelo Admin {FFFFFF}%s, {FF0000}Motivo: {00FA9A}%s", giveplayer, sendername, (result));
MSGPARATODOS(COLOR_LIGHTRED, string);
}
MSGPLAYER(giveplayerid, COLOR_GRAD2, "(=-=-=-=-=-=-=-=-=-==(Instruзхes para revisгo de Ban{BFC0C2})=-=-=-=-=-=-=-=-=-==|");
MSGPLAYER(giveplayerid, COLOR_YELLOW2, "Tire uma SS da tela apertando F8 imediatamente apуs ser banido");
MSGPLAYER(giveplayerid, COLOR_YELLOW2, "E acesse o nosso forum: http://br-bpl.forumfacil.net/");
MSGPLAYER(giveplayerid, COLOR_LIGHTRED, "Atenзгo: Vocк sу serб desbanido caso for inocente");
//Ban(giveplayerid);
SBan(giveplayerid, result, sendername);
return 1;
}
}//not connected
}
else
{
MSGPLAYER(playerid, COLOR_GRAD1, " Esse nгo й um jogador ativo.");
}
}
return 1;
}
if(strcmp(cmd, "/kick", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
MSGPLAYER(playerid, COLOR_GRAD2, "USE: /kick [Id Do Jogador] [motivo]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1341)
{
MSGPLAYER(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/pa)");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pAdmin] >= 1340 && PlayerInfo[playerid][pAdmin] < 1338)
{
MSGPLAYER(playerid, COLOR_GRAD1, "Vocк nгo pode kickar um Admin Dono !");
return 1;
}
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))
{
MSGPLAYER(playerid, COLOR_GRAD2, "USE: /kick [Id Do Jogador] [motivo]");
return 1;
}
getdate(year, month, day);
if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
{
format(string, sizeof(string), "{FF0000}AdmCmd: {FFFFFF}%s {FF0000}foi kickado pelo Admin {FFFFFF}ADMIN_BOOT(ModoCia), {FF0000}Motivo: {00FA9A}%s (%d-%d-%d)", giveplayer, (result),day,month,year);
KickLog(string);
format(string, sizeof(string), "{FF0000}AdmCmd: {FFFFFF}%s {FF0000}foi kickado pelo Admin {FFFFFF}ADMIN_BOOT, {FF0000}Motivo: {00FA9A}%s", giveplayer, (result));
MSGPARATODOS(COR_GRO, string);
}
else
{
format(string, sizeof(string), "{FF0000}AdmCmd: {FFFFFF}%s {FF0000}foi kickado pelo Admin {FFFFFF}%s, {FF0000}Motivo: {00FA9A}%s (%d-%d-%d)", giveplayer, sendername, (result),day,month,year);
KickLog(string);
format(string, sizeof(string), "{FF0000}AdmCmd: {FFFFFF}%s {FF0000}foi kickado pelo Admin {FFFFFF}%s, {FF0000}Motivo: {00FA9A}%s", giveplayer, sendername, (result));
MSGPARATODOS(COR_GRO, string);
}
Kick(giveplayerid);
return 1;
}
}
}
else
{
MSGPLAYER(playerid, COLOR_GRAD1, " Esse nгo й um jogador ativo.");
}
}
return 1;
}