Spawning a Vehicle
#1

Hi guys. When I use those commands, they do not put me in the vehicle. Instead, if will just spawn it next to me about 4 meters. Why does it not place me in the vehicle? The first command, it does not add the vehicle components. Why not?

pawn Код:
command(admincar, playerid, params[])
{
    new Float:CarToX, Float:CarToY, Float:CarToZ, acar;
    if(PlayerStatistics[playerid][pAdminLevel] >= 2)
    {
        GetPlayerPos(playerid, CarToX, CarToY, CarToZ);
        acar = CreateVehicle(411, CarToX, CarToY+4, CarToZ, 90, 0, 0, -1);
        PutPlayerInVehicle(playerid, acar, 0);
        LinkVehicleToInterior(acar, GetPlayerInterior(playerid));
        SetVehicleVirtualWorld(acar, GetPlayerVirtualWorld(playerid));
        AddVehicleComponent(acar, 1010);
        AddVehicleComponent(acar, 1081);
    }
    return 1;
}

command(spawncar, playerid, params[])
{
    new carid, Float:CarToX, Float:CarToY, Float:CarToZ, car, color1, color2;
    if(sscanf( params, "ddd", carid, color1, color2))
    {
        if(PlayerStatistics[playerid][pAdminLevel] >= 3)
        {
            SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /spawncar [modelid] [color1] [color2]");
        }
    }
    else
    {
        if(PlayerStatistics[playerid][pAdminLevel] >= 3)
        {
            if(carid < 400 || carid > 611)
            {
                SendClientMessage(playerid, COLOR_RED, "Wrong model ID (min: 400 max: 600)");
                return 1;
            }
            GetPlayerPos(playerid, CarToX, CarToY, CarToZ);
            car = CreateVehicle(carid, CarToX, CarToY+4, CarToZ, 90, color1, color2, -1);

            PutPlayerInVehicle(playerid, car, 0);
            LinkVehicleToInterior(car, GetPlayerInterior(playerid));
            SetVehicleVirtualWorld(car, GetPlayerVirtualWorld(playerid));
        }
    }
    return 1;
}
Reply


Messages In This Thread
Spawning a Vehicle - by Scenario - 24.09.2010, 17:21
Re: Spawning a Vehicle - by Voldemort - 24.09.2010, 17:45
Re: Spawning a Vehicle - by Scenario - 26.09.2010, 14:04
Re: Spawning a Vehicle - by mick88 - 26.09.2010, 14:10
Re: Spawning a Vehicle - by Scenario - 26.09.2010, 19:15
Re: Spawning a Vehicle - by Scenario - 27.09.2010, 23:25
Re: Spawning a Vehicle - by mmrk - 27.09.2010, 23:32
Re: Spawning a Vehicle - by Scenario - 27.09.2010, 23:35
Re: Spawning a Vehicle - by mmrk - 27.09.2010, 23:47
Re: Spawning a Vehicle - by Scenario - 27.09.2010, 23:56

Forum Jump:


Users browsing this thread: 1 Guest(s)