Radius. (WARNING)
#6

Код:
forward GetPlayerDistanceToPointEx(playerid,Float:x,Float:y,Float:z);
forward IsPlayerInSphere(playerid,Float:x,Float:y,Float:z,radius);

public GetPlayerDistanceToPointEx(playerid,Float:x,Float:y,Float:z)
{
	new Float:x1,Float:y1,Float:z1;
	new Float:tmpdis;
	GetPlayerPos(playerid,x1,y1,z1);
	tmpdis = floatsqroot(floatpower(floatabs(floatsub(x,x1)),2)+floatpower(floatabs(floatsub(y,y1)),2)+floatpower(floatabs(floatsub(z,z1)),2));
	return floatround(tmpdis);
}
public IsPlayerInSphere(playerid,Float:x,Float:y,Float:z,radius)
{
	if(GetPlayerDistanceToPointEx(playerid,x,y,z) < radius){
		return 1;
	}
	return 0;
}
Код:
//add to your command
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid,X, Y, Z)


        for (new i=0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerInSphere(i,X, Y, Z, radius))
            {
                SetPlayerSkin(i,skin);
            }
        }
i hope that this will help ^^'
Reply


Messages In This Thread
Radius. (WARNING) - by Sasoft - 30.12.2011, 10:09
Re: Radius. (WARNING) - by T0pAz - 30.12.2011, 10:14
Re: Radius. (WARNING) - by silvan - 30.12.2011, 12:02
Re: Radius. (WARNING) - by FTLOG - 30.12.2011, 12:20
Re: Radius. (WARNING) - by Sasoft - 30.12.2011, 18:17
Re: Radius. (WARNING) - by Elmin - 30.12.2011, 19:41

Forum Jump:


Users browsing this thread: 1 Guest(s)