Car spawns unlocked
#1

I have a problem. I want the car to spawn locked, but instead every time it spawns unlocked. I don't see what's causing it.

This is my OnFilterScriptInit()
pawn Код:
// Create additional police cars
car[0] = CreateVehicle(528,-1632.5520,693.4023,-5.1991,178.7214,0,0, 1200);
SetVehicleParamsForAll(car[0], 0, 1);
car[1] = CreateVehicle(525,-1612.3098,732.4475,-5.3565,0.8844,17,20, 1200);
SetVehicleParamsForAll(car[1], 0, 1);
// Continue...
pawn Код:
public SetVehicleParamsForAll(carid,objective,doorslocked)
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        SetVehicleParamsForPlayer(carid,i,objective,doorslocked);
    }
    return 1;
}
Reply
#2

You also need to apply SetVehicleParamsForPlayer inside OnVehicleStreamIn callback.
Reply
#3

Well, I have this in OnVehicleStreamIn()
pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
        new engine,lights,alarm,doors,bonnet,boot,objective
   
        GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);

        return 1;
}
Isn't it the same?

EDIT: Still not working

pawn Код:
for(new i=0; i<2;i++)
{
     if(vehicleid == car[i]){
     SetVehicleParamsForPlayer(car[i], forplayerid, 0, doors);
     } 
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)