26.06.2011, 11:42
sDetector
Funзгo: Enviar mensagens para quem estiver perto do jogador
pawn Code:
//======================================[ sDetector ]======================================
public sDetector(Float:radi, playerid, string[], color1, color2, color3)
{
if(IsPlayerConnected(playerid))
{
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerInRangeOfPoint(i, radi, Pos[0], Pos[1], Pos[2]))
{
SendClientMessage(i, color1, string);
}
if(IsPlayerInRangeOfPoint(i, radi*2, Pos[0], Pos[1], Pos[2]) && !IsPlayerInRangeOfPoint(i, radi, Pos[0], Pos[1], Pos[2]))
{
SendClientMessage(i, color2, string);
}
if(IsPlayerInRangeOfPoint(i, radi*3, Pos[0], Pos[1], Pos[2]) && !IsPlayerInRangeOfPoint(i, radi*2, Pos[0], Pos[1], Pos[2]))
{
SendClientMessage(i, color3, string);
}
}
}
return 1;
}
//======================================[ sDetector ]======================================