if(strcmp(cmd, "/ban", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /ban [playerid/ParteDoNome] [motivo]");
return 1;
}
giveplayerid = ReturnUser(tmp);
new nome[24];
GetPlayerName(playerid, nome, sizeof nome);
if(PlayerInfo[playerid][pAdmin] >= 5 || strfind(nome, ADMPLAYER, true) == 0 || strfind(nome, ADMPLAYER2, true) == 0)
{
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;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /ban [playerid/ParteDoNome] [motivo]");
return 1;
}
new year, month,day;
getdate(year, month, day);
if(strfind(nome, ADMPLAYER, true) == 0 || strfind(nome, ADMPLAYER2, true) == 0)
{
format(string, sizeof(string), "|ADMIN|: %s foi banido por %s |Motivo: %s (%d-%d-%d)|", giveplayer, ADMMASTER, (result),month,day,year);
BanLog(string);
format(string, sizeof(string), "|ADMIN|: %s foi banido por %s |Motivo: %s|", giveplayer, ADMMASTER, (result));
SendClientMessageToAll(LARANJA1, string);
}
else
{
format(string, sizeof(string), "|ADMIN|: %s foi banido por %s |Motivo: %s (%d-%d-%d)|", giveplayer, sendername, (result),month,day,year);
BanLog(string);
format(string, sizeof(string), "|ADMIN|: %s foi banido por %s |Motivo: %s|", giveplayer, sendername, (result));
SendClientMessageToAll(LARANJA1, string);
}
Ban(giveplayerid);
return 1;
}
public OnPlayerConnect(playerid)
{
new String[128], Jogador[24];
GetPlayerName(playerid, Jogador, 24);
format(String, 128, "Bans/%s.ini",Jogador);
if(fexist(String))
{
SendClientMessage(playerid, 0x900000AA, "************************************************************************************************");
format(String, sizeof(String), "***** Vocк estб banido do servidor %s, se vocк quiser ser desbanido vб atй a comunidade chora emo! ****",Jogador), SendClientMessage(playerid,0xFF5868AA, String);
SendClientMessage(playerid, 0x900000AA, "************************************************************************************************");
Kick(playerid);
return true;
}
if(strcmp(cmd, "/ban", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "USE: /ban [playerid/ParteDoNome] [motivo]");
giveplayerid = ReturnUser(tmp);
new nome[24];
GetPlayerName(playerid, nome, sizeof nome);
if(PlayerInfo[playerid][pAdmin] >= 5 || strfind(nome, ADMPLAYER, true) == 0 || strfind(nome, ADMPLAYER2, true) == 0)
{
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;
if(!strlen(result)) return SendClientMessage(playerid, COLOR_GRAD2, "USE: /ban [playerid/ParteDoNome] [motivo]");
new year, month,day;
getdate(year, month, day);
if(strfind(nome, ADMPLAYER, true) == 0 || strfind(nome, ADMPLAYER2, true) == 0)
{
format(string, sizeof(string), "|ADMIN|: %s foi banido por %s |Motivo: %s (%d-%d-%d)|", giveplayer, ADMMASTER, (result),month,day,year);
BanLog(string);
format(string, sizeof(string), "|ADMIN|: %s foi banido por %s |Motivo: %s|", giveplayer, ADMMASTER, (result));
SendClientMessageToAll(LARANJA1, string);
}
else
{
format(string, sizeof(string), "|ADMIN|: %s foi banido por %s |Motivo: %s (%d-%d-%d)|", giveplayer, sendername, (result),month,day,year);
BanLog(string);
format(string, sizeof(string), "|ADMIN|: %s foi banido por %s |Motivo: %s|", giveplayer, sendername, (result));
SendClientMessageToAll(LARANJA1, string);
}
new String[20];
format(String, 20, "Bans/%s.ini",giveplayerid);
dini_Create(String);
Ban(giveplayerid);
return true;
}
new String[128], Jogador[24];
GetPlayerName(playerid, Jogador, 24);
format(String, 128, "Bans/%s.ini",Jogador);
if(fexist(String))
{
SendClientMessage(playerid, 0x900000AA, "************************************************************************************************");
format(String, sizeof(String), "***** Vocк estб banido do servidor %s, se vocк quiser ser desbanido vб atй a comunidade chora emo! ****",Jogador), SendClientMessage(playerid,0xFF5868AA, String);
SendClientMessage(playerid, 0x900000AA, "************************************************************************************************");
Kick(playerid);
}
return true;
}
new String[128], Jogador[24];
GetPlayerName(playerid, Jogador, 24);
format(String, 128, "Bans/%s.ini",Jogador);
if(fexist(String))
{
SendClientMessage(playerid, 0x900000AA, "************************************************************************************************");
format(String, sizeof(String), "***** Vocк estб banido do servidor %s, se vocк quiser ser desbanido vб atй a comunidade chora emo! ****",Jogador), SendClientMessage(playerid,0xFF5868AA, String);
SendClientMessage(playerid, 0x900000AA, "************************************************************************************************");
Kick(playerid);
return true;
}
new String[128], Jogador[24];
GetPlayerName(playerid, Jogador, 24);
format(String, 128, "Bans/%s.ini",Jogador);
if(fexist(String))
{
SendClientMessage(playerid, 0x900000AA, "************************************************************************************************");
format(String, sizeof(String), "***** Vocк estб banido do servidor %s, se vocк quiser ser desbanido vб atй a comunidade chora emo! ****",Jogador), SendClientMessage(playerid,0xFF5868AA, String);
SendClientMessage(playerid, 0x900000AA, "************************************************************************************************");
Kick(playerid);
return true;
}
pawn Код:
|
static
aaa[3] =
{
1,
2,
3
};