Posts: 1,419
Threads: 264
Joined: Jan 2009
Reputation:
0
Hey.
Does anyone know how to make a IsPlayerInRangeOfVehicleModel or something like that?
So you can check if a player is near a police car.
Thankyou
Posts: 1,419
Threads: 264
Joined: Jan 2009
Reputation:
0
Yup. That's my question. Could you help me a bit?
Posts: 1,046
Threads: 29
Joined: Mar 2010
I have two usefull stocks for you:
pawn Код:
stock GetPlayerDistanceToVehicle(playerid, tovehicleid, &Float:Distance)
{
new Float:pX, Float:pY, Float:pZ, Float:vX, Float:vY, Float:vZ;
GetPlayerPos(playerid,pX,pY,pZ);
GetVehiclePos(tovehicleid,vX,vY,vZ);
Distance = floatsqroot((vX-pX)*(vX-pX)+(vY-pY)*(vY-pY)+(vZ-pZ)*(vZ-pZ));
}
and
pawn Код:
stock IsPlayerInRangeOfVehicle(playerid, tovehicleid, Float:Range)
{
new Float:vX, Float:vY, Float:vZ;
GetPlayerPos(playerid,pX,pY,pZ);
GetVehiclePos(tovehicleid,vX,vY,vZ);
if(IsPlayerInRangeOfPoint(playerid,Range,vX,vY,vZ)) return true;
return false;
}
Posts: 1,419
Threads: 264
Joined: Jan 2009
Reputation:
0
Ok thanks.
Now how will I use it on model 596?
Please help.