Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. You will get problems with that, to prevent errors: local theData = tostring(getElementData(source,"temp.account") or "") But the db, I can't help you want that.
  2. Well corrupted mods, ever heard of that?
  3. @ Arnold-1 by making textures of it, but yes he isn't doing that....
  4. or just change the image to a texture and delete the file. https://wiki.multitheftauto.com/wiki/CreateTexture https://wiki.multitheftauto.com/wiki/FileDelete Which makes stealing very hard. Before they can copy it, it will be gone.
  5. No they don't have. Unless you use something else then a default database.
  6. local thePosition = fileRead(playerPos, fileGetSize (playerPos)) local x,y,z = unpack(split(thePosition, ",")) if x and y and z then setElementPosition(player,x,y,z) end
  7. IIYAMA

    image rotation

    oh yes, my bad. I mixed them up. Thank!
  8. The userdata of an element always change. You should compare them with: GUIEditor.obrazek[1] etc....
  9. function wybieraAvatar() outputChatBox("Test: Wybrałeś awatar 1, brawoo!! " ) outputChatBox("You clicked on: " .. tostring(source)) -- source is the button.(userdata) end
  10. IIYAMA

    Lower Windows

    if you don't try, you will never know....
  11. Control state: >walk< Make the player move slowly/quietly https://wiki.multitheftauto.com/wiki/Control_names Which is walking and jogging.
  12. addEventHandler("onClientRender",root, function() local allPeds = getElementsByType("ped") for i=1,#allPeds do local ped = allPeds[i] if isElementStreamedIn(ped) then end end end)
  13. function saveCoords(source) local x,y,z = getElementPosition( source ) local stringPos = string.format("%f, %f, %f \n ",x,y,z) local hFile = fileOpen("coords.txt",false) fileSetPos(hFile,fileGetSize ( hFile )) -- I added this. fileWrite(hFile,stringPos) fileClose(hFile) end You can get the filesize, which is the amount of bytes/characters in the document. When you set the read position to the size of the document. It will start writing at the bytes after that. Good luck!
  14. Next to share the texture, you can also share them as pixels. (which you also can save in a file without losing quality)
  15. Didn't you read my post before? You can't compare them because they start at a different time.
  16. The mta server is the system it self. I mentioned the mta server not the machine.
  17. The client tickcount starts when the client starts. The server tickcount starts when the server starts. They never start at the same time, so you can't compare them.
  18. No it can't be less complicated else it doesn't work. This will turn you back to a human: addCommandHandler("human", function(player) local lastObject = animalTable[player] -- request object if lastObject then -- check if there is something is inside. if isElement(lastObject) then -- check if the userdata is still an element. destroyElement(lastObject) -- destroy it. end animalTable[player]= nil -- remove it from the table. end setElementAlpha(player, 255) end)
  19. By using a variable. local handlerOfthisFunction addEventHandler("name", root, function) handlerOfthisFunction = true
  20. Use 1 table. This structure: local animalTable = {[player]=object} local animalTable = {} local animalObjectFinder = {["cow"]=16442,["fish"]=1606} function changeInAnimal (player,cmd) local lastObject = animalTable[player] if lastObject then if isElement(lastObject) then destroyElement(lastObject) end animalTable[player]= nil end local objectID = animalObjectFinder[cmd] if objectID then local x, y, z = getElementPosition(player) local rx, ry, rz = getElementRotation(player) local newObject = createObject( objectID, x, y, z, rx, ry, rz ) if newObject then animalTable[player]= newObject setElementAlpha(player, 0) attachElements(newObject, player) outputChatBox("You are now a" .. cmd .. "!", player, 0, 255, 0) end end end addCommandHandler("cow", changeInAnimal) addCommandHandler("fish", changeInAnimal) addEventHandler("onPlayerQuit",root, function() local lastObject = animalTable[source] if lastObject then if isElement(lastObject) then destroyElement(lastObject) end animalTable[source]= nil end end) If you want to add more animals.(animal names much be match with the animalObjectFinder(table). addCommandHandler("", changeInAnimal) -- the command local animalObjectFinder = {["cow"]=16442,["fish"]=1606,[""]=1606 } -- ,[""]=1606 -- animal name and object id.
  21. @Denny there is also an example at the same page which also can give the matrix at serverside. (Example 3) https://wiki.multitheftauto.com/wiki/GetElementMatrix
  22. IIYAMA

    image rotation

    Or just use:(when you don't understand shaders) https://wiki.multitheftauto.com/wiki/Ge ... enPosition https://wiki.multitheftauto.com/wiki/DxDrawLine3D Good luck
  23. https://wiki.multitheftauto.com/wiki/GetElementMatrix function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end -- Get the position of a point 2 units in front of the element: x,y,z = getPositionFromElementOffset(element,0,2,0)
  24. Solved.
  25. Misschien kan je wat laten zien, ook al ben in niet geïnteresseerd in kopen(ben zelf al een scripter).
×
×
  • Create New...