TheIceman1 Posted July 24, 2012 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 ) Need paid scripter just pm me i will accept every job!
scratcher911 Posted July 24, 2012 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 )
Genius Posted July 24, 2012 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 MTA Scripter. If you want scripter PM me and i will accept every job for fair price.
scratcher911 Posted July 24, 2012 Posted July 24, 2012 Any errors ? Off: Dude how much accounts do you have on this forum
AMARANT Posted July 24, 2012 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 )
TheIceman1 Posted July 24, 2012 Author 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 Need paid scripter just pm me i will accept every job!
Castillo Posted July 24, 2012 Posted July 24, 2012 How do you trigger this event: "settext"? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
TheIceman1 Posted July 24, 2012 Author Posted July 24, 2012 How do you trigger this event: "settext"? Dont understand. Need paid scripter just pm me i will accept every job!
Castillo Posted July 24, 2012 Posted July 24, 2012 Post the part where you trigger that event. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
TheIceman1 Posted July 24, 2012 Author 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 ) Need paid scripter just pm me i will accept every job!
Castillo Posted July 24, 2012 Posted July 24, 2012 No, post the script which triggers the event: "settext". San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
AMARANT Posted July 24, 2012 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?
Castillo Posted July 24, 2012 Posted July 24, 2012 Is what I'm thinking, as he doesn't even understand what I mean. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
TheIceman1 Posted July 24, 2012 Author Posted July 24, 2012 I didnt triggered "settext" Need paid scripter just pm me i will accept every job!
Castillo Posted July 24, 2012 Posted July 24, 2012 How do you expect your script to work then? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Jaysds1 Posted July 24, 2012 Posted July 24, 2012 , seems kinda rude, but still "TheIceman1", you have to trigger it. My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
TheIceman1 Posted July 24, 2012 Author 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 ) Need paid scripter just pm me i will accept every job!
AMARANT Posted July 24, 2012 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
Jaysds1 Posted July 24, 2012 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!!! My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Wei Posted July 24, 2012 Posted July 24, 2012 helped him via Skype. Diet with russian vodka, lose 3 days in one week !
AMARANT Posted July 24, 2012 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 )
TheIceman1 Posted July 24, 2012 Author Posted July 24, 2012 Now i can buy only one car how can i make it to i can have 2 cars? Need paid scripter just pm me i will accept every job!
AMARANT Posted July 24, 2012 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?
TheIceman1 Posted July 25, 2012 Author 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. Need paid scripter just pm me i will accept every job!
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