K4stic Posted January 21, 2013 Share Posted January 21, 2013 no errors just wonna charge but how don't know so: Then i charge the localplayer from line 10 to player or thePlayer it stop be attached i have make lot tryis i wonna charge the localplayer because i wonna to see that object all no only local Player function use ( ) local row, col = guiGridListGetSelectedItem ( list ) if ( row and col and row ~= -1 and col ~= -1 ) then local model = tonumber ( guiGridListGetItemData ( list, row, 1 ) ) local x, y, z = getElementPosition ( localPlayer ) if ( isElement ( object ) ) then destroyElement ( object ) end object = createObject ( model, x, y, z + 1, 0, 0, 0 ) attachElements(object, localPlayer, 0.025, -0.01, 0.815, 0, 0, 180) end end addEventHandler ( "onClientGUIClick", _use, use, false ) Sorry for my Bad english Link to comment
Castillo Posted January 21, 2013 Share Posted January 21, 2013 I really didn't get anything, could you try to explain yourself better? Link to comment
TAPL Posted January 21, 2013 Share Posted January 21, 2013 You need to create the object and attach it in server side in order to make effect to everyone. So you need to make trigger from client side to server side: triggerServerEvent Link to comment
K4stic Posted January 22, 2013 Author Share Posted January 22, 2013 i make it client side because don't know how make it in server side so help me more more code local aObjects = { { "Hat 1", 2052 }, { "Hat 2", 2053 }, { "Hat 3", 2054 }, { "Grass Hat", 861 }, { "Grass Hat 2", 862 }, { "Flag hat", 2993 }, { "Pizza Box hat", 2814 }, { "Roulete hat", 1895 }, { "Ventilator hat", 1661 }, { "Model car hat", 2485 }, }; list = guiCreateGridList( 0.1, 0.1, 0.8, 0.60, true, window ); guiGridListAddColumn( list, "VIP Hats", 0.85 ); for _,obj in ipairs( aObjects ) do hRow = guiGridListAddRow( list ); -- guiGridListSetItemText ( list, hRow, 1, tostring( obj [ 1 ] ), false, false ); guiGridListSetItemData ( list, hRow, 1, tostring( obj [ 2 ] ) ); end function use ( ) local row, col = guiGridListGetSelectedItem ( list ) if ( row and col and row ~= -1 and col ~= -1 ) then local model = tonumber ( guiGridListGetItemData ( list, row, 1 ) ) local x, y, z = getElementPosition ( localPlayer ) if ( isElement ( object ) ) then destroyElement ( object ) end object = createObject ( model, x, y, z + 1, 0, 0, 0 ) attachElements(object, localPlayer, 0.025, -0.01, 0.815, 0, 0, 180) end end addEventHandler ( "onClientGUIClick", _use, use, false ) Link to comment
TAPL Posted January 22, 2013 Share Posted January 22, 2013 -- Client Side -- function use() local row, col = guiGridListGetSelectedItem(list) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(list, row, 1)) triggerServerEvent("xxx", localPlayer, model) end end addEventHandler("onClientGUIClick", _use, use, false) -- Server Side -- object = {} addEvent("xxx", true) addEventHandler("xxx", root, function(model) if isElement(object[source]) then destroyElement(object[source]) end local x, y, z = getElementPosition(source) object[source] = createObject(model, x, y, z + 1, 0, 0, 0) attachElements(object[source], source, 0.025, -0.01, 0.815, 0, 0, 180) end) addEventHandler("onPlayerQuit", root, function() if isElement(object[source]) then destroyElement(object[source]) end end) Link to comment
K4stic Posted January 23, 2013 Author Share Posted January 23, 2013 says not awaible that trigger Link to comment
TAPL Posted January 23, 2013 Share Posted January 23, 2013 says not awaible that trigger What? Link to comment
K4stic Posted January 24, 2013 Author Share Posted January 24, 2013 Debugscript says Client have trigger "xxx" to server side but not awaible sorry bad english Link to comment
TAPL Posted January 24, 2013 Share Posted January 24, 2013 Debugscript says Client have trigger "xxx" to server side but not awaiblesorry bad english What does awaible mean? It's working with me, i don't understand why it doesn't with you. Try change the event name from xxx to anything else. If still not work, then post your server side and client side and meta. 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