GetVehiclePos problem
#1

I have this command and for some reason it gives me that error,"You aren't near your rented vehicle",even though im in the vehicle,and yes i checked,RentedVehicle[playerid] is the vehicle that im in range of,not other vehicle,and it still says im not in range,help./




CMD:lockrented(playerid, params[])
{

if(Rented[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "You don't have a rented car");

new rx,ry,rz;
GetVehiclePos(RentedVehicle[playerid], rx, ry, rz);

if(IsPlayerInRangeOfPoint(playerid, 5, rx, ry ,rz))
{
if(LockedVeh[GetPlayerVehicleID(playerid)] == 0)
{
LockedVeh[GetPlayerVehicleID(playerid)] = 1;
}
else
{
LockedVeh[GetPlayerVehicleID(playerid)] = 0;
}
}
else return SendClientMessage(playerid, COLOR_GREY, "You aren't near your rented vehicle");
return 1;
}
Reply
#2

GetVehiclePos returns the float in the given variable.
Meaning, the variable rx ry rz should be a float type.
Reply
#3

You have to put new Float: rx,ry,rz;
Reply
#4

change your
Code:
new rx, ry, rz;
to
Code:
new Float:rx, ry, rz;
Reply
#5

You need to mark all 3 variables as float, not only the first one.

Code:
new Float:rx, Float:ry, Float:rz;
Reply
#6

I did that and it still gives me the same error
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)