More realistic /lock command - HELP!
#1

Hello people......

I was recently searching for a /lock commands but only found /lock commands for in-car use only
I wanted to make the /lock once you get out of the vehicle not inside the vehicle once you use /lock it locks the car so that no other player can enter the vehicle ................

I need help making one, can anyone help me?!

Thanks
Reply
#2

Try something like this.
pawn Код:
//At the top of your script:
new EnteredVehicle[MAX_PLAYERS], engine, lights, alarm, doors, bonnet, boot, objective;

public OnPlayerStateChange(playerid, newstate, oldstate)
{
     if(newstate == PLAYER_STATE_DRIVER)
     {
            EnteredVehicle[playerid] = GetPlayerVehicleID(playerid);
     }
}

CMD:lock(playerid, params[])
{
     GetVehicleParamsEx(EnteredVehicle[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
     SetVehicleParamsEx(EnteredVehicle[playerid], engine, lights, alarm, 1, bonnet, boot, objective);
     SendClientMessage(playerid, COLOR_GREEN, "Vehicle Locked!");
     return 1;
}
Its not tested, but its the basic principle.
Reply
#3

Thank you am gonna try it
Reply
#4

Nice1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)