Jump to content

WorthlessCynomys

Members
  • Posts

    369
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by WorthlessCynomys

  1. setElementData() getElementData() You should set the element data of the vehicle and chech that. Like: setElementData(veh, "trunkTires" 1); -- later local tires = getElementData(veh, "trunkTires"); if tires > 0 then setElementData(veh, "trunkTires", tires-1); -- Your get the tire from trunk code else -- No tire in car, handle that too end
  2. @ChrisT Ez nem egy script kéregető részleg. Be van kapcsolva a debugscript 3 és úgy nincs hiba? Ha ide rakod code mezőbe (<> ikon) a scripted, akkor esetleg tudunk segíteni. Nem fogunk neked adni egy teljesen másik új scriptet, de segítünk megírni ha meg akarod tanulni a scriptelést...
  3. You were helpful AF, bro Keep up the good work! @Hugos Use the getElementSpeed function from WIKI to get the current speed. It works quite well. For the arrow of the speedometer: You know that the speedo can show 260 max. You know the degree for the 0 on the speedo and the degree for 260. Now you can divide the current speed of the vehicle by 260 and then you get the relative number to multiply the degrees with. So like: local arrowRotation = 0; -- This will be the actual rotation of the arrow. local vehicleSpeed = 180; -- This will serve as the current speed of your vehicle. You get this with getElementSpeed local speedoMaxSpeed = 260; local degreesFromZeroToMax = 180; -- This is the degrees between 0 and 260 for example arrowRotation = (vehicleSpeed/speedoMaxSpeed)*degreesFromZeroToMax; I hope it works. It's been a long time since I made something like this. About dx. Yup! You HAVE to use dx for this.
  4. Erre vannak jobb, dx-es megoldások. De ha ragaszkodsz ehhez, akkor a kirajzolásnál vágd meg a stringet a megfelelő karakterszámra.
  5. Ezzel mit szeretnél elérni? Mit akarsz megvalósítani?
  6. There's two basic solutions for this problem. You either check the position of the player, GTA map is 6000x6000 which means that it's from -3000 to 3000 on both axis. OR You create a map sized colShape and add an event handler to check if the player exits it. That's the worse solution in my opinion.
  7. Hali! Az a helyzet, hogy ez nem egy ilyen írd le egy szövegben dolog. Itt a fórumon rengeteg eligazító téma van. Ha tudsz angolul, akkor szintén az angol fórumon nagyon sokat meg lehet tudni, illetve a WIKI nagyon hasznos. Odáig kell eljutnod, hogy létre tudsz hozni és elindítani egy scriptet. Utána már csak végtelen bohóckodás.
  8. local screenW,screenH = guiGetScreenSize() local resW,resH = 1366,768 local x,y = (screenW/resW), (screenH/resH) local font = dxCreateFont("fonts/font.ttf", 10) local MaxFuel = 100 function getVehicleFuel(v) local fuel = getElementData(v, "fuel") if (fuel) then return fuel end return 0 end addCommandHandler("fueladm",fuel) Hello! You can insert code blocks with the <> sign. Use it next time. Your problem is that this code does not set any value. In order to set the "amount of fuel" you have to use setElementData to set the value for fuel. Also functions can get parameters/arguments from command calls. You can catch those arguments in the paramter list after the function's name. -- Catch parameters of command call -- On server-side function funcName(player, command, value1, value2) end addCommandHandler("testCall", funcName) -- When you type /testCall it will call the funcName function, providing the calling player, the command that has been used for the call, and additional values typed in alongside the command. In command calls, additional values are seperated with spaces. For example: /testCall value1 value2 -- On client-side function funcName(command, value1, value2) end addCommandHandler("testCall", funcName) -- The same playbook here, except that client-side calls do not provide the calling player, because it is obvious that the calling player is the client itself. The localPlayer. Now your function should look somehow like this: -- Client-side function setVehFuel(cmd, fuel) local veh = getPedOccupiedVehicle(localPlayer); -- Gets the currently occupied vehicle of the player, returns false if the player is not in a vehicle. if (veh) then -- Translates to if (veh ~= false/nil) then setElementData(veh, "fuel", tonumber(fuel)); -- Sets the fuel element data of the vehicle to the value that the caller provided converted into a number from string. end end addCommandHandler("setFuel", setVehFuel);
  9. Ha a szerveren szerkeszted az AccountData-t akkor azt vissza is kell tudnod olvasni azonnal. Ha kintről, másik programmal szerkeszted akkor valószínűleg nem lehet VAGY simán csak ki kell olvasnod. Nem tudom, hogy Cache-eli-e magának az MTA az InternalDB-t.
  10. Hali! Ha jól látom a Wikin függvény nincs rá. Miért lenne erre szükséged? Talán megkerülhető.
  11. A Thauma bold nincs dx-es alap betűtípusok közt ha jól emlékszem. Azt be kell importálnod.
  12. Ugyan azzal a betűtípussal és színnel. Valahol a gépen ott vannak ezek az adatok, csak már nem emlékszem hol.
  13. You use the triggerServerEvent as above and catch the call on server-side, then you do the same as on client-side, only that you're on server-side now.
  14. The creation of the vehicle, the dimension and interior change and the warp has to happen on server-side!
  15. Then you should set the interior and dimension for the player or the vehicle before you warp the player into the new vehicle. setElementInterior() setElementDimension() -- You can get the interior/dimension of an element with: getElementInterior() getElementDimension()
  16. Hy! createVehicle() setElementPosition() warpPedIntoVehicle()
  17. https://wiki.multitheftauto.com/wiki/Standard_GUI_Font_Names
  18. Próbáld meg úgy, hogy a setCameraTarget-et nem a timerben csinálod.
  19. Próbáltad már nagyobb késleltetéssel? Vagy a jármű lefagyasztása nélkül?
  20. Hali! elementData-ban bármilyen adatot át tudsz küldeni. Nem kell stringelni. Adat tároláskor pedig csak szöveget vagy számot, egyéb ilyen dolgokat tárolunk. Úgy kell tárolnod az adatait, hogy legközelebb vissza állíthasd az állapotát.
  21. Csáó! Először is köszönöm, hogy megemlítettél! Király vagy! Továbbá nem tudom, hogy sikerült-e megoldanod a dolgot, de ha még nem és tudok segíteni, akkor szólj nyugodtan!
  22. Hy! I know this doesn't answer your question, but you could measure the time and calculate toptime on the same side. That would eliminate the really minimal delay time. Then after the client for example calculated the time, you could send it over. Then the delay doesn't matter, because you have it calculated already.
×
×
  • Create New...