People crash with any object help.
#1

How to check if a player has crashed with any object, let's say: buildings, walls, trees...?
Reply
#2

Crashed means he hit the object? Check if the player is extremely near the object by getting the objects position using
pawn Код:
GetObjectPos(objectid, x, y, z);
Then get the co-ordinates of the object, add it in this function
pawn Код:
IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z)
Or use this function
pawn Код:
stock IsPlayerNearObject(playerid, objectid)
{
    new Float:X, Float:Y, Float:Z;
    GetObjectPos(objectid, X, Y, Z);
    if(IsPlayerInRangeOfPoint(playerid, 0.1, X, Y, Z)) return 1;
    return 0;
}
Reply
#3

I would say instead of detecting the walls and trees one by one simply do something which will decrease player health when the car health is low.
Reply
#4

What if someone shoots the car? Or someone uses a pay and spray?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)