20.11.2014, 23:34
Quote:
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); } |
i done it exactly like you said , but nothing i tried in diffrent ranges too