07.04.2019, 17:53
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;
}
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;
}