if(strcmp(cmd,"/onmudarnick",true)==0) { if(IsPlayerConnected(playerid)) { if(AdminTrabalhando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1340 && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1341) { SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USE: /onmudarnick [ id ]"); return 1; } new playa; playa = ReturnUser(tmp); if (PlayerInfo[playerid][pAdmin] >= 1337) { if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { PodeMudarNick[playa] = 1; GetPlayerName(playa, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "Admin %s: Autorizou vocк a mudar o nick, digite /mudarnick.", sendername); SendClientMessage(playa, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "ADMIN CMD: %s autorizou %s a mudar o nick !",sendername,giveplayer); ABroadCast(COLOR_LIGHTRED,string,1); } } } else { SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб autorizado a usar este comando!"); return 1; } } return 1; } if(strcmp(cmd, "/offmudarnick", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] >= 1337) { if(AdminTrabalhando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1340 && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1341) { SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USE: /offmudarsenha [id]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { PodeMudarNick[giveplayerid] = 0; GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "Admin %s : Tirou sua permissгo para mudar de nick.", sendername); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "ADMIN CMD: %s tirou a permissгo de %s para mudar o nick !",sendername,giveplayer); ABroadCast(COLOR_LIGHTRED,string,1); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "O Jogador Estб Offline !"); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб autorizado a usar este comando !"); return 1; } } return 1; }
if(strcmp(cmd,"/onmudarnick",true)==0)
{
if(!IsPlayerConnected(playerid)) return 1;
if(AdminTrabalhando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1340 && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1341) return SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "USE: /onmudarnick [ id ]");
new playa = ReturnUser(tmp);
if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб autorizado a usar este comando!");
if(!IsPlayerConnected(playa)) return SendClientMessage(playerid, COLOR_GRAD2, "Este player nao esta conectado");
if(playa == INVALID_PLAYER_ID) return 1;
PodeMudarNick[playa] = 1;
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Admin %s: Autorizou vocк a mudar o nick, digite /mudarnick.", sendername);
SendClientMessage(playa, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "ADMIN CMD: %s autorizou %s a mudar o nick !",sendername,giveplayer);
ABroadCast(COLOR_LIGHTRED,string,1);
return 1;
}
if(strcmp(cmd, "/offmudarnick", true) == 0)
{
if(!IsPlayerConnected(playerid)) return 1;
if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб autorizado a usar este comando !");
if(AdminTrabalhando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1340 && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1341) return SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USE: /offmudarsenha [id]");
giveplayerid = ReturnUser(tmp);
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "O Jogador Estб Offline !");
if(giveplayerid == INVALID_PLAYER_ID) return 1;
PodeMudarNick[giveplayerid] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Admin %s : Tirou sua permissгo para mudar de nick.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "ADMIN CMD: %s tirou a permissгo de %s para mudar o nick !",sendername,giveplayer);
ABroadCast(COLOR_LIGHTRED,string,1);
return 1;
}
Nos seus comandos sу vi desperdнcios de linhas, Melhore seus cуdigos o Compilador agradece!
De 87 (linhas) para 38 (linhas) PHP код:
|