GetVehicleZAngle - SetVehicleZAngle
#1

Estoy usando estas funciones para este comando:
pawn Код:
dcmd_parkvehicle(playerid, params[])
{
    #pragma unused params
    new Float:Pos[4], vehicleid = GetPlayerVehicleID(playerid);
    if(pInfo[playerid][VehiclesOwned] < 0) return Message(playerid, RED, " » You don't own a vehicle");
    else if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return Message(playerid, RED, " » You're not driving a vehicle");
    else
    {
        if(VehicleID[playerid][0] == vehicleid || VehicleID[playerid][1] == vehicleid || VehicleID[playerid][2] == vehicleid || VehicleID[playerid][3] == vehicleid)
        {
            GetVehiclePos(vehicleid, Pos[0], Pos[1], Pos[2]);
            GetVehicleZAngle(vehicleid, Pos[3]);
            Message(playerid, GREEN, " » Your vehicle has been parked at your current position");
            dini_FloatSet(VFile(vehicleid), "PosX", Pos[0]);
            dini_FloatSet(VFile(vehicleid), "PosY", Pos[1]);
            dini_FloatSet(VFile(vehicleid), "PosZ", Pos[2]);
            dini_FloatSet(VFile(vehicleid), "Angle", Pos[3]);
            VehicleInfo[vehicleid][X] = Pos[0];
            VehicleInfo[vehicleid][Y] = Pos[1];
            VehicleInfo[vehicleid][Z] = Pos[2];
            VehicleInfo[vehicleid][Angle] = Pos[3];
        }
        else return Message(playerid, RED, " » This isn't your vehicle");
    }
    return 1;
}
Para que cuando el vehнculo explote aparezca en esa posiciуn, y aquн esta el cуdigo en OnVehicleSpawn:
pawn Код:
public OnVehicleSpawn(vehicleid)
{
    SetVehiclePos(vehicleid, VehicleInfo[vehicleid][X], VehicleInfo[vehicleid][Y], VehicleInfo[vehicleid][Z]);
    SetVehicleZAngle(vehicleid, VehicleInfo[vehicleid][Angle]);
    return 1;
}
No se si algo este mal, pero siempre aparece en otro angulo.
Reply


Messages In This Thread
GetVehicleZAngle - SetVehicleZAngle - by arturo clark - 18.08.2011, 23:12
Respuesta: GetVehicleZAngle - SetVehicleZAngle - by M1tux3r - 18.08.2011, 23:59
Respuesta: GetVehicleZAngle - SetVehicleZAngle - by [J]ulian - 19.08.2011, 00:00
Respuesta: GetVehicleZAngle - SetVehicleZAngle - by [J]ulian - 19.08.2011, 12:27

Forum Jump:


Users browsing this thread: 1 Guest(s)