new PlayerText:NoPosto[3][MAX_PLAYERS];
new Float:CoordPostos[3][3] = {
{2115.5330,928.2172,10.8203},
{1936.8785,-1769.0784,13.3828},
{2557.9978,2194.5671,10.8203}
};
forward Locais(playerid);
public Locais(playerid)
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(playerid))
{
for(new y=0; y < sizeof(CoordPostos); y++)
{
if(IsPlayerInRangeOfPoint(playerid,15.0,CoordPostos[y][0],CoordPostos[y][1],CoordPostos[y][2]))
{
for( new text; text != 3; text++) PlayerTextDrawShow(playerid, NoPosto[text][playerid]);
}
else
{
for( new text; text != 3; text++) PlayerTextDrawHide(playerid, NoPosto[text][playerid]);
}
}
}
}
return 1;
}
public OnGameModeInit()
{
SetTimer("Locais", 1000, true);
}

|
SetTimer("Locais", 1000, false); |
for(new y=0; y < sizeof(CoordPostos); y++)
{
if(IsPlayerInRangeOfPoint(playerid,15.0,CoordPostos[y][0],CoordPostos[y][1],CoordPostos[y][2]))
{
for( new text; text != 3; text++) PlayerTextDrawShow(playerid, NoPosto[text][playerid]);
}
else
{
for( new text; text != 3; text++) PlayerTextDrawHide(playerid, NoPosto[text][playerid]);
}
}

|
Porйm quando saio da бrea do posto ela nao some ;c |


|
Entгo amigo..
Acontece assim: Ela aparece, dai vai piscando rapido e some. Dai quando me movimento ela aparece, pisca rбpido e some. ;/ |
new pLocal[MAX_PLAYERS]=0;
public OnPlayerUpdate(playerid)
{
if(pLocal[playerid] == 0)
{
Locais(playerid);
}
return 1;
}
forward Locais(playerid);
public Locais(playerid)
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(playerid))
{
for(new y=0; y < sizeof(CoordPostos); y++)
{
if(IsPlayerInRangeOfPoint(playerid,15.0,CoordPostos[y][0],CoordPostos[y][1],CoordPostos[y][2]) && pLocal[playerid] == 0)
{
for( new text; text != 3; text++) PlayerTextDrawShow(playerid, NoPosto[text][playerid]), pLocal[playerid] = 0;
}
else
{
for( new text; text != 3; text++) PlayerTextDrawHide(playerid, NoPosto[text][playerid]), pLocal[playerid] = 1;
}
}
}
}
return 1;
}
public Locais(playerid)
{
for(new x = 0; x < MAX_PLAYERS; x++)
{
if(!IsPlayerConnected(x)) continue;
{
for(new y=0; y < sizeof(CoordPostos); y++)
{
if(IsPlayerInRangeOfPoint(playerid,15.0,CoordPostos[y][0],CoordPostos[y][1],CoordPostos[y][2]))
{
for( new text; text != 3; text++) PlayerTextDrawShow(playerid, NoPosto[text][playerid]);
return 1;
}
for( new text; text != 3; text++) PlayerTextDrawHide(playerid, NoPosto[text][playerid]);
}
}
}
return 1;
}
