Guten Tag leuteeeeee mit eee,
unzwar hat @Zuck3rFr3i mit copcars in einer Tabelle gesciptet bzw gezeigt wie sowas geht.
nun habe ich das Problem das der Wanted Computer sich nicht mehr öffnet. Kann mir wer da helfen ?
Lua
local copCar = {
{carid=599, carx=1585.9682617188 , cary=-1667.6129150391, carz=6.123007774353 , rotx=0, roty=0, rotz=270},
{carid=599, carx=1585.9682617188 , cary=-1672.1508789063, carz=6.123007774353 , rotx=0, roty=0, rotz=270},
{carid=599, carx=1527.0759277344 , cary=-1645.8112792969, carz=6.123007774353 , rotx=0, roty=0, rotz=180},
{carid=599, carx=1530.7510986328 , cary=-1645.8112792969, carz=5.7787103652954 , rotx=0, roty=0, rotz=180},
{carid=599, carx=1534.6495361328 , cary=-1645.8112792969, carz=5.7787103652954 , rotx=0, roty=0, rotz=180},
{carid=596, carx=1601.5152587891 , cary=-1703.8321533203, carz=5.65 , rotx=0, roty=0, rotz=90},
{carid=596, carx=1601.5152587891 , cary=-1700.1185302734, carz=5.65 , rotx=0, roty=0, rotz=90},
{carid=596, carx=1601.5152587891 , cary=-1696.0816650391, carz=5.65 , rotx=0, roty=0, rotz=90},
{carid=596, carx=1601.5152587891 , cary=-1691.8603515625, carz=5.65 , rotx=0, roty=0, rotz=90},
{carid=596, carx=1601.5152587891 , cary=-1687.82421875, carz=5.65 , rotx=0, roty=0, rotz=90},
{carid=596, carx=1583.4514160156 , cary=-1709.9538574219, carz=5.65 , rotx=0, roty=0, rotz=0},
{carid=596, carx=1587.3441162109 , cary=-1709.9538574219, carz=5.65 , rotx=0, roty=0, rotz=0},
{carid=596, carx=1591.2006835938 , cary=-1709.9538574219, carz=5.65 , rotx=0, roty=0, rotz=0},
{carid=596, carx=1595.3675537109 , cary=-1709.9538574219, carz=5.65 , rotx=0, roty=0, rotz=0},
{carid=523, carx=1545.9689941406 , cary=-1686.5625, carz=5.4521961212158 , rotx=0, roty=0, rotz=90},
{carid=523, carx=1545.9689941406 , cary=-1682.291015625, carz=5.4521961212158 , rotx=0, roty=0, rotz=90},
{carid=523, carx=1545.9689941406 , cary=-1670.1604003906, carz=5.4521961212158 , rotx=0, roty=0, rotz=90},
{carid=523, carx=1545.9689941406 , cary=-1666.3571777344, carz=5.4521961212158 , rotx=0, roty=0, rotz=90},
{carid=523, carx=1545.9689941406 , cary=-1674.0686035156, carz=5.4521961212158, rotx=0, roty=0, rotz=90},
{carid=523, carx=1545.9689941406 , cary=-1678.2633056641, carz=5.4521961212158, rotx=0, roty=0, rotz=90},
{carid=497, carx=1565.8383789063 , cary=-1678.2633056641, carz=28, rotx=0, roty=0, rotz=90},
{carid=497, carx=1565.8383789063 , cary=-1644.9641113281, carz=28.660606384277, rotx=0, roty=0, rotz=90},
{carid=427, carx=1564.3603515625 , cary=-1710.8740234375, carz=6.0298204421997, rotx=0, roty=0, rotz=1}
}
for _,Copcars in pairs(copCar) do
local vehicle = createVehicle(Copcars.carid, Copcars.carx, Copcars.cary, Copcars.carz)
if vehicle then
setElementRotation(vehicle, Copcars.rotx, Copcars.roty, Copcars.rotz)
setVehicleColor(vehicle, 0, 102, 204, 255, 255, 255)
end
end
policeVehicles = { [599]=true, [596]=true, [523]=true, [497]=true, [427]=true }
policeSkins = { [280]=true, [281]=true, [282]=true, [283]=true, [284]=true, [285]=true, [286]=true, [288]=true, [265]=true, [266]=true, [267]=true, [286]=true, [165]=true, [164]=true, [163]=true, [295]=true, [287]=true, [312]=true, [191]=true}
function enterVehicle ( thePlayer, seat, jacked )
if ( policeVehicles[getElementModel ( source )] ) and ( not policeSkins[getElementModel ( thePlayer )] ) then
removePedFromVehicle ( thePlayer )
outputChatBox ( "Du bist kein Cop", thePlayer )
end
end
addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle )
function createPoliceVehicle ( model, x, y, z, r )
if not r then
r = 0
end
veh = createVehicle ( model, x, y, z, 0, 0, r )
setVehicleColor ( veh, copColors[1], copColors[2], copColors[3], copColors[4] )
setVehiclePaintjob ( veh, 3 )
toggleVehicleRespawn ( veh, true )
setVehicleRespawnDelay ( veh, FCarDestroyRespawn*1000*60 )
setVehicleIdleRespawnDelay ( veh, FCarIdleRespawn*1000*60 )
stateVehs[veh] = true
end
createPoliceVehicle ( 598, 2285.8088378906, 2432.4931640625, 3.1434371471405 )
createPoliceVehicle ( 598, 2290.05859375, 2432.6218261719, 3.1434371471405 )
createPoliceVehicle ( 598, 2294.80859375, 2432.7648925781, 3.1434371471405 )
createPoliceVehicle ( 598, 2303.5493164063, 2433.1047363281, 3.1434371471405 )
createPoliceVehicle ( 598, 2307.7990722656, 2433.0205078125, 3.1434371471405 )
createPoliceVehicle ( 598, 2263.8806152344, 2432.5795898438, 3.1434371471405 )
createPoliceVehicle ( 598, 2255.841796875, 2431.947265625, 3.1434371471405 )
createPoliceVehicle ( 523, 2276.5373535156, 2431.9802246094, 2.9338150024414 )
createPoliceVehicle ( 523, 2272.1821289063, 2432.3117675781, 2.9338150024414 )
createPoliceVehicle ( 523, 2268.681640625, 2432.2944335938, 2.9338150024414 )
createPoliceVehicle ( 598, 2281.37109375, 2476.1291503906, 3.1434371471405 )
createPoliceVehicle ( 598, 2272.87109375, 2476.2202148438, 3.1434371471405 )
createPoliceVehicle ( 598, 2277.12109375, 2476.1740722656, 3.1434371471405 )
createPoliceVehicle ( 598, 2263.87109375, 2476.3161621094, 3.1434371471405 )
for key, index in pairs ( federalVehicles ) do
stateVehs[copCar] = true
end
function VehicleCopEnter ( player, seat )
local veh = source
source = player
if getPedOccupiedVehicleSeat ( source ) == 0 then
if ( stateVehs[veh] or federalVehicles[veh] or armyVehs[veh] ) and getElementModel ( veh ) ~= 520 or getElementModel ( player ) == 285 or swatVehs [veh] or geheimVehicles [veh] then
if isCop ( source ) or fbiSkins[getElementModel(source)] or isArmy ( source ) or isswat(source) or isGeheim(player) 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 isCop ( 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 isCop(presser) or isswat(presser) or isGeheim(presser) then
triggerClientEvent ( presser,"ShowPoliceComputerGui", getRootElement() )
--vioSetElementData ( presser, "ElementClicked", true )
showCursor ( presser, true )
--toggleAllControls ( presser, false )
end
end
function isOnDuty ( player )
if isCop ( source ) or fbiSkins[getElementModel ( player )] or getElementModel ( player ) == 285 or isswat(player) or isGeheim(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
Der Fehler ist ganz Simpel er öffnet sich nicht Fehler kommen keine.
mfg
Corny17