17.03.2013, 08:23
Cara, eu sу quero que quando eu der o comando aparecer para quem foi kickado " Vocк foi kickado motivo: ex " e para o resto do server a mensagem que o admin kickou, mas o code ta certo, sу aparece pro quem foi kickado, Closed server ...
Код:
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), "| INFO-SERVER | O Moderador %s kickou o jogador: %s (Motivo: %s)", aname,pname,result); SendClientMessageToAll(C_G, string); kick[plid]=1; SetPlayerColor(plid,0xFFFFFFAA); Kick(plid); return 1; } 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; }