[Ajuda] Cmd dando erro!
#3

Quote:

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;
}

Tente mudar pra isso ai
Reply


Messages In This Thread
Cmd dando erro! - by Jorge_Braz - 18.05.2013, 20:25
Re: Cmd dando erro! - by Jorge_Braz - 18.05.2013, 20:36
Re: Cmd dando erro! - by JackStenzel - 18.05.2013, 21:33
Re: Cmd dando erro! - by feliphemort - 18.05.2013, 21:49
Re: Cmd dando erro! - by SkullFire - 19.05.2013, 03:41
Re: Cmd dando erro! - by Ley - 19.05.2013, 07:14

Forum Jump:


Users browsing this thread: 1 Guest(s)