16.12.2012, 00:13
Queria um cуdigo que carrega os avisos dos players e quando atinge o limite de avisos й banido = Limite 10.
Код:
if(strcmp(cmd, "/aviso", 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){ new tmp[256]; new plid; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, Vermelho, "** Use: /aviso [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, "** Use: /aviso [id] [motivo]"); }else{ aviso[plid]+=1; if(aviso[plid]>= 3){ format(string, sizeof(string), "{F81414}{FFFFFF} %s foi kickado por receber 3 puniзхes.",pname); SendClientMessageToAll(0x007FFFAA, string); kick[plid]=1; SetPlayerColor(plid,0xFFFFFFAA); kick(plid); } if(pAdmin[playerid] == 1){ format(string, sizeof(string), "* O moderador %s avisou o jogador %s, Motivo:( %s ), ( %d/3 )", aname,pname,result,aviso[plid]); SendClientMessageToAll(0x007FFFAA, string); return 1; } format(string, sizeof(string), "[BAV-Admin] O administrador(a) %s avisou o jogador %s, Motivo:( %s ), ( %d/3 )", aname,pname,result,aviso[plid]); SendClientMessageToAll(0x007FFFAA, string); } }else{ format(string, sizeof(string), " ** ID %d invбlido!", plid); SendClientMessage(playerid, Vermelho, string); } } return 1; }