Wrong Angle
#7

Quote:
Originally Posted by jamesbond007
Посмотреть сообщение
what angle does it set it at? random or 0 ?
does it happen to all vehicles ? idk.. maybe someone else will reply with solution
Well yeah with all vehicles but only if I use SetVehicleToRespawn

Quote:
Originally Posted by Threshold
Посмотреть сообщение
Where exactly are you respawning it?
I got a command which is basically SetVehicleToRespawn(playerid,GetPlayerVehicleID(pl ayerid))

Quote:
Originally Posted by Kevln
Посмотреть сообщение
pawn Код:
// ** INCLUDES

#include <a_samp>
#include <zcmd>

// ** ARRAYS AND ENUMERATORS

enum eVehicleInfo
{
    Float:vehicle_info_x,
    Float:vehicle_info_y,
    Float:vehicle_info_z,
    Float:vehicle_info_angle
};

new aVehicleInfo[MAX_VEHICLES][eVehicleInfo];

// ** MAIN

main()
{
    print("Loaded \"vehicle_angle.amx\".");
}

// ** CALLBACKS

public OnGameModeInit()
{
    new vehicleid = AddStaticVehicle(400, 132.1159, -92.7907, 1.5220, 291.6237, 123, 1);

    GetVehiclePos(vehicleid, aVehicleInfo[vehicleid][vehicle_info_x], aVehicleInfo[vehicleid][vehicle_info_y], aVehicleInfo[vehicleid][vehicle_info_z]);
    GetVehicleZAngle(vehicleid, aVehicleInfo[vehicleid][vehicle_info_angle]);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    SetVehiclePos(vehicleid, aVehicleInfo[vehicleid][vehicle_info_x], aVehicleInfo[vehicleid][vehicle_info_y], aVehicleInfo[vehicleid][vehicle_info_z]);

    SetTimerEx("SetVehicleZAngleAfterSpawn", 1500, false, "i", vehicleid);
    return 1;
}

// ** COMMANDS

CMD:respawnvehicles(playerid, params[])
{
    for(new i = 1, j = GetVehiclePoolSize(); i <= j; i ++)
    {
        SetVehicleToRespawn(i);
    }
    return 1;
}

CMD:park(playerid, params[])
{
    new vehicleid = GetPlayerVehicleID(playerid);
    GetVehiclePos(vehicleid, aVehicleInfo[vehicleid][vehicle_info_x], aVehicleInfo[vehicleid][vehicle_info_y], aVehicleInfo[vehicleid][vehicle_info_z]);
    GetVehicleZAngle(vehicleid, aVehicleInfo[vehicleid][vehicle_info_angle]);
    return 1;
}

// ** FUNCTIONS

forward SetVehicleZAngleAfterSpawn(vehicleid);
public SetVehicleZAngleAfterSpawn(vehicleid)
{
    SetVehicleZAngle(vehicleid, aVehicleInfo[vehicleid][vehicle_info_angle]);
    return 1;
}
Ill try it out


EDIT: Yeah that works just fine, probably Ill have to do it like this sometimes. Thanks for the help. +rep
Reply


Messages In This Thread
Wrong Angle - by TwinkiDaBoss - 09.12.2015, 00:22
Re: Wrong Angle - by Kevln - 09.12.2015, 00:34
Re: Wrong Angle - by TwinkiDaBoss - 09.12.2015, 00:39
Re: Wrong Angle - by jamesbond007 - 09.12.2015, 01:19
Re: Wrong Angle - by Threshold - 09.12.2015, 01:20
Re: Wrong Angle - by Kevln - 09.12.2015, 03:02
Re: Wrong Angle - by TwinkiDaBoss - 09.12.2015, 19:41

Forum Jump:


Users browsing this thread: 1 Guest(s)