Hallo,
ich habe soebend eine Fraktion gescriptet habe auch für diese Fraktion in den Polizeicomputerscript eingefügt dieses ist eine Kopie von copcar.lua
Lua
function VehicleCopEnter ( player, seat )
local veh = source
source = player
if getPedOccupiedVehicleSeat ( source ) == 0 then
if ( stateVehs[veh] or federalVehicles[veh] or armyVehs[veh] or swatVehs[veh] ) and getElementModel ( veh ) ~= 520 then
if copskins[getElementModel ( source )] or fbiSkins[getElementModel(source)] or isArmy ( source ) or isswat ( source ) then
if not isKeyBound ( source, "sub_mission", "down", policeComputer ) then
bindKey ( source, "sub_mission", "down", policeComputer )
end
else
opticExitVehicle ( source )
outputChatBox ( "Du bist kein Beamter / nicht im Dienst!", source, 255, 0, 0 )
end
end
else
if copskins[getElementModel ( source )] == true then
if not isKeyBound ( source, "sub_mission", "down", policeComputer ) then
bindKey ( source, "sub_mission", "down", policeComputer )
end
end
end
end
function policeComputer ( presser, key, state )
if state == "down" and ( isOnDuty(presser) or isArmy(presser) ) and ( stateVehs[getPedOccupiedVehicle( presser )] or ( armyVehs[getPedOccupiedVehicle( presser )] ) ) and getElementModel ( getPedOccupiedVehicle ( presser ) ) ~= 520 or isswat(presser) then
triggerClientEvent ( presser,"ShowPoliceComputerGui", getRootElement() )
vioSetElementData ( presser, "ElementClicked", true )
showCursor ( presser, true )
toggleAllControls ( presser, false )
end
end
function isOnDuty ( player )
if copskins[getElementModel ( player )] or fbiSkins[getElementModel ( player )] or getElementModel ( player ) == 285 or isswat(player) then
return true
else
return false
end
end
for key, index in pairs ( stateVehs ) do
addEventHandler ( "onVehicleEnter", key, VehicleCopEnter )
end
for key, index in pairs ( armyVehs ) do
addEventHandler ( "onVehicleEnter", key, VehicleCopEnter )
end
Alles anzeigen
Die S.W.A.T Vehicles sind definiert als swatVehs