02.11.2018, 12:13
(
Last edited by None1337; 03/11/2018 at 10:53 AM.
)
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:
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...
EDIT: The problem is with command /engine because i'm using SetVehicleParamsEx:
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;
}
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;
}
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; }