[HELP] Vehicle Spawn
#1

Why dosent the vehicle spawn and put the player in the vehicle?


pawn Код:
if(listitem == 0) // Andromada
            {
                new vehicleid;
                vehicleid = GetPlayerVehicleID(playerid);
   
                new Float:X, Float:Y, Float:Z, Float:A;
                GetPlayerPos(playerid, X,Y,Z);
                GetPlayerFacingAngle(playerid, A);
                CreateVehicle(592, X,Y,X,A, -1, -1, -1);
                PutPlayerInVehicle(playerid, vehicleid, 0);
                return 1;
            }
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    new currentveh;
    currentveh = GetPlayerVehicleID(playerid);
    DestroyVehicle(currentveh);
    return 1;
}
Reply
#2

Quote:
Originally Posted by Larsey123IsMe
Посмотреть сообщение
Why dosent the vehicle spawn and put the player in the vehicle?


pawn Код:
if(listitem == 0) // Andromada
            {
                new vehicleid;
                vehicleid = GetPlayerVehicleID(playerid);
   
                new Float:X, Float:Y, Float:Z, Float:A;
                GetPlayerPos(playerid, X,Y,Z);
                GetPlayerFacingAngle(playerid, A);
                CreateVehicle(592, X,Y,X,A, -1, -1, -1);
                PutPlayerInVehicle(playerid, vehicleid, 0);
                return 1;
            }
You should be putting 'vehicleid' on the CreateVehicle line:
pawn Код:
if(listitem == 0) // Andromada
{
    new Float:X, Float:Y, Float:Z, Float:A;
    GetPlayerPos(playerid, X,Y,Z);
    GetPlayerFacingAngle(playerid, A);
    new vehicleid = CreateVehicle(592, X,Y,Z,A, -1, -1, -1);
    PutPlayerInVehicle(playerid, vehicleid, 0);
    return 1;
}
Reply
#3

Thank You, Mate
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)