Pottus/ColAndreas

How to use CA_RayCastLine for this?

samp-pinch opened this issue · 2 comments

First look at this: https://imgur.com/a/HMyLKYc

How can I check is player inside that circle? Its object not cp...
Object 's coordinates: 823.91779, -1360.27185, -48.48538
Object model: 18657
I need this like Anti SpawnKill zone where player cannot use guns nor can be damaged...
Here is spawn coordinates (this object is cirle so i cannot us IsPlayerInRangeOfPoint)
823.9178, -1360.6879, -0.5078
I need this check (if you didn't understand yet) :
I want to check is player inside this object from 2nd coords to 1st coords...
Its like check for is player in checkpoint but with object..

This object has no collision therefore can't be checked.

What you could do however is make sure the player is within the circle, without IsPlayerInRangeOfPoint (don't rely on these wrapper functions, learn how they work, it's a simple distance formula).

GetPlayerPos(playerid, px, py, pz);
if(floatsqroot(((x - px) * (x - px)) + ((y - py) * (y - py))) < radius_of_anti_spawn_zone) // player within zone radius
{
    if(bottom_of_zone_z < pz < top_of_zone_z) // player within height range of zone
    {
        // player is in zone
    }
}

Its working, tysm @Crayder !