12.07.2012, 09:21
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;
}