Jump to content

IIYAMA

Moderators
  • Posts

    6,085
  • Joined

  • Last visited

  • Days Won

    215

Everything posted by IIYAMA

  1. 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
  2. is it an image? Save with photoshop as web.
  3. 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.
  4. 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.
  5. 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 )
  6. 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
  7. function jobGui -- to function jobGui () and the same with all other custom functions.
  8. 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.....
  9. 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)
  10. 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
  11. 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)
  12. You can try to find it with CrystalMV his script.
  13. IIYAMA

    Anti-Cheat Corner

    Mods>Deathmatch>Resources and some servers have a folder called AntiCheat just wondering why they have that when MTA already has it I use anti cheat to kill laggers when they got timed out. Mta doesn't have much things against player lagg to be honest. (except for freeze players) The only thing I can think about is, to prevent corrupted admins being abusing their powers.
  14. If you don't know how an event or function works. There is this page to help you with finding out what the source is, etc. addEventHandler("onElementModelChange", root, function (oldModel,newModel) if newModel == 425 and getElementType(source) == "vehicle" then --425 is the model of the hunter local rotX, rotY, rotZ = getElementRotation(source) -- source is the variable of the vehicle setElementRotation(source,rotX,rotY+10,0) -- always define all required fields. end end)
  15. You can also use: https://wiki.multitheftauto.com/wiki/SetElementRotation For that sample with the bugged car.
  16. Try this(fill in the location) local x,y,z = 0,0,0 -- fill in addEventHandler("onElementModelChange", root, function (oldModel,newModel) if newModel == 425 and getElementType(source) == "vehicle" then --425 = hunter setElementPosition(source,x,y,z) end end)
  17. getElementPosition getElementsByType("player",root,true) processLineOfSight getPedBonePosition setControlState addEventHandler("onClientRender",root,functionVariable) getElementHealth getElementRotation setElementRotation getScreenFromWorldPosition getWorldFromScreenPosition Note you can't use: setPedAimTarget You can try these things, But the aim, I simply don't know.
  18. and restart didn't had any result?
  19. Hoi, Als je rechten op een verkeerde manier beperkt voor moderator, dan beperk je ze ook voor hogere ranken. Probeer te achter halen wat je bij moderator op false heb gezet. Knip dit uit moderator en plak dit in supermoderator, vervolgens zet je wat op "false" staat terug op "true". Het op false zetten van rechten heeft geen zin, omdat als ze niet ingevuld staan toch geen rechten hebben (behalve als ze in de rank daar onder wel rechten hebben). Ranken maken gebruik van elkaars instellingen. user > moderator (moderator gebruikt user) moderator > supermoderator (supermoderator gebruikt moderator) supermoderator > admin (......) Groet, IIYAMA
  20. jesus..... I thought it was just a xp bar. Not tested. Probably a typo/bug. But you can try it and give a call when it doesn't work. Client local x,y = guiGetScreenSize() local playerXP = 0 local maxPlayerXP = 100000 local colour = tocolor(187, 0, 0, 150) local colourBlack = tocolor(0, 0, 0,255) local startX,startY = x*0.80,y*0.30 -- 0.80 = 80% Left , 0.30 = 30% Down local endX,endY = x*0.90,y*0.33 -- 0.90 = 90% Left , 0.33 = 33% Down local dxW,dxH = endX-startX,endY-startY -- different between the start and the end addEventHandler("onClientRender",root, function() local factor = playerXP/maxPlayerXP -- create a factor. Sample 80 / 100 = 0.8 (80%) dxDrawRectangle(startX,startY, dxW,dxH, colourBlack) -- colour the frame with the colour black. dxDrawRectangle(startX,startY, dxW*factor,dxH, colour) -- overflow the frame with another colour. end) addEvent("newXP",true) addEventHandler("newXP",root, function() playerXP = playerXP+100 if playerXP > maxPlayerXP then -- to prevent a bugged bar, you never know….. maxPlayerXP = playerXP *100 end end) Server --- server --- addEventHandler("onPlayerWasted",root, function (ammo,attacker) if attacker and getElementType(attacker) == "player" then triggerClientEvent(attacker,"newXP",attacker) end end) Good luck.
  21. https://wiki.multitheftauto.com/wiki/DxDrawRectangle yes. But that one on the picture isn't a dx bar.
  22. IIYAMA

    Anti-Cheat Corner

    Cause mta files can be edited by smart people.
  23. local startX,startY,startZ = 0,0,0 local endX,endY,endZ = 0,0,0 local cameraStartHighed = 50 local progress = 0 local handled = false local renderFunction renderFunction = function() setCameraMatrix(startX,startY,startZ-(cameraStartHighed*progress), endX,endY,endZ) progress = progress+0.02 if progress >= 1 then setCameraTarget(localPlayer) progress = 0 removeEventHandler("onClientRender",root,renderFunction) handled = false end end local setCameraOnPlayerSpawn = function () local pX,pY,pZ = getElementPosition(localPlayer) startX,startY,startZ, endX,endY,endZ= pX,pY,pZ+cameraStartHighed, pX,pY,pZ setCameraMatrix(startX,startY,startZ, endX,endY,endZ) if not handled then addEventHandler("onClientRender",root,renderFunction) handled = true end progress = 0 end addEventHandler("onClientPlayerSpawn", localPlayer, setCameraOnPlayerSpawn) @Desaster thanks for testing. This will prevent it for triggering for everybody.
×
×
  • Create New...