Bug - SetVehicleParamsForPlayer -
None1337 - 02.11.2018
I'm setting for evereyone vehicle to be locked (doors) to not enter. Only the owner of the vehicle can enter.
So i'm using this:
pawn Code:
CMD:lock(playerid, params[])
{
new vehicleid = user_vehicle[playerid];
foreach(new i : Player) {
if(i != playerid) SetVehicleParamsForPlayer(vehicleid, i, 0, 1);
}
SetVehicleParamsForPlayer(vehicleid, playerid, 0, 0);
return 1;
}
Is working perfectly, but if the owner enter in the vehicle as a driver, somewho, all the players can now press F/ENTER or G to enter in the car..
I don't know why this happend..
Btw, I'm using also this in OnVehicleStreamIn, but still doesn't work...
pawn Code:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
if(is_vehicle_personal[vehicleid] == 1)
{
if(!strcmp(vehicle_owner[vehicleid], PlayerInfo[forplayerid][pNormalName], true)) SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 0); // unlocked
else SetVehicleParamsForPlayer(vehvicleid, forplayerid, 0, 1); // locked because is not the owner
}
return 1;
}
EDIT: The problem is with command
/engine because i'm using SetVehicleParamsEx:
Code:
CMD:engine(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid)) return 1;
if(vehEngine[GetPlayerVehicleID(playerid)] == 0) {
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective);
vehEngine[vehicleid] = 1;
}
else
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
vehEngine[vehicleid] = 0;
}
return 1;
}
Re: Bug - SetVehicleParamsForPlayer -
None1337 - 03.11.2018
Bump?
EDIT: The problem wasn't with /engine (SetVehicleParamsEx), it was with
fixes.inc, i've tried without him, and all work perfectly now.. It wasn't because of /engine with SetVehicleParamsEx from what i've seen.