Jump to content

Mr.Loki

Members
  • Posts

    667
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Mr.Loki

  1. Invalid function parameters check the wiki for them.
  2. Here u go: https://wiki.multitheftauto.com/wiki/OnElementClicked
  3. I made a little tutorial on this in a thread.
  4. addEvent( "eszakirablas", true ) addEventHandler( "eszakirablas", root, function (thePlayer) if ( idozito [ thePlayer ] ~= nil ) then outputChatBox ( "#01AC41[SuperFun] #FFffFFA következő széfrablásig várnod kell #01AC41".. math.floor ( getTimerDetails ( idozito [ thePlayer ] ) / 60000+1 ) .." percet.", thePlayer, 255, 0, 0, true ); else setElementFrozen(thePlayer, true) setPedAnimation(thePlayer , "rob_bank", "cat_safe_rob", 10000, true, true, true, false) setTimer(setElementFrozen,10000,1,thePlayer,false) setTimer(setPedAnimation,10000,1,thePlayer) randomM = math.random(500000,1500000) setTimer(function() givePlayerMoney(thePlayer,randomM) end,10000,1) setTimer(outputChatBox, 10000,1,"#01AC41[SuperFun] #FFffFFÖsszesen raboltál #01AC41"..randomM.." #ffffffforintot.",thePlayer,255,255,255,true) setTimer(outputChatBox, 900000, 1,"#01AC41[SuperFun - #8C8C8CÉszaki] #FFffFFAz #01AC41északin #FFffFFújra kirabolhatod a széfet! #01AC41(/eszaki)",thePlayer,255,255,255,true) setTimer(Boltrablas,900000,1) idozito [ thePlayer ] = setTimer ( function ( thePlayer ) idozito [ thePlayer ] = nil; end, 900000, 1, thePlayer); end end )
  5. Aren't they just coronas and a light?
  6. onPlayerLogin triggerClientEvent remove the video Without any information we can't help you.
  7. Mr.Loki

    Camera

    You can't view all screens at once but there's a CCTV resource on the community that allows you to setup cameras and look through them.
  8. This is what i think you may need, try using them to create something then we'll go from there if you have any problems: Client: createObject onClientPreRender processLineOfSight setElementPosition onClientClick triggerServerEvent Server: createObject attachElements
  9. Try this bindKey ( "aim_weapon", "down", function ( ) -- set the alpha of the gun to 0 when the localPlayer is aiming. if getPedWeapon(localPlayer) ~= 34 then return end -- check if he has a sniper. local wep = getElementData(localPlayer,"currentweapon_1") setElementAlpha( wep, 0 ) iprint("1") end ) bindKey ( "aim_weapon", "up", function ( ) if getPedWeapon(localPlayer) ~= 34 then return end local wep = getElementData(localPlayer,"currentweapon_1") setElementAlpha( wep, 255 ) iprint("2") end )
  10. You are getting the error because getPlayerGang is not defined in your script. You must define it in your script to use it. Try copying the getPlayerGang function to this code.
  11. What error do you get in the debug when using the command?
  12. local vehicles = { } local vehicle for i=1,10 do -- ( considering I have no vehicle spawned on the server before executing this code ) local vehicle = createVehicle( 522, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, "mta" ) -- dont mind the parameters, it's just mockup data table.insert(vehicles,vehicle) end iprint(vehicles[1]) -- outputs the first vehicle element in the table to the debug
  13. If the texture is on an element then just apply the shader to that element using the 3rd argument in engineApplyShaderToWorldTexture. If the texture does not belong to the element then you can't.
  14. Are they dragging a 2D image or a 3D object onto the vehicle?
  15. You are going to want to use a Matrix for these kind of stuffs it really comes in handy and also OOP. Here's a simple projectile constructor i made which requires you to enable OOP: local lp = localPlayer local speed = 1 local lifetime = 1000 local id = 2686 function createProj( veh ) local self = { pos = veh.matrix:transformPosition(0, 4.3, -0.15), rot = veh.rotation, vel = veh.velocity, } self.proj = Object( id, self.pos, self.rot ) self.proj:setCollidableWith( veh, false ) Timer(function() removeEventHandler( "onClientPreRender", root, self.move ) self.proj:destroy() self = nil end,lifetime,1) function self.move( dt ) self.proj:setVelocity( ((self.proj.matrix.forward*speed)+self.vel)*dt/17 ) end addEventHandler( "onClientPreRender", root, self.move ) end addEventHandler( "onClientKey", root, function( k,p ) if k == "mouse1" and p then if not lp.vehicle then return end createProj(lp.vehicle) end end )
  16. Mr.Loki

    [HELP]

    Show me the meta for the script.
  17. Mr.Loki

    [HELP]

    Have you try setting the speed to a higher value?
  18. Mr.Loki

    [HELP]

    I just tested it and it works... Are you using custom rockets or something that changes the rockets from the hydra? This is client side... onClientProjectileCreation
  19. Mr.Loki

    [HELP]

    That's really unnecessary for what he's trying to accomplish. local speed = 5 -- Define a a variable which determins the speed we will use later. function boostRockets ( creator ) if not creator then return end -- If there's no creator for the projectile then stop. local projType = getProjectileType( source ) -- Get the projectile type. local mdl = getElementModel(creator) -- Get the model of the creator. if projType == 19 and mdl == 520 then -- If the projectile is a rocket and the creator is a hydra. local vx,vy,vz = getElementVelocity( source ) -- Save the rocket's velocity. setElementVelocity( source, vx*speed,vy*speed,vz*speed ) -- Set the rocket's velocity to the velocity we saved and multiply it by the speed variable. end end addEventHandler( "onClientProjectileCreation", root, boostRockets ) -- when a projectile gets created call boostRockets.
  20. Mr.Loki

    [HELP]

    What you will need: onClientProjectileCreation - call a function to modify the projectile's speed getProjectileType - Check if the projectile type is 19(rocket) getElementModel - Check if the creator of the projectile is a hydra(model: 520) getElementVelocity - get the velocity of the projectile setElementVelocity - set the velocity of the rocket to the old velocity we just got and multiply all 3 values by a number for example 5
  21. If you slow the game speed the speed of the fade is also slowed and you had 10 seconds ._. so the fade time would have been 10*10 so set the fade time to 0.1
  22. Can you past the whole code please?
  23. You are using the Server sided version of the function the client side does not need the player argument. function playerWasted (thePlayer) deathSound = playSound("deathFX/wasted.mp3",false) setSoundVolume(deathSound, 50) setGameSpeed (0.1) fadeCamera ( false, 2, 127.5, 127.5, 127.5 ) setTimer ( function() fadeCamera ( true, 1 ) end, 5000, 1 ) end
  24. This is how an event handler works. addEventHandler("EVENT_NAME", ELEMENT_YOU_WANT_TO_ATTACH_THIS_TO, FUNCTION) Dince arg 2 requires an element to attach to we just use the button as the element to attach: addEventHandler ( "onClientGUIClick", button1, function ( ) setElementModel ( 280 ) guiSetVisible( painel, false ) showCursor( false ) end )
×
×
  • Create New...