[Help] with car spawn angle
#1

when i use this code to change my plate
my car respawns at a different angle
anyone have any ideas as to why?
or how to fix this?

thanks for any advice you can give.

pawn Код:
YCMD:plate(playerid, params[], help)
{


    if(!IsPlayerAdmin(playerid)) return 0; // this is an admin only script
    if (help)
    {
        SendClientMessage(playerid, 0xFF0000AA, "Change your cars plate.");
    }
    else
    {
        new
            str[128];
        if (isnull(params))
        {
            format(str, sizeof (str), "Usage: \"/%s [Text]\"", Command_GetDisplayNamed("plate", playerid));
            SendClientMessage(playerid, 0xFF0000AA, str);
        }
        else
        {
            new vehicle_id;
            vehicle_id = GetPlayerVehicleID(playerid);
            if(vehicle_id > 0)
            {
                new Float:x, Float:y, Float:z,Float:a;
                GetVehiclePos(vehicle_id,x,y,z);
                GetVehicleZAngle(vehicle_id, a);
                SetVehicleNumberPlate(vehicle_id, params);
                SetVehicleToRespawn(vehicle_id);
                SetVehicleZAngle(vehicle_id, a);
                SetVehiclePos(vehicle_id,x,y,z);
                PutPlayerInVehicle(playerid,vehicle_id,0);
                format(str, sizeof (str), "Plate Changed to \"%s\"",params);
                SendClientMessage(playerid, 0xFF0000AA, str);
            }
            else
            {
                SendClientMessage(playerid, 0xFF0000AA, "You must be in a Vehicle.");
            }
        }
    }
    return 1;
}
Reply
#2

Anyone??
I cant figure this out.

Thanks
Reply
#3

is SetVehicleZAngle only usable when the car is loaded from AddStaticVehicle?

that would mean what im trying todo is not possible? anyone know..
this is annoying but is actually used for adding cars to the gamemode dynamically.
So wont be the end of the world if it wont work.

thanks.
Reply
#4

I sure hope you have vehicles added under OnGameModeInit.

EDIT: Nevermind I just saw how stupid I sounded.
Reply
#5

lol well actually they load from a filter script init but this is for vehicles that I load dynamically.

I want to set there plate and save it all to a file for loading with my static function.
this is no big deal its just annoying.
see I have a /car [id] function
that has the same issue.

Id say +rep but i know i cant give it yet lol.

thx for any help you may offer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)