24.07.2013, 21:15
Fala aк galera to ai mais uma vez incomodando vcs, seguinte: jб tentei de diversas formas que o /kick e o /ban ANTES de dar "server closed conection" aparece para o player que ele foi banido/kickado e o motivo. Mas nunca dб certo e antes de ele poder ver a msg de ban/kick ele sai do sv primeiro.
Alguem me ajuda a ver o q estб errado? vlw
/kick:
/ban
Alguem me ajuda a ver o q estб errado? vlw
/kick:
pawn Код:
if(strcmp(cmd, "/kick", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 1 || pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5 || IsPlayerAdmin(playerid)){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "Digite: /kick [id] [motivo]");
return 1;
}
plid = strval(tmp);
if(IsPlayerConnected(plid)){
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, Vermelho, "Uso: /kick [id] [motivo]");
}else{
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
if(pAdmin[playerid] == 1){
format(string, sizeof(string), "[KICK]%s kickou %s, Motivo: (%s)", aname, pname);
MsgLog(string);
format(string, sizeof(string), "| INFO-SERVER | O Administrador %s kickou o jogador: %s (Motivo: %s)", aname,pname,result);
SendClientMessageToAll(AdminCor, string);
kick[plid]=1;
SetPlayerColor(plid,0xFFFFFFAA);
Kick(plid);
return 1;
}
format(string, sizeof(string), "[KICK]%s kickou %s, Motivo: (%s)", aname, pname);
MsgLog(string);
format(string, sizeof(string), "| INFO-SERVER | O Administrador %s kickou o jogador: %s (Motivo: %s)", aname,pname,result);
SendClientMessageToAll(AdminCor, string);
kick[plid]=1;
SetPlayerColor(plid,0xFFFFFFAA);
Kick(plid);
}
}else{
format(string, sizeof(string), "** ID invбlido!", plid);
SendClientMessage(playerid, Vermelho, string);
}
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/ban", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5 || IsPlayerAdmin(playerid)){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "Uso: /ban [id] [motivo]");
return 1;
}
plid = strval(tmp);
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
if(IsPlayerConnected(plid)){
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, Vermelho, "Uso: /ban [id] [motivo]");
}else{
new year, month,day;
getdate(year, month, day);
if(pAdmin[playerid]== 1){
format(string, sizeof(string), "| INFO-SERVER | O Moderador %s baniu o jogador %s (Motivo: %s)", aname,pname,result);
SendClientMessageToAll(AdminCor, string);
format(string,sizeof string,"%s(ID: %d) saiu do servidor. (Kickado/Banido)",aname, playerid);
SendClientMessageToAll(0xA6A6A6AA, string);
dini_IntSet("banidos.ini",pname,1);
Ban(plid);
}
format(string, sizeof(string), "| INFO-SERVER |O Administrador %s baniu o jogador: %s. (Motivo: %s)", aname, pname,result,month,day,year);
BanLog(string);
GameTextForPlayer(plid,"~r~banido", 2500, 3);
format(string, sizeof(string), "| INFO-SERVER | O Administrador %s baniu o jogador: %s. (Motivo: %s)", aname,pname,result);
SendClientMessageToAll(tcadm, string);
dini_IntSet("banidos.ini",pname,1);
SetPlayerPos(plid, 831.9581,-1102.1510,24.2969);
GameTextForPlayer(plid,"~r~banido~w~!", 2500, 3);
SendClientMessage(plid, Vermelho, "* Vocк foi banido do servidor!");
Ban(plid);
}
}else{
format(string, sizeof(string), "| ERRO | ID : %d nгo й valido!", plid);
SendClientMessage(playerid, Vermelho, string);
}
}
return 1;
}