30.11.2011, 12:10
(
Last edited by armandodo; 30/11/2011 at 12:54 PM.
Reason: RESOLVIDO!
)
RESOLVIDO!
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetDistanceBetweenPlayers(playerid,i) < 10) SetPlayerArmour(i,100);
}
stock GetDistanceBetweenPlayers(playerid,playerid2)
{
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
new Float:tmpdis;
GetPlayerPos(playerid,x1,y1,z1);
GetPlayerPos(playerid2,x2,y2,z2);
tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
return floatround(tmpdis);
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
new Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2])
if(IsPlayerInRangeOfPoint(i, 10, pos[0], pos[1], pos[2])
{
SetPlayerHealth(i, 100);
SetPlayerArmour(i, 100);
}
}
if(strcmp(cmdtext,"/vidap",true)==0)
{
new Float:POS[3];
GetPlayerPos(playerid,POS[0],POS[1],POS[2]);
for(new i = 0, x = GetMaxPlayers(); i != x; ++i)
{
if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i,30,POS[0],POS[1],POS[2]))
{
SetPlayerHealth(i,100);
}
}
return 1;
}