05.01.2012, 22:23
How can I make the player markers in minimap shown when a player is near and not to all the map?
forward SetPlayerMakerForAllEx(Float: distance); public SetPlayerMakerForAllEx(Float: distance)
{
new players = GetMaxPlayers();
static Float:X, Float:Y, Float:Z;
for(new i; i != players; ++i)
{
GetPlayerPos(i, X,Y,Z);
for(new j; j != i; ++j)
{
if(IsPlayerInRangeOfPoint(j, X, Y, Z))
{
SetPlayerMarkerForPlayer(i, j, GetPlayerColor(j));
}
else
{
SetPlayerMakerForPlayer(i, j, GetPlayerColor(j) & 0xFFFFFF00);
}
}
}
SetTimerEx("SetPlayerMakerForAllEx", "f", distance);
}
SetPlayerMakerForAllEx(DISTANCE);
public OnPlayerGameModeInit()
ShowPlayerMarkers(2);