Vehicle /lock
#3

pawn Код:
new EnteredVehicle[MAX_PLAYERS], engine, lights, alarm, doors, bonnet, boot, objective;

public OnPlayerStateChange(playerid, newstate, oldstate)
{
     if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
     {
            EnteredVehicle[playerid] = GetPlayerVehicleID(playerid);
            GetVehicleParamsEx(EnteredVehicle[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
            if(doors == 1)
            {
                //Remove Player From Vehicle Here
                GameTextForPlayer(playerid, "~r~Vehicle Locked!", 5000, 5);
            }
     }
}

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;
}
EDIT: Ignore the //Remove Player From Vehicle Here xD
Reply


Messages In This Thread
Vehicle /lock - by kbalor - 11.07.2012, 20:26
Re: Vehicle /lock - by Tuntun - 12.07.2012, 09:11
Re: Vehicle /lock - by clarencecuzz - 12.07.2012, 09:21
Re: Vehicle /lock - by clarencecuzz - 12.07.2012, 09:23
Re: Vehicle /lock - by kbalor - 12.07.2012, 11:07
Re: Vehicle /lock - by clarencecuzz - 12.07.2012, 11:09
Re: Vehicle /lock - by kbalor - 12.07.2012, 11:18
Re: Vehicle /lock - by kbalor - 12.07.2012, 11:27
Re: Vehicle /lock - by clarencecuzz - 12.07.2012, 11:39
Re: Vehicle /lock - by clarencecuzz - 12.07.2012, 11:43

Forum Jump:


Users browsing this thread: 2 Guest(s)