[AJUDA] Comando /membros -
Chis - 25.04.2012
pawn Код:
CMD:membros(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COR_DARK, "::_____| MEMBROS ONLINE |_____:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(Player[i][Membro] == 0)
{
SendClientMessage(playerid, COR_AMARELO, "Vocк nгo faz parte de uma Organizaзгo.");
}
if(Player[i][Membro] == 1)
{
if(Player[i][Cargo] == 1) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|1| Soldado %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes); }
else if(Player[i][Cargo] == 2) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|2| Cabo %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes); }
else if(Player[i][Cargo] == 3) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|3| Sargento %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes); }
else if(Player[i][Cargo] == 4) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|4| Major %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes); }
else if(Player[i][Cargo] == 5) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|5| Ten. Coronel %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes); }
else if(Player[i][Cargo] == 6) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|6| Coronel %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes); }
}
if(Player[i][Membro] == 2)
{
if(Player[i][Cargo] == 1) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|1| Laranja %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes);}
else if(Player[i][Cargo] == 2) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|2| Fogueteiro %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes);}
else if(Player[i][Cargo] == 3) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|3| Traficante %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes);}
else if(Player[i][Cargo] == 4) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|4| Rei do Trafico %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes);}
else if(Player[i][Cargo] == 5) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|5| Comandante Geral %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes);}
else if(Player[i][Cargo] == 6) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|6| Chefгo %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes);}
}
}
}
}
return 1;
}
Quando eu dou /membros, mesmo o outro player sendo de outra org, ele aparece no /membros, como corrijo isso?
Re: [AJUDA] Comando /membros -
Don_Speed - 25.04.2012
pawn Код:
CMD:membros(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COR_DARK, "::_____| MEMBROS ONLINE |_____:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(Player[i][Membro] == 0)
{
SendClientMessage(playerid, COR_AMARELO, "Vocк nгo faz parte de uma Organizaзгo.");
}
if(Player[i][Membro] == 1)
{
if(Player[i][Cargo] == 1) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|1| Soldado %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes); }
if(Player[i][Cargo] == 2) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|2| Cabo %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes); }
if(Player[i][Cargo] == 3) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|3| Sargento %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes); }
if(Player[i][Cargo] == 4) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|4| Major %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes); }
if(Player[i][Cargo] == 5) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|5| Ten. Coronel %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes); }
if(Player[i][Cargo] == 6) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|6| Coronel %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes); }
}
if(Player[i][Membro] == 2)
{
if(Player[i][Cargo] == 1) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|1| Laranja %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes);}
if(Player[i][Cargo] == 2) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|2| Fogueteiro %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes);}
if(Player[i][Cargo] == 3) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|3| Traficante %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes);}
if(Player[i][Cargo] == 4) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|4| Rei do Trafico %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes);}
if(Player[i][Cargo] == 5) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|5| Comandante Geral %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes);}
if(Player[i][Cargo] == 6) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 256, "|6| Chefгo %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes);}
}
}
}
}
return 1;
}
Respuesta: [AJUDA] Comando /membros -
Chis - 26.04.2012
Deu nгo cara,
se estiver dois players no servidor da isso:
___MEMBROS____
Chis (0)
Vocк nгo faz parte de uma Organizaзгo.
Agora se sу tiver 1 player fica normal
___MEMBROS____
Chis (0)
Re: [AJUDA] Comando /membros -
ViniBorn - 26.04.2012
Vocк pode melhorar muito esse cуdigo ;s
pawn Код:
CMD:membros(playerid, params[])
{
if(Player[playerid][Membro] == 0)
return SendClientMessage(playerid, COR_AMARELO, "Vocк nгo faz parte de uma Organizaзгo.");
SendClientMessage(playerid, COR_DARK, "::_____| MEMBROS ONLINE |_____:");
for(new i, j = GetMaxPlayers(); i != j; i++)
{
if(IsPlayerConnected(i))
{
if(Player[playerid][Membro] != Player[i][Membro])
continue;
if(Player[i][Membro] == 1)
{
if(Player[i][Cargo] == 1) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 64, "|1| Soldado %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes); }
else if(Player[i][Cargo] == 2) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 64, "|2| Cabo %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes); }
else if(Player[i][Cargo] == 3) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 64, "|3| Sargento %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes); }
else if(Player[i][Cargo] == 4) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 64, "|4| Major %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes); }
else if(Player[i][Cargo] == 5) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 64, "|5| Ten. Coronel %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes); }
else if(Player[i][Cargo] == 6) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 64, "|6| Coronel %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes); }
}
if(Player[i][Membro] == 2)
{
if(Player[i][Cargo] == 1) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 64, "|1| Laranja %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes);}
else if(Player[i][Cargo] == 2) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 64, "|2| Fogueteiro %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes);}
else if(Player[i][Cargo] == 3) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 64, "|3| Traficante %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes);}
else if(Player[i][Cargo] == 4) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 64, "|4| Rei do Trafico %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes);}
else if(Player[i][Cargo] == 5) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 64, "|5| Comandante Geral %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes);}
else if(Player[i][Cargo] == 6) { GetPlayerName(i, nome, sizeof(nome)); format(stringes, 64, "|6| Chefгo %s (%d)", nome, playerid); SendClientMessage(playerid, COR_AMARELO, stringes);}
}
}
}
return 1;
}
Respuesta: [AJUDA] Comando /membros -
Chis - 26.04.2012
Obrigado vini +rep quando puder