23.07.2010, 13:43
(
Последний раз редактировалось Blt950; 23.07.2010 в 15:24.
)
Hello, I got this weird problem with the vehicle system I'm using.
When the filterscript Init's it runs the code to build cars etc.
And at the end of building all the vehicles. It runs this also:
ToggleVehicleLocked is:
It runs the ToggleVehicleLocked in the Init of Filterscript (I've checked)
But it doesn't seems to effect the vehicles that spawns anyway.
I still can enter the car, after a server restart. Even it's supposed to be locked.
But when I use commands like /trunk, it returns it's locked.
So I've to relock the vehicle. And then it works.
I've tried to re-lock vehicle on the FS Init like this:
But it didn't work. Please help me !
Say if you need some other parts of code too.
EDIT: I've fixed it, it's a old script. Seemed it just missed the OnVehicleStreamIn()
When the filterscript Init's it runs the code to build cars etc.
And at the end of building all the vehicles. It runs this also:
pawn Код:
if(strlen(vehOwner)) // False returns "0", so this is basically if vehOwner has any value.
{
ToggleVehicleLocked(veh, true);
IsVehicleOwned[veh] = true;
copy(vehOwnerName[veh], vehOwner, MAX_PLAYER_NAME);
}
pawn Код:
stock ToggleVehicleLocked(vehicleid, bool:locked)
{
vehLocked[vehicleid] = locked;
for(new i; i != MAX_PLAYERS; i++)
{
SetVehicleParamsForPlayer(vehicleid, i, false, locked);
}
}
But it doesn't seems to effect the vehicles that spawns anyway.
I still can enter the car, after a server restart. Even it's supposed to be locked.
But when I use commands like /trunk, it returns it's locked.
So I've to relock the vehicle. And then it works.
I've tried to re-lock vehicle on the FS Init like this:
pawn Код:
if(strlen(vehOwner)) // False returns "0", so this is basically if vehOwner has any value.
{
ToggleVehicleLocked(veh, false);
ToggleVehicleLocked(veh, true);
IsVehicleOwned[veh] = true;
copy(vehOwnerName[veh], vehOwner, MAX_PLAYER_NAME);
}
Say if you need some other parts of code too.
EDIT: I've fixed it, it's a old script. Seemed it just missed the OnVehicleStreamIn()
