Jump to content

motax

Members
  • Posts

    28
  • Joined

  • Last visited

Everything posted by motax

  1. motax

    Faster running

    Damn' i totally forgot that is possible.. Thanks!
  2. motax

    Faster running

    Is there any way to speed up a player's running speed? Expect setElementVelocity because that's don't works, only when the player jumps, or is there a way to get setElementVelocity working without jumping?
  3. if AdminGate then destroyElement ( AdminGate ) end local AdminGate = createObject ( 971, -504.7998046875, 2592.599609375, 56.200000762939, 0, 0, 90 ) local state = 0 --this is the state, if 0 gate closed if 1 it's open function move() if state == 0 then --it's closed so open it moveObject ( AdminGate, 2500, -504.79998779297, 2592.6000976563, 62.099998474121) --Time means how fast the object'ill be moved. state = state + 1 elseif state == 1 then --it's open so close it moveObject ( AdminGate, 2500, -504.7998046875, 2592.599609375, 56.200000762939) state = state - 1 end end addCommandHandler("admin75", move )--this one creates a command "/gate" wich'll start the move function
  4. The problem is in here: moveObject ( AdminGate, 2500, -504.7998046875, 2592.599609375, 56.200000762939,) You dont need that comma in the end of the line
  5. Lua is case sensitive so maybe it's because the big M, but maybe because there is a "." and not a "_" int the move_gate.lua try using something easier, simpler name like gate.lua and also dont forget to change the name in the meta
  6. motax

    help

    peds = createPed(7, -1560.013671875, 660.078125, 7.0390625) marke = createMarker(-1559.30859375, 654.59375, 7.0390625 -1, "cylinder", 2, 255, 0, 0, 100) function shotplayer ( hitPlayer, matchingDimension ) if hitPlayer == localPlayer then localPlayer = getLocalPlayer() x, y, z = getElementPosition(localPlayer) setPedAimTarget(peds, x, y, z) setPedLookAt(peds, x, y, z,-1) end end addEventHandler("onClientMarkerHit", marke, shotplayer) Maybe this one'll be good. Because: bool setPedLookAt ( ped thePed, float x, float y, float z [, int time = 3000 [, int blend = 1000 ], element target = nil ] ) "time: the time, in milliseconds, during which the ped will look at the target. Once this time has elapsed, he will look ahead again like before the function was applied. A time of 0 will immediately stop any lookat.A negative time will make the ped look at the target indefinitely."
  7. motax

    help

    peds = createPed(7, -1560.013671875, 660.078125, 7.0390625) marke = createMarker(-1559.30859375, 654.59375, 7.0390625 -1, "cylinder", 2, 255, 0, 0, 100) function shotplayer ( hitPlayer, matchingDimension ) if hitPlayer == localPlayer then localPlayer = getLocalPlayer() x, y, z = getElementPosition(localPlayer) setPedAimTarget(peds, x, y, z) setPedLookAt(peds, x, y, z) count= setTimer(shotplayer ,50,0) end end addEventHandler("onClientMarkerHit", marke, shotplayer) Maybe a timer like this could help
  8. You should use "and" instead of "or"
  9. STAFF EDIT/NOTE: Easiest is just downloading this ready to go Moving gates script: https://community.multitheftauto.com/?p=resources&s=details&id=14987 Of course you need meta you always need a meta file for a new resource. The meta.xml should look something like this: "Your_Name" name="resource_name" version="1.0" type="script"/> Then the "move_gate.lua" --create the gate local gate = createObject ( ObjID, Pos_X, Pos_Y, Pos_Z, Rot_X, Rot_Y, Rot_Z ) local state = 0 --this is the state, if 0 gate closed if 1 it's open function move() if state == 0 then --it's closed so open it moveObject ( gate, Time, New_X, New_Y, New_Z) --Time means how fast the object'ill be moved. state = state + 1 elseif state == 1 then --it's open so close it moveObject ( gate, Time,Old_X, Old_Y, Old_Z) state = state - 1 end end addCommandHandler("gate", move )--this one creates a command "/gate" wich'll start the move function This script is written by xScatta and also can be found in the forum here: https://forum.multitheftauto.com/viewtopic.php?f=91&t=63339&p=602320#p602320 and you should also start reading the wiki page because you can find all these stuff there.
  10. motax

    Skin problem

    addEventHandler( "onPlayerWasted", getRootElement( ), function() skin = getElementModel ( source ) setTimer( spawnPlayer, 4000, 1, source, 1177.5682373047, -1323.2587890625, 14.077121734619,0,skin ) end ) Do you mean something like this?
  11. Dont use integer. Use float instead and it'll be fine.
  12. motax

    sql

    tableName, columnName, columnValue variables should contain strings except maybe the columnValue it depends on what kind of data do you want to store there. like: tableName = "users" columnName = "money" columnValue = 5000 dbExec( char_db, "UPDATE `??` SET `??`=?", tableName, columnName, columnValue ) but that's a bad example.. hmm tableName = "users" columnName = "username" columnValue = user dbExec( char_db, "UPDATE `??` SET `??`=?", tableName, columnName, columnValue )
  13. moveObject ( lol, 2.5, 316.79, -1191.80, 69, 0, 0, 40 ) It means that every time you use "brama" it'll rotate it's Z axis with +40 and not set it to 40.
  14. local lol = createObject ( 987, 316.79, -1191.80, 74.90, 0, 0, 40 ) local state = 0 function move() if state == 0 then moveObject ( lol, 2.5, 316.79, -1191.80, 69 ) state = state + 1 elseif state == 1 then moveObject ( lol, 2.5, 316.79, -1191.80, 74.90) state = state - 1 end end addCommandHandler("brama", move ) It must be work this way now! I tested it. The problem was that, the rotation is relative when you use moveObject()
  15. local lol = createObject ( 987, 316.79, -1191.80, 74.90, 0, 0, 40 ) local state = 0 function move() if state == 0 then moveObject ( lol, 2.5, 316.79, -1191.80, 69, 0, 0, 40 ) state = state + 1 elseif state == 1 then moveObject ( lol, 2.5, 316.79, -1191.80, 74.90, 0, 0, 40 ) state = state - 1 end end addCommandHandler("brama", move ) Try this
  16. A bit weird, but it's a freakin' good idea, I like it
  17. motax

    Hello!

    Yes, it's possible without ACL, you can use SetElementData and then GetElementData after that an if statement.
  18. No problem, I saw that the forum is full with people who asking help for stolen scripts all the time. I prefer to enjoy my own work.
  19. Work like a charm. Thanks again for the help!
  20. Nevermind, I'm an idiot... now i get it.. and thank you!
  21. I think you misunderstood me, because I can't see how this could help.
  22. Ok, thanks for the advice Any idea about how to stop doing that multiple locking/unlocking?
×
×
  • Create New...