TheIceman1 Posted July 24, 2012 Share Posted July 24, 2012 I need set vehicle name on row,whats wrong?No errors Server side: function settext () local accn = getPlayerAccount ( source ) local accdata = getAccountData ( accn, "owner" ) triggerClientEvent ( source, "setext", source ) end addEvent ( "settext", true ) addEventHandler ( "settext", root, settext ) Client side: function setext ( data ) guiGridListSetItemText (GUIEditor_Grid[2], GUIEditor_Row[2], GUIEditor_Column[1], data, false, true) end addEvent ( "setext", true ) addEventHandler ( "setext", root, setext ) Link to comment
scratcher911 Posted July 24, 2012 Share Posted July 24, 2012 function settextServer () local accn = getPlayerAccount ( source ) local accdata = getAccountData ( accn, "owner" ) triggerClientEvent ( source, "setextClient", source, accdata ) -- You forgot to add accdata end addEvent ( "settextServer", true ) addEventHandler ( "settextServer", root, settextServer ) function setextClient ( data ) guiGridListSetItemText (GUIEditor_Grid[2], GUIEditor_Row[2], GUIEditor_Column[1], data, false, true) end addEvent ( "setextClient", true ) addEventHandler ( "setextClient", root, setextClient ) Link to comment
Genius Posted July 24, 2012 Share Posted July 24, 2012 function settextServer () local accn = getPlayerAccount ( source ) local accdata = getAccountData ( accn, "owner" ) triggerClientEvent ( source, "setextClient", source, accdata ) -- You forgot to add accdata end addEvent ( "settextServer", true ) addEventHandler ( "settextServer", root, settextServer ) function setextClient ( data ) guiGridListSetItemText (GUIEditor_Grid[2], GUIEditor_Row[2], GUIEditor_Column[1], data, false, true) end addEvent ( "setextClient", true ) addEventHandler ( "setextClient", root, setextClient ) Dont work Link to comment
scratcher911 Posted July 24, 2012 Share Posted July 24, 2012 Any errors ? Off: Dude how much accounts do you have on this forum Link to comment
AMARANT Posted July 24, 2012 Share Posted July 24, 2012 Try this: Server: function settextServer () -- I suppose you trigger this function from client but you didn't mention it or there will be no 'source' local accn = getPlayerAccount ( source ) local accdata = getAccountData ( accn, "owner" ) triggerClientEvent ( "setextClient", source, accdata ) end addEvent ( "settextServer", true ) addEventHandler ( "settextServer", root, settextServer ) Client: function setextClient ( data ) guiGridListSetItemText (GUIEditor_Grid[2], GUIEditor_Row[2], GUIEditor_Column[1], tostring(data), false, true) end addEvent ( "setextClient", true ) addEventHandler ( "setextClient", getLocalPlayer(), setextClient ) Link to comment
TheIceman1 Posted July 24, 2012 Author Share Posted July 24, 2012 Try this:Server: function settextServer () -- I suppose you trigger this function from client but you didn't mention it or there will be no 'source' local accn = getPlayerAccount ( source ) local accdata = getAccountData ( accn, "owner" ) triggerClientEvent ( "setextClient", source, accdata ) end addEvent ( "settextServer", true ) addEventHandler ( "settextServer", root, settextServer ) Client: function setextClient ( data ) guiGridListSetItemText (GUIEditor_Grid[2], GUIEditor_Row[2], GUIEditor_Column[1], tostring(data), false, true) end addEvent ( "setextClient", true ) addEventHandler ( "setextClient", getLocalPlayer(), setextClient ) Dont work Link to comment
Castillo Posted July 24, 2012 Share Posted July 24, 2012 How do you trigger this event: "settext"? Link to comment
TheIceman1 Posted July 24, 2012 Author Share Posted July 24, 2012 How do you trigger this event: "settext"? Dont understand. Link to comment
Castillo Posted July 24, 2012 Share Posted July 24, 2012 Post the part where you trigger that event. Link to comment
TheIceman1 Posted July 24, 2012 Author Share Posted July 24, 2012 This? function settext () local accn = getPlayerAccount ( source ) local accdata = getAccountData ( accn, "owner" ) triggerClientEvent ( source, "setext", source ) end addEvent ( "settext", true ) addEventHandler ( "settext", root, settext ) Link to comment
Castillo Posted July 24, 2012 Share Posted July 24, 2012 No, post the script which triggers the event: "settext". Link to comment
AMARANT Posted July 24, 2012 Share Posted July 24, 2012 That's what I mentioned in my comment to lua-code. Solidsnake14, don't you think he didn't even trigger that function? Link to comment
Castillo Posted July 24, 2012 Share Posted July 24, 2012 Is what I'm thinking, as he doesn't even understand what I mean. Link to comment
TheIceman1 Posted July 24, 2012 Author Share Posted July 24, 2012 I didnt triggered "settext" Link to comment
Castillo Posted July 24, 2012 Share Posted July 24, 2012 How do you expect your script to work then? Link to comment
Jaysds1 Posted July 24, 2012 Share Posted July 24, 2012 , seems kinda rude, but still "TheIceman1", you have to trigger it. Link to comment
TheIceman1 Posted July 24, 2012 Author Share Posted July 24, 2012 I triggered it but its dont work Client side: function setextClient ( data ) guiGridListSetItemText (GUIEditor_Grid[2], GUIEditor_Row[2], GUIEditor_Column[1], data, false, true) triggerServerEvent ( "settextServer", getLocalPlayer()) end addEvent ( "setextClient", true ) addEventHandler ( "setextClient", root, setextClient ) Server side: function settextServer () -- I suppose you trigger this function from client but you didn't mention it or there will be no 'source' local accn = getPlayerAccount ( source ) local accdata = getAccountData ( accn, "owner" ) triggerClientEvent ( "setextClient", source, accdata ) end addEvent ( "settextServer", true ) addEventHandler ( "settextServer", root, settextServer ) Link to comment
AMARANT Posted July 24, 2012 Share Posted July 24, 2012 (edited) Of course it won't. Your two functions trigger each other but there's no event that call at least one of them. Edited July 24, 2012 by Guest Link to comment
Jaysds1 Posted July 24, 2012 Share Posted July 24, 2012 Sorry, but this script doesn't make sense, how is the client-side script suppose to trigger if the server has to trigger it, but in order for the server to trigger it the client has to trigger it, THIS IS GOING TO BE A LOOP!!! Link to comment
AMARANT Posted July 24, 2012 Share Posted July 24, 2012 You should make it like this: Client side: function setextClient ( data ) outputChatBox(tostring(data).." received!") guiGridListSetItemText (GUIEditor_Grid[2], GUIEditor_Row[2], GUIEditor_Column[1], tostring(data), false, true) end addEvent ( "setextClient", true ) addEventHandler ( "setextClient", getLocalPlayer(), setextClient ) Server side: function settextServer (thePlayer) local accn = getPlayerAccount ( thePlayer ) local accdata = getAccountData ( accn, "owner" ) triggerClientEvent ( "setextClient", thePlayer, accdata ) end addCommandHandler ( "text", settextServer ) Link to comment
TheIceman1 Posted July 24, 2012 Author Share Posted July 24, 2012 Now i can buy only one car how can i make it to i can have 2 cars? Link to comment
AMARANT Posted July 24, 2012 Share Posted July 24, 2012 Well... Actually we don't know about your system. Why don't you provide us with the full code and then we could try to help you? Link to comment
TheIceman1 Posted July 25, 2012 Author Share Posted July 25, 2012 Well... Actually we don't know about your system. Why don't you provide us with the full code and then we could try to help you? If i will post full code then its complet script i can send it to you via PM. 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