CTCCoco Posted March 7, 2010 Posted March 7, 2010 How I can use player fuctions on onClientGUIClick? Thanks.
karlis Posted March 7, 2010 Posted March 7, 2010 for example: yourbutton=guiCreateButton(0,0,20,20,false) function processclick(button,state) if button=="left" and state=="up" then --do what you want end end addEventHandler("onClientGUIClick",yourbutton,processclick) watch https://wiki.multitheftauto.com/wiki/Cat ... _Tutorials , and try find it in wiki before asking in forums to help
CTCCoco Posted March 7, 2010 Author Posted March 7, 2010 for example: yourbutton=guiCreateButton(0,0,20,20,false) function processclick(button,state) if button=="left" and state=="up" then --do what you want end end addEventHandler("onClientGUIClick",yourbutton,processclick) watch https://wiki.multitheftauto.com/wiki/Cat ... _Tutorials , and try find it in wiki before asking in forums to help You say that I don't use the Wiki? Then why I know that this event exist? magic? because I use the LUA editor. I don't see how to use the players fuctions on the wiki pages on this fuction.
karlis Posted March 7, 2010 Posted March 7, 2010 all clicks is clientside, so u dont need get player from it, and by triggering server events u can use variable "client" what is clients root elemnt that triggered the event.
Jumba' Posted March 7, 2010 Posted March 7, 2010 for example: yourbutton=guiCreateButton(0,0,20,20,false) function processclick(button,state) if button=="left" and state=="up" then --do what you want end end addEventHandler("onClientGUIClick",yourbutton,processclick) watch https://wiki.multitheftauto.com/wiki/Cat ... _Tutorials , and try find it in wiki before asking in forums to help You say that I don't use the Wiki? Then why I know that this event exist? magic? because I use the LUA editor. I don't see how to use the players fuctions on the wiki pages on this fuction. That's because you don't look for them. https://wiki.multitheftauto.com/wiki/Int ... _the_click
CTCCoco Posted March 7, 2010 Author Posted March 7, 2010 for example: yourbutton=guiCreateButton(0,0,20,20,false) function processclick(button,state) if button=="left" and state=="up" then --do what you want end end addEventHandler("onClientGUIClick",yourbutton,processclick) watch https://wiki.multitheftauto.com/wiki/Cat ... _Tutorials , and try find it in wiki before asking in forums to help You say that I don't use the Wiki? Then why I know that this event exist? magic? because I use the LUA editor. I don't see how to use the players fuctions on the wiki pages on this fuction. That's because you don't look for them. https://wiki.multitheftauto.com/wiki/Int ... _the_click you can't use player fuctions ... you must tigger an server-side event... and YES I SEE THIS https://wiki.multitheftauto.com/wiki/Int ... _the_click a lot of times. Well thanks for all.
50p Posted March 8, 2010 Posted March 8, 2010 CTCCOco, for instance myself, I have no idea what this topic is about. Saying: How I can use player fuctions on onClientGUIClick?Thanks. doesn't make sense to me. onClientGUIClick is an event which can call your functions. In your function you can call other functions, eg. player function. I don't know if this helps but if it doesn't then please explain a little more.
CTCCoco Posted March 8, 2010 Author Posted March 8, 2010 CTCCOco, for instance myself, I have no idea what this topic is about. Saying:How I can use player fuctions on onClientGUIClick?Thanks. doesn't make sense to me. onClientGUIClick is an event which can call your functions. In your function you can call other functions, eg. player function. I don't know if this helps but if it doesn't then please explain a little more. Thanks for reply. I want do this in onClientGUIClick : local casasxml = xmlLoadFile("casas.xml") local hEntrancex = xmlNodeGetAttribute ( casasxml, "hEntradax." .. clickhouses ) local hEntrancey = xmlNodeGetAttribute ( casasxml, "hEntraday." .. clickhouses ) local hEntrancez = xmlNodeGetAttribute ( casasxml, "hEntradaz." .. clickhouses ) local hValue = xmlNodeGetAttribute ( casasxml, "hValue." .. clickhouses ) local hOwner = xmlNodeGetAttribute ( casasxml, "hOwner." .. clickhouses ) local hValue = tonumber ( hValue ) local dinero = getPlayerMoney (idontkown) if(hOwner == "Estado") then if(dinero >= hValue) then setPlayerMoney ( idontknow, dinero - hValue) outputChatBox("Enhorabuena. Has comprado esta casa por " .. hValue .. "$.") local nombre = getPlayerName (getLocalPlayer()) xmlNodeSetAttribute ( casasxml, "hOwner." .. clickhouses, nombre) xmlSaveFile(casasxml) guiSetVisible(windowTituloCasa, false) showCursor(false) else outputChatBox("No tienes sucifiente dinero encima para comprar esta casa.") guiSetVisible(windowTituloCasa, false) showCursor(false) end else outputChatBox("Esta casa ya tiene un propietario.") guiSetVisible(windowTituloCasa, false) showCursor(false) end I can't use the player fuctions like GetPlayerMoney What I can do?
CTCCoco Posted March 8, 2010 Author Posted March 8, 2010 getLocalPlayer() Doesn't works and I don't know why. EDIT: Problem solved thanks.
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