Vehicle lock
#1

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.
Reply
#2

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.
Reply
#3

Well, I'm already using this

PHP код:
CMD:lock(playeridparams[])
{
    new 
string[150];
    new 
veh GetPlayerVehicleID(playerid);
    if(
pInfo[playerid][pLock] == 0) return SendClientMessage(playeridRED"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(veh01);
    new 
enginelightsalarmdoorsbonnetbootobjective;
    
GetVehicleParamsEx(vehenginelightsalarmdoorsbonnetbootobjective);
    
SetVehicleParamsEx(vehenginelightsalarm1bonnetbootobjective);
    
GameTextForPlayer(playerid"~g~Locked"30005);
    
PlayerPlaySound(playerid11470.00.010.0);
    
format(stringsizeof(string), "%s locks their vehicle..."GetName(playerid));
    
ProxDetector(20.0playeridstringREDREDREDREDRED);
    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.
Reply
#4

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
Reply
#5

Explain more?
Reply
#6

@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.
Reply
#7

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)