-
Posts
1,449 -
Joined
-
Last visited
-
Days Won
32
Everything posted by DiSaMe
-
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.
-
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.
-
Model 22 isn't even a weapon. It's a ped. M4 model ID is 356.
-
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.
-
Client-side physics (at least visual) can be implemented to move the ball in a more realistic way.
-
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).
-
BinSlayer1 already wrote what's the solution. Use SetTime. You can make a timer which updates time every minute, that should be enough.
-
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.
-
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.
-
Grass visibility depends on video settings, so it's up to players to choose if they want it or not.
-
Element data can be used to sync the ball position.
-
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
-
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.
-
You can also script path nodes which the bot could follow to the target.
-
Yes, variables aren't synced between server and clients, so variables set in the server won't be visible for client and vice-versa.
-
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.
-
Laggy? 1 update in 5 seconds, what's so laggy? Have you already tried that?
-
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.
-
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.
-
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
-
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.
-
I think this could be the solution: getElementPosition client-side --> triggerServerEvent with coordinates --> setElementPosition server-side.
-
Gerai, ačiū už psichologinį palaikymą
-
Ž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