if(strcmp(cmd, "/kickar", true) == 0)
{
new tmp[256];
new tmp2[256];
new nome[MAX_PLAYER_NAME];
new nomeid[MAX_PLAYER_NAME];
tmp = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
if(strlen(tmp))
{
if(strlen(tmp2))
{
if(IsPlayerConnected(strval(tmp)))
{
GetPlayerName(playerid, nome, sizeof(nome));
GetPlayerName(strval(tmp), nomeid, sizeof(nomeid));
format(string, sizeof(string), "O administrador %s kickou o jogador %s, motivo: %s", nome, nomeid, strval(tmp2));
SendClientMessageToAll(laranja, string);
Kick(strval(tmp));
}
else
{
SendClientMessage(playerid, amarelo, "Jogador nгo conectado.");
}
}
else
{
SendClientMessage(playerid, amarelo, "Use : /kickar [playerid] [razгo]");
}
}
else
{
SendClientMessage(playerid, amarelo, "Use : /kickar [playerid] [razгo]");
}
return 1;
}
if(strcmp(cmd, "/kickar", true) == 0)
{
new nome[MAX_PLAYER_NAME];
new nomeid[MAX_PLAYER_NAME];
tmp = strtok(cmdtext, idx);
if(strlen(tmp))
{
if(IsPlayerConnected(strval(tmp)))
{
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: /kickar [playerid] [razгo]");
return 1;
}
GetPlayerName(playerid, nome, sizeof(nome));
GetPlayerName(strval(tmp), nomeid, sizeof(nomeid));
format(string, sizeof(string), "O administrador %s kickou o jogador %s, motivo: %s", nome, nomeid, (result));
SendClientMessageToAll(COLOR_WHITE, string);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Jogador nгo conectado.");
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Use : /kickar [playerid] [razгo]");
}
return 1;
}
Puts mano, sincera mente eu me mordo de raiva quando vejo uma coisa dessa.
|
if(strcmp(cmd, "/kickar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /kickar [Id Do Jogador] [motivo]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(admintrabalhando[playerid] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
return 1;
}
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: /kickar [Id Do Jogador] [motivo]");
return 1;
}
new year, month,day;
getdate(year, month, day);
format(string, sizeof(string), "ADMIN CMD: %s Foi kickado by %s, Motivo: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
KickLog(string);
format(string, sizeof(string), "ADMIN CMD: %s Foi Kickado by %s, Motivo: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
Kick(giveplayerid);
return 1;
}
}
}
else
{
format(string, sizeof(string), " %d Nгo estб on.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
if(strcmp(cmd, "/kickar", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
new tmp[256], id, msg[256], pname[MAX_PLAYER_NAME], nome[MAX_PLAYER_NAME];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, 0xFFFF00AA, "(x) Use: /kickar [id] [motivo].");
id = strval(tmp);
if(IsPlayerConnected(id))
{
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, 0xFFFF00AA, "(x) Use: /kickar [id] [motivo].");
//-
GetPlayerName(playerid, pname, sizeof(pname));
GetPlayerName(id, nome, sizeof(nome));
format(msg, 256, "(ADMIN) O Administrador %s (%d) kickou o player %s (%d).", pname, playerid, nome, id);
SendClientMessageToAll(0x8080C0AA, msg);
format(msg, 256, "(ADMIN) Vocк foi kikado pelo administrador %s (%d).", pname, playerid);
SendClientMessage(id, 0xFF8040AA, msg);
Kick(id);
return 1;
}
else
SendClientMessage(playerid, 0xFF0000AA, "(ERRO) Player nгo conectado.");
return 1;
}
else
SendClientMessage(playerid, 0xFF0000AA, "(ERRO) Vocк nгo tem permissгo.");
return 1;
}
CMD:kick( playerid, params[ ] ) { new ID, string[128], motivo[66], pAdmin[MAX_PLAYER_NAME], pKickado[MAX_PLAYER_NAME]; if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COR,"Vocк nгo й Administrador!"); if(sscanf(params, "us[65]", ID, motivo)) return SendClientMessage(playerid, COR, "Use: /kick [ID] [Motivo]"); if(IsPlayerConnected(ID) && ID != INVALID_PLAYER_ID && ID != playerid) { GetPlayerName(playerid, pAdmin, MAX_PLAYER_NAME); GetPlayerName(ID, pKickado, MAX_PLAYER_NAME); format(string, sizeof(string), "O Administrador '%s' kickou '%s, Motivo: %s",pAdmin,pKickado,motivo); SendClientMessageToAll(COR,string); Kick(ID); } else return SendClientMessage(playerid, COR, "Jogador desconectado ou й vocк mesmo") }