Vehicle(without player) InRangeOfPoint?
#1

Is there any function like this?
I want to make some kind of teleporter.
pawn Code:
for (new x;x<3000;x++)
{
    if (IsPlayerInDynamicCP(x,CheckPT[playerid])) SetPlayerPos(x,X+random(2)-random(4),Y+random(2)-random(4),Z);
    GetVehiclePos(x,XZ,YZ,ZZ);
    /*Got stuck here :[*/
}
(otherwise just post the formula :])
Reply
#2

bumpzor plz respond
Reply
#3

what si 3000?

what are you trying to do?
Reply
#4

Making a teleport command,

I used 3000 bcuse of all cars (i know limit is with 2k, just to be sure :])

All cars inside CheckPT[playerid] (Checkpoint)

Must be teled, But the cars are without players, But there are no functions of IsVehicleInRangeOfPoint() or IsVehicleInDynamicCP()

So I asked here, (IsPlayerToPoint, that function could help me too)
Reply
#5

Lol, you know the limit is 2k still you want the code to execute 1000 times more just to be on the safe side x)? makes sense to me.
Reply
#6

Quote:
Originally Posted by [DRD]Rodney
View Post
I used 3000 bcuse of all cars (i know limit is with 2k, just to be sure :])
What are retarded thought. Like I would be buying a car which would cost $2000 and I would pay $3000 just to be sure. And you are looping players there not cars.
Reply
#7

I can loop players and cars at same time <.<
There just ID's assigned to cars, same for players :/
Reply
#8

pawn Code:
forward IsVehicleInRangeOfPoint(vehicleid,Float:Range,Float:x,Float:y,Float:z);
public IsVehicleInRangeOfPoint(vehicleid,Float:Range,Float:x,Float:y,Float:z)
{
    new Float:vx,Float:vy,Float:vz;
    GetVehiclePos(vehicleid,vx,vy,vz);
    return ((((vx-x)*(vx-x))+((vy-y)*(vy-y))+((vz-z)*(vz-z)) ) >= Range*Range );
}
As for the stock,but you can't use one loop for vehicles and players.
Reply
#9

Why not? There just NUMBERS

ID 0 of player is first connected player
ID 0 of car is first connected car

etc...

and thx :]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)