IsVehicleInRangeOfPoint
#1

Hi,

I want to make that vehicle can't not by move from specific coordinates, so range i can specife 0.1, 0.05? i'am making that if it's not in range i teleport to right coordinates.
Reply
#2

https://sampwiki.blast.hk/wiki/OnUnoccupiedVehicleUpdate

Take a look at the example shown.
Reply
#3

This would require the callback OnUnoccupiedVehicleUpdate, which would most likely cause lag if you have a lot of vehicles. Especially with those hacks that throw vehicles around, by the ton.
Reply
#4

But this callback sometimes bugged.. I'am suggest to choose smth simplier, using vehiclerangeofpoint, getvehiclepos
Reply
#5

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
This would require the callback OnUnoccupiedVehicleUpdate, which would most likely cause lag if you have a lot of vehicles. Especially with those hacks that throw vehicles around, by the ton.
god of car.
Reply
#6

PHP код:
stock IsVehicleInRangeOfPoint(vehicleid,Float:range,Float:x,Float:y,Float:z)
{
    return 
range >= GetVehicleDistanceFromPoint(vehicleidx,y,z);

Reply
#7

PHP код:
stock IsVehicleRangeOfPoint(vehicleid,Float:range,Float:x,Float:y,Float:z)
{
    if(
vehicleid == INVALID_VEHICLE_ID) return 0;
    
    new 
Float:DistantaCar GetVehicleDistanceFromPoint(vehicleidxyz);
    
    if(
DistantaCar <= range) return 1;
    return 
0;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)