Shoot Spawnpoint
#10

Quote:
Originally Posted by Rdx
Посмотреть сообщение
EDIT: try this, change your spawn positions and range in CHANGE fields.

Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
	new Float:spawnX = CHANGE;
	new Float:spawnY = CHANGE;
	new Float:spawnZ = CHANGE;
	new Float:range = 5.0 // CHANGE IT


    if(IsPointInRangeOfPoint(fX, fY, fZ, spawnX, spawnY, spawnZ, range))
    {
        SetPlayerHealth(playerid, 0.0);
        SendClientMessage(playerid, -1, "Don't spawnkill, you are dead.");
    }

    return 1;
}

stock IsPointInRangeOfPoint(Float:x, Float:y, Float:z, Float:x2, Float:y2, Float:z2, Float:range)
{
    x2 -= x;
    y2 -= y;
    z2 -= z;
    return ((x2 * x2) + (y2 * y2) + (z2 * z2)) < (range * range);
}
EDIT2: tested, working : http://i.imgur.com/FShRdfP.jpg
Nope ..
i done it exactly like you said , but nothing i tried in diffrent ranges too
Reply


Messages In This Thread
Shoot Spawnpoint - by s0ZNIz - 15.11.2014, 11:08
Re: Shoot Spawnpoint - by StR_MaRy - 15.11.2014, 11:09
Re : Shoot Spawnpoint - by Dutheil - 15.11.2014, 13:05
Re: Shoot Spawnpoint - by HY - 15.11.2014, 13:31
Re: Shoot Spawnpoint - by s0ZNIz - 20.11.2014, 19:27
Re: Shoot Spawnpoint - by Rdx - 20.11.2014, 19:35
Re : Shoot Spawnpoint - by Dutheil - 20.11.2014, 19:42
Re: Shoot Spawnpoint - by s0ZNIz - 20.11.2014, 21:06
Re: Shoot Spawnpoint - by Rdx - 20.11.2014, 21:35
Re: Shoot Spawnpoint - by s0ZNIz - 20.11.2014, 23:34

Forum Jump:


Users browsing this thread: 2 Guest(s)