Jump to content

DiSaMe

Helpers
  • Posts

    1,449
  • Joined

  • Last visited

  • Days Won

    32

Everything posted by DiSaMe

  1. Satchel charges are remote explosives which you can plant and detonate from a distance. There's no function for shooting bullets. You can use position and rotation of the weapon to get the coordinates in front of it, then get hit element/position with processLineOfSight and if it hits something, change element health. That's the main part. You can also add particles with effects function and dxDrawLine3D to make the bullet path visible.
  2. DiSaMe

    SP Enabled?

    It's possible to make such resource for MTA, but all features would have to be copied from the game, so that's a lot of work.
  3. Model 22 isn't even a weapon. It's a ped. M4 model ID is 356.
  4. DiSaMe

    tables

    It's better not to create an object, but to create an abstract element with createElement instead.
  5. Is it "double posting" to post a message a few days later from the last message? And now, the script problems: server-side function setTrain and client-side function getTrain trigger events, calling each other. That means the train position will be refreshed very fast, as the server asks for the new position right after it gets the previous. And the number of such cycles is increased every 5 seconds. That will make the game unplayable very soon. I will try to explain better what you need to do: 1. Make the server-side timer do NOTHING more than just triggering the client-side event (asking for position). 2. When server gets the position, the function called by setTrainPosition event should do NOTHING more than setting element positions. No event triggering.
  6. Client-side physics (at least visual) can be implemented to move the ball in a more realistic way.
  7. If you want to script the ped yourself: setPedControlState to make the ped walk. setPedCameraRotation to make the ped face the right direction. Also, remember that these are client-side functions, so you'll need some server-client communication to keep the ped actions synced. I'd recommend using element data for this (for example, to set the element which the ped will follow).
  8. BinSlayer1 already wrote what's the solution. Use SetTime. You can make a timer which updates time every minute, that should be enough.
  9. When the resource starts serverside, it hasn't started clientside yet. If event is triggered before the resource which adds it is downloaded, that will result in an error. Using a timer isn't reliable - you can't be sure that client will download the resource before the timer function gets executed. It's better to trigger server event onClientResourceStart, so the server knows the resource has started clientside, and then showDX can be triggered.
  10. 3. The light itself can't be synced, but you can disable horn control when player is in police heli and create your own light using custom models. 4. It's easy to get offset coordinates. X positive is the right, Y positive is the front, Z positive is the top. GTA units are metres. You can find coords in a few attempts.
  11. DiSaMe

    MTA Problems

    Grass visibility depends on video settings, so it's up to players to choose if they want it or not.
  12. Element data can be used to sync the ball position.
  13. Prieš savaitę pavyko su asembleriu sukurti pirmąją veikiančią funkciją, kuri tiesiog pakeičia kintamojo reikšmę. Tada pabandžiau ir atskirų pixelių spalvinimo bei horizontalių linijų piešimo funkcijas sukurti - irgi pavyko. Ir daug greičiau veikia, nei ant C. Tai va, reikėtų susikurti funkciją, skirtą trikampių su tekstūrom piešimui, o iš trikampių jau viskas gali būti sudėliota. Tik nedidelė problema atsirado. Po kelių savaičių pertraukos neištvėriau ir grįžau prie Minecraft, žiauriai geras žaidimas, negaliu sustot ir skirti bent dalį laiko programavimui
  14. DiSaMe

    Wanted

    callServerFunction won't help. It doesn't return any value, so calling getPlayerWantedLevel in such way is useless. Just make a server-side script for setting element data value to wanted level. That's the easiest and the most efficient way.
  15. You can also script path nodes which the bot could follow to the target.
  16. Yes, variables aren't synced between server and clients, so variables set in the server won't be visible for client and vice-versa.
  17. There's an optional argument for triggerClientEvent. And to find the nearest player, you need to loop through all of them and calculate the distances.
  18. Laggy? 1 update in 5 seconds, what's so laggy? Have you already tried that?
  19. There's no need to sync the train so often. Just create a timer which executes the function like every 5 or 10 seconds, checks if the train has the syncer, and if it doesn't, find the nearest player, use triggerClientEvent to ask for train position, on the client side, get the position, use triggerServerEvent to send the position to the server and again, on the server side, use those coordinates in setElementPosition.
  20. The whole table gets copied when you use set/getElementData. So element data doesn't change when you modify a value in the table. The only way to change it is using setElementData again, but that is wasteful, because the whole table has to be copied again.
  21. Ką tik įkėliau dar vieną video: . Čia jau su tekstūrom, bet optimizacijos tai žiauriai reikia. Tokius dalykus su OpenGL būtų galima nesunkiai padaryt, bet jo naudoti dar nebandžiau. Be to, ir pačiam kurt piešimo funkcijas įdomu
  22. If nobody is connected to the server, then server has no player to sync the train, so it won't move, but there will be no players to see that anyway.
  23. I think this could be the solution: getElementPosition client-side --> triggerServerEvent with coordinates --> setElementPosition server-side.
  24. Gerai, ačiū už psichologinį palaikymą
  25. Žiūrint, ką laikysim rimtumu Programuodamas loginių įgūdžių įgijau daug, bet man irgi dažnai taip būna, kad pradedu ir nebaigiu. Nors jau kurį laiką būna truputį kitaip - pradedu, tada nusprendžiu, kad reikia pradėti iš naujo, "dar geresniu" būdu Vakar pavyko ant C rasti, ką ten negerai dariau, tai ir video neilgą padariau: . Bet jau tada mačiau, kad programos kodas gana netvarkingas, tai ką tik vėl iš naujo pradėjau Tikiuosi, kad šis kelias bus "tikrasis", nors dažniausiai būna priešingai. Svarbiausia pradėti dirbti rimtai, nes mokyklą baigiu, tai pinigus juk kažkaip reikės uždirbinėti, o programuoti daug geriau, negu griovius kasti
×
×
  • Create New...