WorthlessCynomys

Members
  • Content Count

    366
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by WorthlessCynomys

  1. local gOutput = true; function writeStuff() if (gOutput) then outputChatBox("1"); else outputChatBox("2"); end gOutput = not gOutput; end addCommandHandler("stuff", writeStuff);
  2. local number = 1; function writeNumber() outputChatBox(number); number = number + 1; end addCommandHandler("number", writeNumber);
  3. function adminchat ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then outputChatBox ( "#7CC576[AdminChat] Tulajdonos #FFFFFF ".. getPlayerName ( thePlayer ) ..": ".. message, player, 255, 255, 255, true ) end end end end addCommandHandler ( "a", adminchat )
  4. Hy! If you look at the Wiki page of onPlayerLogin, It shows that this gives you the current and previous account as arguments, meaning you don't have to getPlayerAccount, because you already get It from the event. Command handler works because It provides you a player instead of an account, so you have to get the account.
  5. If you set relative to true, then you have to provide values from 0.0 to 1.0 (think of them as percentages 0-100 of the parent element). So the first element you draw is relative to the parent which is the screen, so the first element is relative to the screen. The second element as the child (part) of the first is relative to the first one. That's all. That applies to all CEGUI elements, including staticImage.
  6. guiCreateStaticImage makes a CEGUI element. dxDrawImage draws an image with the lifetime of a frame. You have to call dx functions on every frame.
  7. teaEncode encrypts data. base64 is easily decryptable by anyone.
  8. Hi! teaEncode and encodeString are the same. encodeString uses teaEncode. Base64 creates a uniqe character sequence out of data, which can be decoded to retrieve the data. It just makes files into characters and vice versa. Size does not change. It has to store the same amount of data, It's just a string now. 1st answer.
  9. -- SERVER-SIDE local players = {} addEventHandler("onPlayerJoin", root, function() for i = 1, #players+1, 1 do if getElementType(players[i]) != "player" then players[i] = source outputChatBox(i) break end end end )
  10. So basically you need an ID system. Simplest way: Set up an array and whenever a player joins run a cycle to find an empty spot in the table. First player enters, cycle runs, finds that the first spot in the array (which is 1) is empty, puts the player there. Next player will find the second spot. First player leaves, you empty this spot, and you're pretty much done.
  11. Hy! You have to put the dx functions in an onClientRender event. dx draws only live for a frame, therefor you have to draw them on every frame. That's what the onClientRender event does. If you need further help, send me a PM and I'll help in hungarian.
  12. Hy. Try: #getPedWeapons On number indexed tables/arrays # returns the count of values in an array.
  13. Hy! It is probably a custom function. startRollMessage is not a default MTA function. If it is used in that form, then It's definition must be in the same resource in a file that is either shared or client sided.
  14. Hali! Legközelebb használd a code beszúrást (<> jel fent). local sound1 = playSound3D("abc.mp3",1871.4547119141, -1372.5979003906, 16.135135650635, true) setSoundVolume(sound1, 30.0) setSoundSpeed(sound1, 1.0) setSoundMaxDistance (sound1, 700) setElementDimension( sound1, 0 ) setElementInterior( sound1 , 0 ) local sound2 = playSound3D("abc.mp3",1887.8804931641, -1372.5979003906, 16.135135650635, true) setSoundVolume(sound2, 30.0) setSoundSpeed(sound2, 1.0) setSoundMaxDistance (sound2, 700) setElementDimension( sound2, 0 ) setElementInterior( sound2 , 0 ) Na de a problémádra a megoldás, hogy le tudod kérdezni a hangnak a jelenlegi időpontját, hogy hol tart. Így össze tudod hangolni a hangokat. getSoundPosition() setSoundPosition()
  15. I do not understand what you want to achieve. Please provide further explanation of your goal so I/others can understand It and become able to help you!
  16. 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
  17. @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...
  18. 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.
  19. 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.