SetVehicleParamsEx problems
#4

thanks for the help. same thing.
but i noticed it doesnt return any vehicle ID now. it was doing yesterday and i changed nothing but add sendclientmessage since then.
ill re-write my code completly

EDIT : it give id 1999 ?? WTF

Код:
	if((newkeys & KEY_YES) && !(oldkeys & KEY_YES))
	{
		new NearestVehicleID = GetClosestVehicle(playerid, 3.0);
		new string[128];
		format(string, sizeof(string), "ID %i ", NearestVehicleID);
		SendClientMessage(playerid, -1, string);
Код:
stock GetClosestVehicle(playerid, Float:range)
{
    new     Float:p_X;
    new     Float:p_Y;
    new     Float:p_Z;

    new     Float:Distance;
    new     Float:PretendentDistance = range +1;
    new     Pretendent;

    GetPlayerPos(playerid, p_X, p_Y, p_Z);

    for(new vehicleid=1; vehicleid < MAX_VEHICLES; vehicleid++)
    {
        Distance = GetVehicleDistanceFromPoint(vehicleid, p_X, p_Y, p_Z);

        if(Distance <= range && Distance <= PretendentDistance)
        {
            Pretendent = vehicleid;
            PretendentDistance = Distance;
        }
    }

    return Pretendent;
}
Reply


Messages In This Thread
SetVehicleParamsEx problems - by TheAngryBird - 20.05.2017, 04:44
Re: SetVehicleParamsEx problems - by DobbysGamertag - 20.05.2017, 05:49
Re: SetVehicleParamsEx problems - by StrikerZ - 20.05.2017, 06:02
Re: SetVehicleParamsEx problems - by TheAngryBird - 20.05.2017, 06:12
Re: SetVehicleParamsEx problems - by StrikerZ - 20.05.2017, 06:28
Re: SetVehicleParamsEx problems - by TheAngryBird - 20.05.2017, 06:31
Re: SetVehicleParamsEx problems - by StrikerZ - 20.05.2017, 06:33
Re: SetVehicleParamsEx problems - by TheAngryBird - 20.05.2017, 06:38
Re: SetVehicleParamsEx problems - by StrikerZ - 20.05.2017, 06:43
Re: SetVehicleParamsEx problems - by Vince - 20.05.2017, 07:34

Forum Jump:


Users browsing this thread: 2 Guest(s)