Jump to content

DiSaMe

Helpers
  • Posts

    1,461
  • Joined

  • Last visited

  • Days Won

    34

Everything posted by DiSaMe

  1. What's so hard to understand? When you create a weapon, do this on every client, not just the one who entered the vehicle. That means, sync them manually. When the key is pressed, this information has to be synced too. The general ways to transfer the information between the server and client are element data and events: setElementData getElementData addEvent addEventHandler triggerClientEvent triggerServerEvent
  2. Slothbot resource probably needs to be modified to be able to cooperate with other ped-controlling resources. Since NPC HLC is applied to already existing peds and it can be both enabled and disabled (therefore allowing to pass the control to other scripts), it does what is needed from its own side for cooperation, but with Slothbot, it's different. If there's a way to make a Slothbot do nothing (so that Slothbot and NPC HLC resources wouldn't try to control it at the same time), then it may be possible.
  3. DiSaMe

    Solved

    As I said, the event does not exist right after the player has joined because the script has not started yet. Only when onClientResourceStart event is called, you can be sure that the script is running.
  4. That's because in the second case you are comparing ACCOUNTNAME to `'denny19'` (what means a column name), not 'denny19'. Remove the backticks.
  5. It doesn't work because backticks cause everything between them to be interpreted as the column name. As a result, ACCOUNTNAME column is not checked against a value passed to the dbQuery function, but instead, it's checked against a value in the column whose name was passed to dbQuery.
  6. Create the same weapon on every client separately.
  7. DiSaMe

    Question

    Yes, you can. In such case, triggerEvent will return false.
  8. Of course they don't see it, because client-side elements only exist locally.
  9. CJ clothes do not have any IDs, SA-MP does not have any clothing functions and because of that, there's no way for you to have seen non-default CJ clothes in SA-MP. So whatever you need for clothing, import a custom model (like SA-MP did), create an object and attach it to the bone. Simple.
  10. Also, don't concatenate the values into the string yourself. Let dbQuery take care of this by putting ? or ?? in the places of values in the string and passing the values as separate arguments. Otherwise players will be able to inject the code into queries.
  11. DiSaMe

    Solved

    You're triggering the event without adding it with addEvent first. Apart from that, the client-side script starts after onPlayerJoin has already been triggered in the server, so simply putting triggerClientEvent in onPlayerJoin will not work.
  12. That's nice. I have thought of making the same for Blender. If I did that, I would make .dff and .col import/export scripts too.
  13. That means distanceFromPlayerToCheckpoint returns nil.
  14. Only the local player.
  15. result[row_number].column_name result is a table returned by dbPoll.
  16. dbQuery dbPoll And a SELECT statement in dbQuery, of course.
  17. No, you don't. Single SQL statement can insert multiple rows into the table.
  18. You cannot technically 'create' a spawn point - such thing does not exist in MTA itself. The thing which exists is a function: spawnPlayer You can use it to script the spawn points (if you're making your own gamemode) - that's where the true simplicity comes from There's also a Spawnmanager resource (basic spawn point functions) among the standard MTA resources. If you use another gamemode, it may have its own specific spawn system or use the Spawnmanager resource. SA-MP scripting looked easier to me when I had just come to MTA, but when I got familiar with MTA scripting, I had no problems with it. In contrast, when I tried some SA-MP scripting a few months ago after a long break, it was really confusing. After all, SA-MP may have some things easier to make, but often at the cost of reduced flexibility. For example, you may just call a function to make a GUI window show up. In MTA, you need to create the parts of the window (such as buttons, text fields) yourself, what needs more than one function call, but in exchange, you have the freedom to make the window contain whatever you want
  19. Client-side script means a script that runs on the client's computer, not something that doesn't work with multiple clients. If client was unaware of other clients, it wouldn't be multiplayer.
  20. Because the client is aware of other players entering the marker.
×
×
  • Create New...