Jump to content

pa3ck

Members
  • Posts

    1,141
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by pa3ck

  1. pa3ck

    Help!

    Do you run your own game mode? ( not the default "play" )
  2. Does /debugscript 3 show any errors? Also, if you use your command then it will play the music on the current player's position. You have to use attachElements ( https://wiki.multitheftauto.com/wiki/AttachElements ) and attach the sound to the car.
  3. pa3ck

    SQLITE question.

    Oh, okay, thanks, got it now.
  4. Hello there, I'm learning to use SQLite and I'm not sure about 1,2 things that are written on wiki. function onPlayerQuit ( ) -- when a player leaves, store his current money amount in his account data local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then -- if the player is logged in local playermoney = getPlayerMoney ( source ) -- get the player money setAccountData ( playeraccount, "piraterpg.money", playermoney ) -- save it in his account end end function onPlayerLogin (_, playeraccount ) -- when a player logins, retrieve his money amount from his account data and set it if ( playeraccount ) then local playermoney = getAccountData ( playeraccount, "piraterpg.money" ) -- make sure there was actually a value saved under this key (check if playermoney is not false). -- this will for example not be the case when a player plays the gametype for the first time if ( playermoney ) then setPlayerMoney ( source, playermoney ) end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin ) This is the example given on the wiki and the line I'm not sure about is this: function onPlayerLogin (_, playeraccount ) -- Whats the "_," for? Also whats the "playeraccount" for?
  5. pa3ck

    MTA skin query

    Type in /debugscript 3 then post the errors you got ( if you got any )
  6. When I read you post I was like "Oh my God ******* it, I can't do that" then I got an idea. I cut the main image into pieces. Would it cause lag tho? What do you think? Is it bad idea? EDIT: I got it now, cut it into several pieces and put them together ( took ages tho ).
  7. Okay thanks, what I actually want to do is this: removed What dou you advise me?
  8. The question is simple, is there any way to draw a dxDrawImage to an other dxDrawImage?
  9. When i use the setTimer, It only appear when you scroll the mouse and disappear in less than a second. Did you trigger the event? Or just set a timer on the 'onClientPlayerWeaponSwitch'
  10. What I advise you is read the wiki first - https://wiki.multitheftauto.com/wiki/Main_Page
  11. Well what if you use a timer and set the execution time to the number you want to execute it and create an other timer whick kills the first timer? setTimer killTimer
  12. When the button is pressed, but I figured it out, thanks for the help, really appreciated! BTW: the code I included was right, the other half of the code was wrong, I got it now! ( shame on me ) Thanks for the help again, this is a lovely and helpfull community.
  13. Its funny, it worked then I restarted the script ( made no changes ) and now it says the same thing. And on client side it is working as it sets the player model with this code: setElementModel(thePlayer, skinvEditID) I have no clue whats the problem here.
  14. Actually I would have one more question. What if I need to trigger a server side event and a variable as well? What I want to do is if I click on a GUI button an event will be triggered and I will call that event from server side, so something is going to happen. In my case it will output something in the chatbox. What I want to output is a variable from client side, I'm not quite sure how to do that... Could anyone give me an idea? --Client side local idd = guiGetText(skinEdit) skinvEditID = tonumber(idd) triggerServerEvent('boughtSkin', localPlayer, skinvEditID) --Server side addEvent('boughtSkin', true) addEventHandler('boughtSkin', root, function( skinvEditID ) outputChatBox('Server: a guy got a new skin with the ID of: ' .. skinvEditID ) end ) This code is not working, it says skinvEditID is nil, so cant concatinate it.
  15. Oh, I got it! Thanks very much, appreciated!
  16. Thanks guys for the replies, but I'm still not sure about any of them. What I understood is that, triggerServerEvent triggers an event on server side (I'm genius!). But I'm still not sure how is that going to let me use client side variables. Or can I trigger a whole function like?
  17. Hi again, is there any way to use client side variables on server side? Like GUI is on client side, I got a text from the GUIEditBox and I would like to use that message on server side, to let everybody see the message he typed in. But I got nil for the variable on server side.
  18. pa3ck

    GUI problem

    I felt like I was so silly, but I'm happy it was not my mistake And thanks, it is working now, thanks for the quick support.
  19. pa3ck

    GUI problem

    Hi MTA forumers, I'm trying to use the guiEditBox with a small button beside it and if you press the button it will output your message to the chat. I've done that without a problem BUT if I click on the gui itself ( not the button, anywhere else ) it does the same thing as the button, so outputs the text... I just don't know why and I can't figure it out. I include the short script too: function gui() gui = guiCreateWindow(739, 292, 244, 360, "GUI", false) guiWindowSetSizable(gui, false) guiSetVisible(gui, true) showCursor(true) guiEdit = guiCreateEdit(9, 41, 153, 30, "Enter your message", false, gui) Button = guiCreateButton(172, 41, 58, 31, "Send", false, gui) function writeToChat () local msg = guiGetText ( guiEdit ) outputChatBox (msg ) end addEventHandler ( "onClientGUIClick", Button, writeToChat ) end addCommandHandler('gtest', gui)
  20. Replace the paintjob. If you put a Nissan to Elegy, then it's still an Elegy model, same upgrades, paintjobs etc...
×
×
  • Create New...