Hab das jetzt mal ausprobiert ... Geht nicht Ich möcht doch einfach nur wenn jemand aufn Bike einsteigt, dass ein Fenster kommt.
Kann ma jemand testen ich send mal mein ganzes Script:
--- Fahrrad ---
--- by xFabian ---
--- (c) 2012 ---
addEventHandler("onClientResourceStart",resourceRoot,
function()
Fahrrad_Window = guiCreateWindow(361,164,284,231,"Fahrrad leihen.",false)
Fahrrad_Leih_Button = guiCreateButton(43,163,197,54,"Fahrrad leihen.",false,Fahrrad_Window)
FahrradBild_Image = guiCreateStaticImage(39,24,197,133,"images/mtalogo.png",false,Fahrrad_Window)
Fahrrad_Close_Button = guiCreateButton(242,27,23,23,"X",false,Fahrrad_Window)
end
)
function fahrradaus()
guiSetVisible(Fahrrad_Window, false)
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), fahrradaus)
addEvent("fahrradan", true)
addEventHandler("fahrradan", getRootElement(),
function()
guiSetVisible(Fahrrad_Window, true)
end
)
addEvent("fahrradaus", true)
addEventHandler("fahrradaus", getRootElement(),
function()
outputChatBox("test")
guiSetVisible(Fahrrad_Window, false)
end
)
addEventHandler("onClientGUIClick", getRootElement(),
function (state)
if state == "left" then
if source == Fahrrad_Close_Button then
showCursor(false)
guiSetVisible(Fahrrad_Window, false)
end
end
end
)
addEventHandler("onClientGUIClick", getRootElement(),
function (state)
if state == "left" then
if source == Fahrrad_Leih_Button then
showCursor(false)
guiSetVisible(Fahrrad_Window, false)
end
end
end
)
function test()
guiSetVisible(Fahrrad_Window, true)
showCursor(true)
end
addCommandHandler("k", test)
Alles anzeigen
Server:
--- Fahrrad ---
--- by xFabian ---
--- (c) 2012 ---
spawnblip = createBlip( -2652, 388, 15, 56 )
fahrrad1 = createVehicle ( 509, -2652, 388, 4)
fahrrad2 = createVehicle ( 509, -2652, 390, 4)
fahrrad3 = createVehicle ( 509, -2652, 392, 4)
fahrrad4 = createVehicle ( 509, -2652, 394, 4)
fahrrad5 = createVehicle ( 509, -2652, 396, 4)
fahrrad6 = createVehicle ( 509, -2652, 398, 4)
fahrrad7 = createVehicle ( 509, -2652, 400, 4)
fahrrad8 = createVehicle ( 509, -2652, 402, 4)
fahrrad9 = createVehicle ( 509, -2652, 404, 4)
fahrrad10 = createVehicle ( 509, -2652, 406, 4)
function addHelmetOnEnter ( theplayer )
if ( getElementModel ( source ) == 509 ) then
outputChatBox("HAHA")
triggerClientEvent("fahrradan")
end
end
addEventHandler ( "onVehicleEnter", getRootElement(), addHelmetOnEnter )
Alles anzeigen