Jump to content

DiSaMe

Helpers
  • Posts

    1,461
  • Joined

  • Last visited

  • Days Won

    34

Everything posted by DiSaMe

  1. 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.
  2. You can also script path nodes which the bot could follow to the target.
  3. Yes, variables aren't synced between server and clients, so variables set in the server won't be visible for client and vice-versa.
  4. 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.
  5. Laggy? 1 update in 5 seconds, what's so laggy? Have you already tried that?
  6. 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.
  7. 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.
  8. 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
  9. 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.
  10. I think this could be the solution: getElementPosition client-side --> triggerServerEvent with coordinates --> setElementPosition server-side.
  11. Gerai, ačiū už psichologinį palaikymą
  12. Ž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
  13. Aš prieš kokius 7-8 metus pradėjau ant Game Maker eksperimentuot. Ten galima ir be programavimo kurti, bet, norint padaryti ką nors geresnio, reikia ir paprogramuoti, ir tam skirta GML (Game Marker language) programavimo kalba. Iš pradžių bandydavau paprastesniu būdu, o po to ir GML naudoti pradėjau. Tai buvo mano programavimo pradžia. Po to, prieš 5-6 metus ir ant C programuoti išmokau. Vėliau pradėjau su Pawn ant SA-MP kurti gamemodą, bet nelabai ten ką ir padariau, tada išleido MTA SA DM DP1 ir pradėjau scriptint ant Lua. Tai, atrodo, daugiausiai mano naudota programavimo kalba. Neseniai dar ir Python truputį mokinausi, kad galėčiau ant Blender susikurti DFF import/export scriptą, bet taip jo ir nebaigiau. Dabar stengiuosi vėl ant C susitelkt. SDL library atsisiunčiau, galvoju, reikia kokį žaidimą sukurti. Tik va, toks vaizdas, kad kintamieji konfliktuoja Dar su pointeriais kai kuriais atvejais būna sunkoka susigaudyt, bet paskaitau internete ir aiškiau pasidaro. Kadangi ketinu savo žaidimui pats sukurti 3D software grafikos variklį, tai bandžiau dar asembleriu mokintis, kad galėčiau juo labiausiai greičio reikalaujančias funkcijas sukurti, bet paskaičiau vakar ar užvakar apie C kodo optimizacijas, tai pamačiau, kad ir be asemblerio galima labai pagreitinti O mokykloje su Pascal pradėjom prieš 3 metus mokintis, ir labai jau lengva buvo, turint programavimo patirties
  14. Looping is unnecessary here langlist = { ar = "Arabic", en = "English" } ----------- lang = langlist[lang]
  15. I once had made a custom tram system by remaking the path myself and using setElementPosition/Velocity to move the tram along the path. It used both San Fierro tram lines and one tram could be attached to another. Unfortunately, I lost the gamemode I had made the tram for and I have no screenshots or videos. Still, it was a simple system, and if I make something like that again, I will make the whole train system with better functionality, but I don't script on MTA much nowadays.
  16. Actually it's only about 18000 models. I just tested it. Size of IDs are 2 bytes, so if, for example, you try to create an object with model 67536, the object with model 2000 is created. Damn, I wish it was really possible to add new models... Before testing this, I was thinking: "OMG! Why didn't anyone tell me about this before? Now I'm going to put Liberty City and Vice City into the game without any problems!"
  17. You could try converting quaternion to rotation matrix and then rotation matrix to Euler angles.
  18. DiSaMe

    :roll: Video

    What I requested can be imitated by drawing separate pixels with dxDrawRectangle, but that will slow the game down.
  19. DiSaMe

    :roll: Video

    OK, I have one more suggestion about feature which would make scriptable videos really efficient: an ability to use 2D tables as image data. DX image functions could allow passing table to filename parameter, and values in the table would be colors of every pixel. Table size would be used to get the dimensions of the image. Something like this: table_image = { {tocolor(255,0,0,255),tocolor(0,255,0,255),tocolor(0,0,255,255)}, {tocolor(255,0,0,128),tocolor(0,255,0,128),tocolor(0,0,255,128)}, } dxDrawImage(50,50,100,100,table_image) table_image is a 3x2 image. The upper row has opaque red, green and blue pixels, while the lower has the same colors, but transparent. In dxDrawImage, a table instead of a string is passed as 5th parameter. I tried creating 1024x1024 table and it used only 16 MBs of memory. The same amount of memory can be used to store 64 128x128 images. That's efficient enough. What's more, it would allow to make very dynamic images
  20. DiSaMe

    :roll: Video

    Videos can be made in image formats and then played with dxDrawImage or dxDrawImageSection. Videos in 3D world could be made if MTA supported animated UV in custom models OR if it was possible to draw textured 3D triangles. The latter could also be used to achieve many other great things, because very dynamic models would be possible.
  21. MTA SA 1.1 has client-side file functions, so scripting client-side image conversion is possible.
  22. setVehicleDoorOpenRatio
  23. DiSaMe

    Circular Radar

    It's not hard. No matter how many DX image sections need to be drawn, MTA does this for you as long as you script that properly. It doesn't even take many rectangles to draw a circle.
  24. If you want to change the direction of particles, rotate the whole object, but I don't know if that works on all directional particles. I made models with a hex editor and RW analyzer, because no modelling was needed.
×
×
  • Create New...