Posts: 773
Threads: 309
Joined: Aug 2011
Reputation:
0
search on ****** samp shoot spawn point
Posts: 170
Threads: 10
Joined: Sep 2011
Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype == BULLET_HIT_TYPE_NONE)
{
if(fX == spawnX && fY == spawnY && fZ == spawnZ)
{
SetPlayerHealth(playerid, 0.0);
}
}
return 1;
}
//Replace spawnX, spawnY, spawnZ with your spawn positions.
Posts: 507
Threads: 29
Joined: Jul 2014
Reputation:
0
@Rdx : This isn't precise
Posts: 170
Threads: 10
Joined: Sep 2011
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