AlexWo Posted August 17, 2012 Share Posted August 17, 2012 I made this script today but it's not working. Client-Side: teleporter = { createMarker( 1742, -1944, 13.5, "cylinder", 1.5, 0, 255, 255) createMarker( 1745, -1944, 13.5, "cylinder", 1.5, 0, 255, 255) } local Teleports = { "LosSantos", "LasVenturas", "SanFierro" } addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for _, marker in ipairs ( teleporter ) do addEventHandler ( "onClientMarkerHit", marker, onMarkerHit ) addEventHandler ( "onClientMarkerLeave", marker, onMarkerLeave ) end end ) function createTeleportGui ( ) MainGui = guiCreateWindow (408,203,240,349,"Teleporter",false) guiWindowSetSizable ( MainGui, false ) TeleportGrid = guiCreateGridList(14,32,180,256,false,MainGui) guiGridListSetSelectionMode(TeleportGrid,2) _teleports = guiGridListAddColumn(TeleportGrid,"Teleport",0.85) Teleport = guiCreateButton(15,305,96,35,"Teleport",false,MainGui) guiSetFont(Teleport,"clear-normal") Leave = guiCreateButton(128,305,96,35,"Leave",false,MainGui) guiSetFont(Leave,"clear-normal") for index, teleport in ipairs(Teleports) do local row = guiGridListAddRow (TeleportGrid) guiGridListSetItemText ( TeleportGrid, row, _teleports, tostring(Teleports), false, false ) end end function onMarkerHit(hitElement) if hitElement == localPlayer then createTeleportGui() if MainGui then guiSetVisible(MainGui,true) showCursor(true) guiSetInputEnabled(true) setElementFrozen(localPlayer,true) end end end end addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == Teleport ) then local row,col = guiGridListGetSelectedItem ( TeleportGrid ) if ( row and col and row ~= -1 and col ~= -1 ) then local teleportName = guiGridListGetItemText(TeleportGrid, row, 1) if teleportName == "LosSantos" then triggerServerEvent("spawnLosSantos",localPlayer,teleportName) elseif teleportName == "LasVenturas" then triggerServerEvent("spawnLasVenturas",localPlayer,teleportName) elseif teleportName == "SanFierro" then triggerServerEvent("spawnSanFierro",localPlayer, teleportName) end else outputChatBox("Error, Please select a Teleport of the list.",255,0,0) end elseif (source == Leave) then triggerEvent("closeWindow", localPlayer ) end end ) addEventHandler("onClientGUIDoubleClick", root, function () if ( source == TeleportGrid ) then local row,col = guiGridListGetSelectedItem(TeleportGrid) if (row and col and row ~= -1 and col ~= -1) then local teleportName = guiGridListGetItemText(TeleportGrid, row, teleportName) if teleportName == "LosSantos" then triggerServerEvent("spawnLosSantos",localPlayer,teleportName) elseif teleportName == "LasVenturas" then triggerServerEvent("spawnLasVenturas",localPlayer, teleportName) elseif teleportName == "SanFierro" then triggerServerEvent("spawnSanfierro",localPlayer, teleportName) end end end end ) function onMarkerLeave ( leaveElement ) if ( leaveElement == localPlayer ) then triggerEvent("closeWindow", localPlayer ) end end addEvent ( "closeWindow", true ) addEventHandler ( "closeWindow", root, function ( ) guiSetVisible ( MainGui, false ) showCursor ( false ) guiSetInputEnabled ( false ) setElementFrozen ( localPlayer, false ) end Server-Sider: local x,y,z local LosSantos local LasVenturas local SanFierro addEvent("spawnLosSantos", true) addEventHandler("spawnLosSantos", root, function() setElementPosition ( localPlayer, 1544, -1352, 329 ) triggerClientEvent("closeWindow", root) end ) addEvent("spawnLasVenturas", true) addEventHandler("spawnLasVenturas", root, function() setElementPosition ( localPlayer, 1996, 1588, 26) triggerClientEvent("closeWindow", root) end ) addEvent("spawnSanFierro", true) addEventHandler("spawnSanFierro", root, function() setElementPosition ( localPlayer, -1790, 567, 332) triggerClientEvent("closeWindow", root) end ) Maybe you will find a mistake in it... Link to comment
AMARANT Posted August 17, 2012 Share Posted August 17, 2012 Can you post here warnings/errors from server log or debugscript? Link to comment
AlexWo Posted August 17, 2012 Author Share Posted August 17, 2012 Yes I could, but the problem is the server don't shows any Errors.... just that the script is working fine..... so maybe I made a mistake in the script or thats isn't working in the way I did.... IDK Link to comment
AMARANT Posted August 17, 2012 Share Posted August 17, 2012 What about /debugscript 3 ? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now