//OnGameModeInit:
SetTimer("AtualizarRadar",2000,1);
forward AtualizarRadar();
public AtualizarRadar()
{
return 1;
}
public AtualizarRadar()
{
for ( new i = 0; i < MAX_PLAYERS; i ++ )
{
if(IsPlayerConnected(i))
{
new Float:playerPos[3];
new Float:targetPos[3];
GetPlayerPos(i,playerPos[0],playerPos[1],playerPos[2]);
for ( new j = 0; j < MAX_PLAYERS; j ++ )
{
if(IsPlayerConnected(j) && j != i)
{
GetPlayerPos(j,targetPos[0],targetPos[1],targetPos[2]);
new distancia;
//Fуrmula da Distвncia entre 2 X.
distancia = floatround(floatsqroot(floatpower(floatabs(floatsub(playerPos[0],targetPos[0])),2)+floatpower(floatabs(floatsub(playerPos[1],targetPos[1])),2)));
if(distancia <= 200) // Distancia й menor que 200 metros, vamos fazer o jogador sumir no mapa do outro
{
SetPlayerMarkerForPlayer(i,j,(GetPlayerColor(j) & 0xFFFFFF00));
}
else // Caso nгo, ele aparece no mapa
{
SetPlayerMarkerForPlayer(i,j,GetPlayerColor(j));
}
}
}
}
}
return 1;
}
//Topo
#define TEAM_LEI 0
public AtualizarRadar()
{
for ( new i = 0; i < MAX_PLAYERS; i ++ )
{
if(IsPlayerConnected(i))
{
new Float:playerPos[3];
new Float:targetPos[3];
GetPlayerPos(i,playerPos[0],playerPos[1],playerPos[2]);
for ( new j = 0; j < MAX_PLAYERS; j ++ )
{
if(IsPlayerConnected(j) && j != i)
{
GetPlayerPos(j,targetPos[0],targetPos[1],targetPos[2]);
new distancia;
//Fуrmula da Distвncia entre 2 X.
distancia = floatround(floatsqroot(floatpower(floatabs(floatsub(playerPos[0],targetPos[0])),2)+floatpower(floatabs(floatsub(playerPos[1],targetPos[1])),2)));
if(GetPlayerTeam(i) == TEAM_LEI && GetPlayerTeam(j) != TEAM_LEI)
{
switch(GetPlayerWantedLevel(j))
{
case 0: SetPlayerMarkerForPlayer(i,j,0xF6F669AA); // Amarelo bem fraquinho
case 1: SetPlayerMarkerForPlayer(i,j,0xF6F62EAA); // Amarelo Fraco
case 2: SetPlayerMarkerForPlayer(i,j,0xF6F600AA); // Amarelo Mйdio
case 3: SetPlayerMarkerForPlayer(i,j,0xF6C600AA); // Amarelo
case 4: SetPlayerMarkerForPlayer(i,j,0xE5B700AA); // Amarelo Forte
case 5: SetPlayerMarkerForPlayer(i,j,0xE58400AA); // Laranja
case 6: SetPlayerMarkerForPlayer(i,j,0xE51E00AA); // Vermelho
}
}
}
else
{
if(distancia <= 200) // Distancia й menor que 200 metros, vamos fazer o jogador sumir no mapa do outro
{
SetPlayerMarkerForPlayer(i,j,(GetPlayerColor(j) & 0xFFFFFF00));
}
else // Caso nгo, ele aparece no mapa
{
SetPlayerMarkerForPlayer(i,j,GetPlayerColor(j));
}
}
}
}
}
return 1;
}
forward AtualizarRadar();
forward AtualizarRadar();
[code]#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA #define COLOR_RED 0xE60000FF #define COLOR_YELLOW 0xFFFF00AA #define COLOR_WHITE 0xFFFFFFAA #define COLOR_BLUE 0x0000BBAA #define COLOR_LIGHTBLUE 0x33CCFFAA #define COLOR_ORANGE 0xFF9900AA #define COLOR_RED2 0xAA3333AA #define COLOR_LIME 0x10F441AA //coloque o nome das corres aqui que irar mudar, quanto mais corres mais bom eu acho. new RandColors[10][256] = {{COLOR_GREY},{COLOR_GREEN},{COLOR_RED},{COLOR_YEL LOW}, {COLOR_WHITE},{COLOR_BLUE},{COLOR_LIME},{COLOR_RED 2},{COLOR_ORANGE},{COLOR_LIGHTBLUE}}; public OnPlayerUpdate(playerid) { LoadMarks(playerid); } forward LoadMarks(playerid); public LoadMarks(playerid) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && !IsPlayerNPC(playerid)) { new idx = random(sizeof(RandColors)); SetPlayerMarkerForPlayer(i, playerid, RandColors[idx][0]); } } } www.ajudadicasgame.blogspot.com.br |