Jump to content

50p

Retired Staff
  • Posts

    2,973
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by 50p

  1. It's almost 6am here and I'm tired but I'll try to help. First, it's not OnClientResourceStart but onClientResourceStart. I'm not really sure what is wrong with the command but I'm sure the "if" statement at line 18 will never get executed since createVehicle is a function and it will never be false unless you set it to false. You need to debug the command.
  2. 50p

    Sync/Async I/O

    AFAIK, file and SQLite functions are synchronous. Not sure if MySQL is synchronous though but probably is too. I wonder why you asked these questions here not IRC where most devs are?
  3. 50p

    House icon

    Don't you understand he was asking why do cylinder markers float? Every pickup floats and that's correct functionality in most games. The floating cylinder isn't though, so getGroundPosition was used to get ground position which then can create cylinder marker on the ground not in air. https://forum.multitheftauto.com/posting ... 0#pr302982
  4. 50p

    The dreaded KIHC

    Probably the resource is bugged and you can't use it. Or maybe it need you to restart the resource after you build the houses... I'm not sure I only helped to test this resource not script it and I did it ages ago (its first stages). Maybe others have more experience with this resource than I do. So wait patiently, someone will reply.
  5. 50p

    The dreaded KIHC

    If you added to your gamemode or main script you use all the time while it was running, you need to update it (restart or refresh commands). The tag tells the server you want to start another resource when you start your resource. That's why author explained to include KIHC resource in your script/gamemode so you won't have to start it separately. If you don't get any errors/warnings or nothing works, it's probably because the resource is not running.
  6. 50p

    House icon

    It floats because in the past (DP2 era) cylinder markers where snapped to the ground, no matter how heigh they were created. People used player's position to use for markers (including cylinders) which is center of the player's body (~1 unit above the floor). Since MTA 1.0 markers don't snap to the ground but instead they are created at the exact position as the coordinates passed to createMarker function, so center of the player's body. This is why they float. To fix it, you can subtract 1 (or .8, can't remember exact number) from Z value.
  7. You can try to change helicopter's rotor speed with https://wiki.multitheftauto.com/wiki/Set ... RotorSpeed
  8. There is no switch in Lua. You have to use if, elseif and else statements instead.
  9. 50p

    House icon

    That's what they are trying to do. I've never used this script and don't know how it works but as someone said, the script has to know if the house has been bought before it creates the house pickup and the "if" statement is what you want to check if the house has owner.
  10. You can use "refresh" command to update the changes you made without restarting server. Maybe this command will show you errors. If refreshing won't help, try to use "info " command.
  11. Jason_Gregory, if you want to help, make sure it works or be 99.9% sure it works. In a 4 lines script you made 2 mistakes. I'll let you find them.
  12. Look what I found by searching "engine state" https://forum.multitheftauto.com/viewtop ... te#p297850 I'm not sure if you need this but at least I use "uber, awesome, 1337 feature of the forum called Search".
  13. These are 3 topics on the first page in "Scripting" section of the forum: https://forum.multitheftauto.com/viewtop ... 91&t=26510 https://forum.multitheftauto.com/viewtop ... 91&t=26482 https://forum.multitheftauto.com/viewtop ... 91&t=26504 Do you know how many of them are there in total? Go ahead and count. Most of the topics like this, if not all, end up with author starting to script himself or just not having new scripts for the server. Have a look at https://community.multitheftauto.com/index.html?p=resources and you may find something that may interest you.
  14. Why don't you check debug window or server console? I'm sure you will see an error message. Start debugging script.. most of the things people ask here are so simple to fix that can be fixed by debugging the script. Use "debugscript 3" command and you'll find out what's wrong with your code. - Use "debugscript 3" all the time, even when making simple scripts - Use outputChatBox/outputDebugString to show yourself what the code does. Put simple "outputChatBox( 'i am in onPlayerConnect function' )" inside your onPlayerConnect function, restart resource and rejoin the server. Can you see the message? What is wrong if you can't see it? The function is not called. Why? You probably didn't attach it to onPlayerConnect event. How simple was that? - getAccountData ~= GetAccountData - This is MTA not SA-MP. Function names start with lower case. I'll keep directing people to debug page on wiki until they'll understand how important debugging scripts is and how easy for them it is to fix the errors in their scripts without need to ask here and wait for people to reply. https://wiki.multitheftauto.com/wiki/Debugging
  15. source is not available in command handlers and I guess you didn't set it as parameter for function that is called by command. addCommandHandler( "invite", function( playerWhoTypedCommand, command, otherPlayersName ) local otherPlayer = getPlayerFromName( otherPlayersName ); if ( otherPlayer ) then -- check if such player is online outputChatBox ( getPlayerName ( playerWhoTypedCommand ).. " has invited " .. otherPlayersName .. " to their team " "(".. getTeamName( getPlayerTeam ( playerWhoTypedCommand ) ) ..")", otherPlayer ) outputChatBox ( "Invitation sent.", playerWhoTypedCommand ); else outputChatBox ( "Player '".. otherPlayersName .. "' is not online.", playerWhoTypedCommand ); end end ) Advice: Learn from other scripts and use wiki, don't just copy'n'paste, otherwise you'll never know how to script.
  16. If you know how xml file looks (what's inside) then you shouldn't have any problems with saving car's position in an xml file. You know how to add commands and get vehicle's position. All you need to do is create or load an xml file, add a node and store vehicle's position in the new node's attributes. Why don't you read wiki or the basics tutorial?
  17. then this is the first step to go. get notepad++. it's an almost impossible task to produce decent code with notepad. Lies! I made bank resource purely in Windows' Notepad since I didn't know about Notepad++ at that time. BTW, to people who have problem with MTA:SE saving files on Vista or Win7: does anyone know where the files are saved and if they are actually saved anywhere? Is may be UAC problem and MTA:SE has no access to save files in C:\Program Files\ folder and its subfolders (I don't use any of these OSes so I don't know their system folders' locations) or somewhere else where your MTA Server is installed. Please don't use this topic for replying, post your replies in MTA:SE topic, please. Thanks.
  18. 50p

    Safe Marker

    You can't mix client and server side scripts in one file. Besides, your script would make everyone invincible if the resource started.
  19. That requires scripting knowledge. It's not simple 2-3 lines of code so I'll not code it for you but I'll tell you where to go to learn to script https://wiki.multitheftauto.com/wiki/Main_Page https://forum.multitheftauto.com/viewtop ... 91&t=25032
  20. Everything is on the wiki... Syntax, parameters description, example, etc.
  21. There are 2 easy ways to do it; in meta.xml or via admin panel. 1. In meta.xml of race find name="*skins". Change value (by default cj) to your skin ID. OR 2. Open admin panel (P key by defaul), select "Resources" tab and double click "race" resource. Find "skins" in the list of settings and change it.
  22. sqrt function is part of math library. This means you need to use math.sqrt.
  23. You basically need to communicate client side script with server side script. So, yes, you need to use custom event. Take a look at the events tutorial http://robhol.net/guide/basics/?p=8 and you should find "Custom events and server-client communication" section at the bottom of the page. This is what you want.
  24. Yes, but this is only available in client side scripts. You can't get player's weapon from specific slot in server side script.
×
×
  • Create New...