Jump to content

myonlake

Members
  • Posts

    2,312
  • Joined

  • Days Won

    40

Everything posted by myonlake

  1. myonlake

    Extample

    You cannot use onPlayerSpawn. It will spawn you indefinitely. You have to use something else, like in my code I used onPlayerJoin.
  2. myonlake

    Extample

    Umm, no. That's just wrong. You're looping through the array and causing the player to spawn in five places instead of a random place once. You didn't even define a player, and that random number part wouldn't work neither, because you need the count of the array, not the array values. Server-side local spawnTable = { -- x, y, z, rotation, skin id, interior, dimension { 0, 0, 3, 0, 0, 0, 0 }, { 5, 5, 3, 90, 280, 0, 0 }, { 10, 10, 3, 180, 287, 0, 0 }, { 15, 15, 3, 270, 18, 0, 0 }, { 20, 20, 3, 0, 12, 0, 0 } } addEventHandler( "onPlayerJoin", root, function( ) local spawnID = math.random( 1, #spawnTable ) spawnPlayer( source, unpack( spawnTable[ spawnID ] ) ) outputChatBox( "You spawned in spawn point " .. spawnID .. ".", source, 20, 245, 20, false ) end )
  3. myonlake

    sounds

    Initialize an array with the song paths and push the array key until it gets to the end of the array - then start from the beginning of the array and repeat the same thing. Make sure to use destroyElement or stopSound each time you skip a song, this way you won't get multiple sounds playing simultaneously.
  4. In addition, the code itself doesn't make any sense at all, therefore I suggest no one will try the code in hopes of creating a gate with a password...
  5. We don't make scripts for you. You must do them yourself, find a scripter to do it for you for some price, or find it from the community. You should read the links included in my post. Rendering automatically "updates" the data you do, because it renders it again each frame. This way you won't have to worry about updating the dxDrawText. Also, about the seeds, like I said, you can use variables or element data to save the seed amount. You can use guiGetScreenSize to get the screen width and height and calculate the position of the text relative to the scale.
  6. Switch setPlayerWanted to setPlayerWantedLevel. And what do you mean by exported function? You can just use setAccountData whenever you need to.
  7. In the 'loadwanted' function, switch 'playerAccount' to 'playeraccount'. Simply the typo causes it not to work.
  8. It should work. Make sure the script is server-side since the account functions can only be triggered from the server.
  9. myonlake

    sounds

    If you want everybody to hear a song, you will have to use playSound function. If you want it to play locally at some location, use playSound3D.
  10. No, it does not. For that reason you should instead of using player element as array key, use a unique key like account ID or so. This way you can always get the saved player time without getting an error of undefined element after the player has quit.
  11. myonlake

    help

    We don't support leaked scripts.
  12. I feel like you cannot unbind MTA internal commands from keys.
  13. getBoundKeys returns an array, which means you have to loop through the array and remove each one in it. local illegalHandlers = { "reconnect", "disconnect" } function checkBinds( ) local wasWarned for _, handler in ipairs( illegalHandlers ) do if ( getBoundKeys( handler ) ) then for key, state in pairs( getBoundKeys( handler ) ) do unbindKey( key, state, handler ) end if ( not wasWarned ) then outputChatBox( "You mustn't have this key bound.", 255, 0, 0, false ) wasWarned = true end end end end setTimer( checkBinds, 60000, 0 ) Note, that this is client-side code, so make sure to have the script set to client-side in meta.xml configuration file. EDIT: Copy the code again. Been scripting other languages all day long so I went crazy with the brackets, heh.
  14. You need to get a MySQL database by purchasing web space or simply just a MySQL server. If you're running the server locally, you can install MAMP, XAMPP or a SQL server. You can find information with Google, simply. I suggest installing either MAMP or XAMPP so you can run phpMyAdmin, which allows you to edit MySQL databases on localhost.
  15. You should check the Wiki's DirectX-functions and test the examples provided in the articles. You should test out the rectangle, line and text functions. Those are the ones that you need. https://wiki.multitheftauto.com/wiki/Cl ... _functions
  16. It's because your event is returning 'p' as a player element, and you're using 'player', which doesn't exist. Switch 'player' to 'p' and it will work. So, triggerClientEvent(player, "", player... should be triggerClientEvent(p, "", p....
  17. That wouldn't return a nil value on the whole function, especially because he's not even using the z variable. It's because you are running the code server-side. Renderable graphic functions are only available client-side for obvious reasons. Switch over to client-side by placing type="client" on your meta.xml script-node as follows. <meta> <script src="welcome.lua" type="client" /> </meta>
  18. You can use dxDrawText to draw 2D text on the screen. Render it with onClientRender event client-side and you can use a variable or player's element data to output the current amount of seeds. When they click the button on the GUI, it will increase the amount of seeds by changing the value of the variable or player's element data. When they hit the max, it will disable the button. That marker is a custom marker created with dxDrawLine3D. I wouldn't suggest spending time on making that, because I think it's difficult for you to understand the mathematical algorithms behind it. Feel free to try if you want to, I can assure you the algorithm is interesting to implement in MTA and see it work. I made a simple 2D outline circle system myself, it was fun to make despite all the problems I faced when trying to find out the best way to do it.
  19. Free hosts rarely accept remote connections. You have to pay for a MySQL server/webhost that has that feature enabled. Hosting24 has that feature in it, you can set remote access in cPanel simply by entering the source IP address.
  20. That's not efficient for free camera movement. It's better to make your own camera system and calculate a sphere around the character.
  21. You can't, unless you make your own camera system.
  22. There is no function for createVehicleHandler.
  23. You could post the code here for us to find the problem in your code.
  24. Not possible. Simply because the textures and models aren't the same. If there are some IPL to MAP convertors you're free to try, but it will get messy. Edit: Wops, mobile phone got crazy. Sorry for the triplepost.
×
×
  • Create New...