foreach(Player, i) { if(aInfo[playerid][Admin] == 1) { format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Administrador] %s (%d): %s", PlayerName(playerid), playerid, tmp); SendClientMessage(i, GetPlayerColor(playerid), gstring); } if(aInfo[playerid][Moderador] == 1) { format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Moderador] %s (%d): %s", PlayerName(playerid), playerid, tmp); SendClientMessage(i, GetPlayerColor(playerid), gstring); } else if(aInfo[playerid][Helper] == 1) { format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Helper] %s (%d): %s", PlayerName(playerid), playerid, tmp); SendClientMessage(i, GetPlayerColor(playerid), gstring); } else { if(pInfo[i][Prof] == pInfo[playerid][Prof]) { format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Nнvel %d] %s (%d): %s", pInfo[playerid][Level], PlayerName(playerid), playerid, tmp); SendClientMessage(i, GetPlayerColor(playerid), gstring); } } }
foreach(Player, i) { if(aInfo[playerid][Admin] == 1) { format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Administrador] %s (%d): %s", PlayerName(playerid), playerid, tmp); SendClientMessage(i, GetPlayerColor(playerid), gstring); } if(aInfo[playerid][Moderador] == 1) { format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Moderador] %s (%d): %s", PlayerName(playerid), playerid, tmp); SendClientMessage(i, GetPlayerColor(playerid), gstring); } else if(aInfo[playerid][Helper] == 1) { format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Helper] %s (%d): %s", PlayerName(playerid), playerid, tmp); SendClientMessage(i, GetPlayerColor(playerid), gstring); } else if { if(pInfo[i][Prof] == pInfo[playerid][Prof]) { format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Nнvel %d] %s (%d): %s", pInfo[playerid][Level], PlayerName(playerid), playerid, tmp); SendClientMessage(i, GetPlayerColor(playerid), gstring); } } }
aInfo[i][Admin] == 1
vocк esta usando o loop para correr os ids certo ? entгo no lugar de playerid vocк colocar "i" que recebe o valor no loop se nгo apenas vai correr o id do player que digitar.
PHP код:
|
foreach(Player, i)
{
if(aInfo[playerid][Admin] == 1)
format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Administrador] %s (%d): %s", PlayerName(playerid), playerid, tmp);
else if(aInfo[playerid][Moderador] == 1)
format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Moderador] %s (%d): %s", PlayerName(playerid), playerid, tmp);
else if(aInfo[playerid][Helper] == 1)
format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Helper] %s (%d): %s", PlayerName(playerid), playerid, tmp);
else
{
if(pInfo[i][Prof] == pInfo[playerid][Prof])
{
format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Nнvel %d] %s (%d): %s", pInfo[playerid][Level], PlayerName(playerid), playerid, tmp);
}
}
SendClientMessage(i, -1, gstring);
}
foreach(Player, i)
{
if(aInfo[i][Admin] == 1)
{
format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Administrador] %s (%d): %s", PlayerName(i), i, tmp);
SendClientMessage(playerid, GetPlayerColor(i), gstring);
}
if(aInfo[i][Moderador] == 1)
{
format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Moderador] %s (%d): %s", PlayerName(i), i, tmp);
SendClientMessage(playerid, GetPlayerColor(i), gstring);
}
else if(aInfo[i][Helper] == 1)
{
format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Helper] %s (%d): %s", PlayerName(i), i, tmp);
SendClientMessage(playerid, GetPlayerColor(i), gstring);
}
else if
{
if(pInfo[i][Prof] == pInfo[playerid][Prof] && !aInfo[i][Admin] && !aInfo[i][Moderador] && !aInfo[i][Helper])
{
format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Nнvel %d] %s (%d): %s", pInfo[i][Level], PlayerName(i), i, tmp);
SendClientMessage(playerid, GetPlayerColor(i), gstring);
}
}
}
PHP код:
|
Deu certo. Obrigado. Qual foi a mudanзa?
@Whoo Seu cуdigo acabou que o pawno parou de funcionar. |
foreach(Player, i)
{
if(aInfo[playerid][Admin] == 1)
{
format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Administrador] %s (%d): %s", PlayerName(playerid), playerid, tmp);
SendClientMessage(i, GetPlayerColor(playerid), gstring);
}
if(aInfo[playerid][Moderador] == 1)
{
format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Moderador] %s (%d): %s", PlayerName(playerid), playerid, tmp);
SendClientMessage(i, GetPlayerColor(playerid), gstring);
}
else if(aInfo[playerid][Helper] == 1)
{
format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Helper] %s (%d): %s", PlayerName(playerid), playerid, tmp);
SendClientMessage(i, GetPlayerColor(playerid), gstring);
}
else
{
if(pInfo[i][Prof] == pInfo[playerid][Prof])
{
format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Nнvel %d] %s (%d): %s", pInfo[playerid][Level], PlayerName(playerid), playerid, tmp);
SendClientMessage(i, GetPlayerColor(playerid), gstring);
}
}
}
foreach(Player, i)
{
if(aInfo[playerid][Admin] == 1)
format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Administrador] %s (%d): %s", PlayerName(playerid), playerid, tmp);
else if(aInfo[playerid][Moderador] == 1)
format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Moderador] %s (%d): %s", PlayerName(playerid), playerid, tmp);
else if(aInfo[playerid][Helper] == 1)
format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Helper] %s (%d): %s", PlayerName(playerid), playerid, tmp);
else
{
if(pInfo[i][Prof] == pInfo[playerid][Prof])
{
format(gstring, sizeof(gstring), "{009999}({009966}Canal /n{009999}) [Nнvel %d] %s (%d): %s", pInfo[playerid][Level], PlayerName(playerid), playerid, tmp);
}
}
SendClientMessage(i, -1, gstring);
}