Hallo,
Ich habe diesen Code gemacht, aber er funktioniert nicht. Wo liegt der Fehler?
Code
markerBase = createMarker( 2729.5295410156, -2451.4299316406, 16.593761444092, 'cylinder', 1, 255, 0, 0, 153 )
markerINT = createMarker( 2541.7124023438, -1304.0041503906, 1024.009765625, 'cylinder', 1, 255, 0, 0, 153 )
lockedFBI = 0
torFBI = createObject( 988, 2526.7456054688, -1285.9410400391, 1054.4344482422, 0, 0, 286 )
markerWache = createMarker( 2521.0310058594, -1284.4229736328, 1053.6396484375, 'cylinder', 1, 255, 0, 0, 153 )
function FBIint (player)
-- if (getPlayerTeam(player) == getTeamFromName("FBI" )) then
if lockFBI = 0 then
setElementInterior(player, 5, 322.197998, 302.497985, 999.148437 )
setElementData(player, 0, 0, 0)
else
outputChatBox( "#E10000ABGESCHLOSSEN" )
end
-- end
end
function FBIintint (player)
-- if (getPlayerTeam(player) == getTeamFromName("FBI" )) then
if lockFBI = 0 then
setElementInterior(player, 0, 2727.5295410156, -2449.4299316406, 16.593761444092 )
setElementData(player, 0, 0, 0)
else
outputChatBox( "#E10000ABGESCHLOSSEN" )
end
-- end
end
function lockFBI
-- if (getPlayerTeam(player) == getTeamFromName("FBI" )) then
if lockedFBI = 0 then
lockedFBI + 1
else
outputChatBox( "#E10000Das FBI-Gebäude ist bereits zu." )
end
-- else
-- outputChatBox( "#E10000Du gehörst nicht zum FBI." )
-- end
end
function openFBI
-- if (getPlayerTeam(player) == getTeamFromName("FBI" )) then
if lockedFBI = 1 then
lockedFBI - 1
else
outputChatBox( "#E10000Das FBI-Gebäude ist bereits offen." )
end
-- else
-- outputChatBox( "#E10000Du gehörst nicht zum FBI." )
-- end
end
function FBItorauf
moveObject( torFBI, 5000, 2526.9658203125, -1279.4294433594, 1054.4523925781, 0, 0, 267.99499511719 )
end
function FBItorzu
moveObject( torFBI, 5000, 2526.7456054688, -1285.9410400391, 1054.4344482422, 0, 0, 286 )
end
function FBItorzutimer
setTimer ( FBItorzu, 5000, 1 )
end
function pedLoad ( name )
FBIWache = createPed ( 282, 2521.19921875, -1281.7484130859, 1054.7230224609 )
setElementInterior( FBIWache, 2, 2521.19921875, -1281.7484130859, 1054.7230224609 )
setElementInterior( torFBI, 2, 2526.9658203125, -1279.4294433594, 1054.4523925781, 0, 0, 267.99499511719 )
setElementInterior( markerINT, 2, 2541.7124023438, -1304.0041503906, 1024.009765625 )
setElementInterior( markerWache, 2, 2521.0310058594, -1284.4229736328, 1053.6396484375 )
end
function FBIgui
button = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "OK", true )
editBox = guiCreateEdit( 0.3, 0.1, 0.4, 0.1, "", true )
guiEditSetMaxLength ( editBox, 128 )
end
function outputEditBox ()
local text = guiGetText ( editBox )
if text = "test" then
FBItorauf
FBItorzutimer
end
end
addCommandHandler("lockfbi", lockFBI)
addEventHandler ( "onClientGUIClick", button, outputEditBox )
addCommandHandler("openfbi", openFBI)
addEventHandler( "onMarkerHit", markerINT, FBIintint )
addEventHandler( "onMarkerHit", markerBase, FBIint )
addEventHandler( "onMarkerHit", markerWache, FBIgui )
addEventHandler ( "onResourceStart", getRootElement(), pedLoad )
Alles anzeigen
Danke im Voraus.