Jump to content

IIYAMA

Moderators
  • Posts

    6,087
  • Joined

  • Last visited

  • Days Won

    215

Everything posted by IIYAMA

  1. IIYAMA

    MTA:SA 1.4

    btw what is the use of that? (I only know that it is handy for exporting) but nothing more or less.
  2. You have the position of the cursor and you have the positions of the rectange, as far I know it isn't that hard to compare them.I haven't said that I finished the code, I just help you creating the basic. It is your job to finish it. Note* it doesn't store a cursor position because it is a local.
  3. local rectangePos = {{200, 200,400,400}} addEventHandler("onClientRender",root, function() local myTable = rectangePos[1] local XposStart,YposStart,XposEnd,YposEnd = myTable[1],myTable[2],myTable[3],myTable[4] local x,y,,yD,zD = getCursorPosition ( ) end) + https://wiki.multitheftauto.com/wiki/OnClientClick
  4. Then you are at the wrong section. This is for scripting.
  5. shotguns do have a spray, every spark counts as a bullet.
  6. remove: local marker = createMarker() -- line 9 Also: setElementInterior(myMarker, 1494.3350, 1305.6510, 1093.2890) setElementInterior ( element theElement, int interior [, float x, float y, float z] ) -- read syntax clearly local myMarker = createMarker(-2620.7634277344, 1376.0603027344, 7.1228446960449, 'cylinder', 2.0, 255, 0, 0, 150) -- create myMarker function MarkerHit( hitElement, matchingDimension ) if getElementType( hitElement ) == "player" then setElementInterior( hitElement, 3, 1494.3350, 1305.6510, 1093.2890) end end setElementInterior(myMarker,3, 1494.3350, 1305.6510, 1093.2890)-- I have set it to interior 3, if that isn't your interior you have to change the value setElementDimension(myMarker, 3) addEventHandler( "onMarkerHit", myMarker, MarkerHit )
  7. or onClientClick https://wiki.multitheftauto.com/wiki/OnClientClick You can use that for clicking at directx render images or specific locations. compare the image start size and the image end size with the absoluteX and absoluteY value. local Xstart, Ystart = 100,100 local Xend,Yend = Xstart+100, Ystart+100 addEventHandler ("onClienClick",root, function (button, state,absoluteX, absoluteY ) if (absoluteX > Xstart and absoluteX < Xend) and (absoluteY > Ystart and absoluteY < Yend) then outputChatBox("clicked on the image") end end)
  8. IIYAMA

    3D hud

    local rx,ry,rz = getElementRotation (element) local pX,pY,pZ = getElementPosition (element) rz = (rz * 3.141592653 * 2)/360; local newX,newY,newZ = pX + math.cos(rz), pY + math.sin(rz), pZ
  9. Why don't you take a look in the .map file and check if the colour codes are correct saved.
  10. IIYAMA

    3D hud

    most of the dx functions require the event's "onClientRender" or "onClientPreRender". 3D hud will be hard. But I don't think it will be impossible. 2: to the left side of the player or left side of the screen? There are some attachment functions, for attach things to other things. https://wiki.multitheftauto.com/wiki/AttachElements https://wiki.multitheftauto.com/wiki/Se ... hedOffsets
  11. IIYAMA

    String

    if it is because it is to big you can also create your own password protection. addEventHandler ( "onPlayerJoin", root, function ( ) -- autoLogin local cSerial = getPlayerSerial ( source ) if cSerial then -- no bugs? local pass = cSerial .. "X" -- fill this in X<------------------------------------------ local account = getAccount ( tostring ( cSerial ), pass ) if ( account ) then logIn ( source, account, pass ) outputChatBox ( "Logged in successfully", source, 255, 255, 255 ) else local account = addAccount ( tostring ( cSerial ), pass ) if ( account ) then logIn ( source, account, pass ) outputChatBox ( "Registered and logged in successfully", source, 255, 255, 255 ) else outputChatBox ( "Failed to register!", source ) end end end end)
  12. IIYAMA

    String

    aha lol O_o but then there should be an error.
  13. IIYAMA

    String

    if that works, WHAT THE ... DOESN'T WORK!
  14. https://wiki.multitheftauto.com/wiki/FadeCamera https://wiki.multitheftauto.com/wiki/SetCameraMatrix or https://wiki.multitheftauto.com/wiki/SetCameraTarget
  15. function myFunction () end ------------------ ------------------ if a then end ------------------ ------------------ if a then elseif b then end ------------------ ------------------ if a then elseif b then else end ------------------ ------------------ for i=1,2 do end ------------------ ------------------ if a then if b then end end ------------------ ------------------ function myFunction () if a then if b then end end end function myFunction () if a then if b then outputChatBox("b does exist") elseif c then outputChatBox("c does exist") else outputChatBox("b and c does not exist") end else outputChatBox("a does not exist") end end
  16. yes, I wasn't able to find the correct words for it. I only use it for tables or numbers from point to point to reading files. well let we say I using it at every single corner in my code.
  17. ah loop is something that goes through a table and does something with the data. So you can read information very easy and it makes your code a lot smaller. You can write everything there, but you have to put in the the table first. table.insert (myTable,value) --or myTable[#myTable+1] = value Some functions are creating already a table. You can use loops to read the whole table.
  18. This script removes a weapon from a slot, by triggering to server side. client addCommandHander("remove", function () local currentSlot = getPedWeaponSlot (localPlayer) triggerServerEvent("tkWP",localPlayer,currentSlot) end) server addEvent("tkWP",true) addEventHandler ("tkWP",root, function(slot) if isElement(source) then-- check if the player is still in the game takeWeapon ( source, getPedWeapon ( source, slot)) end end)
  19. 1: https://wiki.multitheftauto.com/wiki/Element_tree 2: You can use a loop for differed things. here for index a table: local myTable = {"A","B","C","D"} for i,data in pairs (myTable) do setElementData ( localPlayer, data,1000) end -- or for i=1,#myTable do local data = myTable[i] setElementData ( localPlayer, data,1000) end 3: use relative when you want to use it easy. 4: you don't need to use a "command" argument. It is just how it is written down and the system works. 5:You can export information. 6: Check if something is nil or false if not A then -- check if [u]nil[/u] or [u]false[/u] if A == nil then -- check if [u]nil[/u] if not (A ~= nil) then -- check if [u]nil[/u] -- not recommended if A == false then -- check if [u]false[/u] if not (A ~= false) then -- check if [u]false[/u] -- not recommended 7: ~= = not/unequal 8: Client = your pc Server = the server you are playing on. triggerClientEvent, server sends information to player/players triggerServerEvent, player sends information to server 9: local means that it will stay within the if/function/script/loops T/M end/end of the script sample: if 1 then -- local A = "hey" -- local value A outputChatBox(A) -- shows in the chat "hey" end -- A is gone outputChatBox(A) -- shows "nil" in the chat, because A will only stay between the lines. You use locals to improve the performance of the code, because the data is gone after the execution. If it is outside the functions the data can be used only in the that .lua file.
  20. function makejump(plr) executeCommandHandler("mdestroy", plr) executeCommandHandler("mcreate", plr,1655) executeCommandHandler("rz", plr,-130) end addCommandHandler("mjump", makejump)
  21. It depends what the script request. If the script needs to kick a player or remove a file. Yes then it needs admin rights. If the script gives an error like that, it is missing his rights. resource.NAME
  22. updatd What don't you know?
×
×
  • Create New...