Vehicle lock -
sscarface - 28.06.2015
i need something like
if player type /lock so vehicle gets lock. The vehicle he has it last time. But he needs to be outside.
I mean, for example; I'm driving infernus and then i got out of car and type /lock so my vehicle get locked and gets unlocked until i entered in vehicle back or type /unlock.
I don't want vehicle gets locked if player is inside of vehicle. I want player last vehicle gets locked.
Re : Vehicle lock -
Terrorizt - 28.06.2015
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
vehicleid The ID of the vehicle to set the parameters of.
engine Engine status. 0 - Off, 1 - On.
lights Light status. 0 - Off, 1 - On.
alarm Vehicle alarm status. If on, the alarm starts. 0 - Off, 1 - On.
doors Door lock status. 0 - Unlocked, 1 - Locked.
bonnet Bonnet (hood) status. 0 - Closed, 1 - Open.
boot Boot/trunk status. 0 - Closed, 1 - Open.
objective Toggle the objective arrow above the vehicle. 0 - Off, 1 - On.
Re: Vehicle lock -
sscarface - 28.06.2015
Well, I'm already using this
PHP код:
CMD:lock(playerid, params[])
{
new string[150];
new veh = GetPlayerVehicleID(playerid);
if(pInfo[playerid][pLock] == 0) return SendClientMessage(playerid, RED, "You dont own a vLock, buy one at a 24/7 store.");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "{FF0000}ERROR: {FFFFFF}You have to be in a vehicle.");
SetVehicleParamsForAll(veh, 0, 1);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(veh, engine, lights, alarm, 1, bonnet, boot, objective);
GameTextForPlayer(playerid, "~g~Locked", 3000, 5);
PlayerPlaySound(playerid, 1147, 0.0, 0.0, 10.0);
format(string, sizeof(string), "%s locks their vehicle...", GetName(playerid));
ProxDetector(20.0, playerid, string, RED, RED, RED, RED, RED);
return 1;
}
But It locks vehicle when you are inside of vehicle. I need something which locks player last vehicle and player needs to be outside of vehicle not inside.
Re: Vehicle lock -
Metharon - 28.06.2015
pawn Код:
new veh = GetPlayerVehicleID(playerid);
You locking the vehicle the player is inside on.
You need to choose what car for example if i want to lock the vehicle with the cd key i have..
new id = PlayerInfo[playerid][CarKey];
new veh = VehicleParam[id][VehicleCreating];
Sorry my english sucks
Re: Vehicle lock -
sscarface - 29.06.2015
Explain more?
Re : Vehicle lock -
Terrorizt - 29.06.2015
@sscarface, you are trying to make it more realistic by locking the car when you re outside it but i think IRL we can lock the car when we are inside it so why don't you let it inside and outside.
Re: Vehicle lock -
sscarface - 05.07.2015
The problem is you cannot unlocked your vehicle when you are outside of vehicle. I have no problem with locking vehicle while you are in inside of vehicle or outside. But, You cannot unlocked your vehicle if you are outside of vehicle. That's the problem. I want to solve it but don't know how to get Player Last vehicle so. I would be your thankful if you guyz help me. Thank you!