GetPosInFrontOfPlayer
#1

Im using GetPosInFrontOfPlayer to detect where to set the players pos on leaving the checkpoint. But its spawning me underground because the z is set to 0.

How its saving


stock
pawn Код:
stock Float:GetPosInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;
    GetPlayerPos(playerid, x, y, a);
    switch(IsPlayerInAnyVehicle(playerid))
    {
        case 0: GetPlayerFacingAngle(playerid, a);
        case 1: GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }
    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
    return a;
}
saving
pawn Код:
dini_FloatSet(file, "SpawnOutX", X);
    dini_FloatSet(file, "SpawnOutY", Y);
    dini_FloatSet(file, "SpawnOutZ", Z);
Код:
Name=SnG.Scot_MisCuDi
Owner=SnG.Scot_MisCuDi
Cost=10000
Payout=10000
BusX=-1877.430786
BusY=1305.010742
BusZ=7.179687
SpawnOutX=-1879.213989
SpawnOutY=1306.762817
SpawnOutZ=0.000000
World=0
Interior=0
OwnedBus=1
HasOwner=1
Reply
#2

set Z same as players original z
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)