Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. np.
  2. maybe you should check your progress. This makes no sense. It is the exact same value tick. local duration = startTick+tick-startTick This will give you the future time, so you can compare it with the time now. local futureTime = startTick+tick For progress backwards: local progress = 1-(startTick/futureTime) Next to that, you have to reset the:(because you will be re-comparing the time now with the future time) startTick = getTickCount()
  3. /construct
  4. He has to encode it to UTF-8 with notepad ++......... (8-bit Unicode Transformation Format) The server can't read the code.
  5. What kind of element does it returns? (some elements can't be destroyed, like serverside colshapes destroying at clientside)
  6. IIYAMA

    Colshape

    you can try to use some functions/lines of maplimits. https://community.multitheftauto.com/in ... ails&id=12 It allows you to detect if an element is within a specific area.
  7. For finding the script/resource. It is just a question of start and stop the resources. When you found the resource. Use: control + F (in notepad etc.) To search for: addCommandHandler or search for the command you are using.
  8. what is Pitch and Yaw in lua? Can you explain a bit more, because I sorry but I have no idea how this is working.
  9. If you can get the Z rotation, you can also get the X and Y rotation. It's just math with sins, cons and tans. sins, cos and tan isn't JUST this math. I know how they work, but I don't know how to use them with this. Since my brain can't merge the ordinary math with 3D math...... Pls give me a sample, if it is just sin cos and tan.
  10. @ CastielRecords I didn't make this topic for things I already know, I asked about getting the X and Y rotation based on finding rotation. Next to that I have lots lua experience with lua, but I don't have with 3D math. Thanks for trying to help me, but I need somebody with high math skills. Is there anybody who can help me with this?
  11. It is.
  12. and how do I get the X and Y rotation? Because now I also only have the Z rotation.
  13. I am looking for findRotation math, but one that is also returning X and Y rotation. https://wiki.multitheftauto.com/wiki/FindRotation function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end
  14. setElementFrozen
  15. is it an image? Save with photoshop as web.
  16. You can try something like this. local myTable = {} for clothesType=0, 17 do local newTable = {} for clothesIndex=0,1000 do -- in case if there are 1001… local clothesTexture,model = getClothesByTypeIndex (clothesType, clothesIndex ) if clothesTexture and model then newTable[clothesIndex]={["clothesTexture"]=clothesTexture,["model"]=model} else break end end myTable[clothesType]= newTable end local clothesTexture = myTable[0][0]["clothesTexture"] local model = myTable[0][0]["model"] It is better to buffer the table first, but I am to lazy to do that.
  17. 1 You only have to defined what you need. But make sure it is there..... http://img43.imageshack.us/img43/2921/e9kp.png and remember, the way you fix/build your script, is more important than having it finished.
  18. As I said in the pm I send you. Everything that is required, must be defined before it can work. Line 10 t/m end function: Not defined. Line 19 t/m end function: Not defined. Line 80 t/m end function: Not defined. ETC. Sample how to define things: First read wiki mta. So for the first function: https://wiki.multitheftauto.com/wiki/AddCommandHandler Then you see: Handler function parameters Choose between client and server parameters.(what kind of script it is) There you find for serverside: (parameters) player playerSource, string commandName, [string arg1, string arg2, ...] Not required to fill in. [string arg1, string arg2, ...] Then we can fill in the script. The parameters are: player playerSource, string commandName, [string arg1, string arg2, ...] function authorIs () -- not filled in function authorIs (thePlayer,commandName) -- filled in. You can name them as you want as long, as you know what they mean. and so........... function authorIs (thePlayer,commandName) -- we just filled in the arguments outputChatBox("Hello,", thePlayer) outputChatBox("This script is made by Viruzgamiing!", thePlayer) outputChatBox("Thanks for using my script...", thePlayer) outputChatBox("Please don't steal any credits!", thePlayer) outputChatBox(" ", thePlayer) outputChatBox("Thanks You!", thePlayer) end addCommandHandler ("info", authorIs )
  19. IIYAMA

    Smooth moving

    Then you better can use TIME instead of counting pixels. https://wiki.multitheftauto.com/wiki/GetTickCount local startTime = 0 local endTime = 0 function renderFunction () local factor = startTime/endTime if factor < 1 then dxDrawText ( factor, 200, 2) else outputChatBox("We stop rendering the factor!") removeEventHandler("onClientRender", root, renderFunction) end end outputChatBox("We start rendering the factor over 5 seconds!!!") setTimer (function () local timeNow = getTickCount () startTime = timeNow endTime = timeNow+10000 -- + 10 seconds addEventHandler("onClientRender", root, renderFunction) end,5000,1) A factor can be used for increasing or de-increase other values. 0.8 = 80% 0.2 = 20% local pixels = 0.2 * 100 outputChatBox(pixels) -- 20 pixels.... Inverse the factor. So you can de-increase the value. local 0.8 = 1 - 0.2
  20. function jobGui -- to function jobGui () and the same with all other custom functions.
  21. Indeed Example; addEventHandler("onText", function text outputChatBox("Hello World!", source) end ) addEvent("onText", true) If i'm right, bcuz i'm a noob scripter too addEvent("onText", true) addEventHandler("onText",root, function () outputChatBox("Hello World!") end) -- or -- function text () outputChatBox("Hello World!") end addEvent("onText", true) addEventHandler("onText",root,text) triggerEvent ("onText",root) @ Misschien kan je even beter naar het voorbeeld kijken. Dit moet je nou wel ongeveer onder de knie hebben.....
  22. true that. addCommandHandler("dimension" function (CMD,arguments) local elements = getElementsByType("object") local dimension = tonumber(arguments) or 0 for i=1,#elements do setElementDimension (elements[i],dimension) end end)
  23. server https://wiki.multitheftauto.com/wiki/OnPlayerLogin https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup https://wiki.multitheftauto.com/wiki/TriggerClientEvent client https://wiki.multitheftauto.com/wiki/PlaySound
  24. Not tested function bountyInfo (player) outputChatBox("write /setbounty to set a bounty", player, 225, 0, 0) local playerSerial = getPlayerSerial(player) if not playerSerial then return false end local timeNow = getTickCount() local playerTickCountInfo = antispam[playerSerial] if not playerTickCountInfo or timeNow > playerTickCountInfo then antispam[playerSerial] = timeNow+300000 return true else outputChatBox( "You can't use /kill multiple Times", player, 225, 0, 0) outputChatBox( "Only once every 5 minutes!", player, 225, 0, 0) return false end end addEventHandler("onPlayerQuit",root, -- very important to clean up the table.......... function () local playerSerial = getPlayerSerial(player) if antispam[playerSerial] then antispam[playerSerial] = nil end end)
  25. You can try to find it with CrystalMV his script.
×
×
  • Create New...