Jump to content

lcd1232

Members
  • Posts

    96
  • Joined

  • Last visited

Everything posted by lcd1232

  1. lcd1232

    Headshot

    maybe u must change resource spawn?
  2. u must send parametr player in timer [lua]setTimer(function, 1000, 0, player)
  3. lcd1232

    Help me!

    for i=550,20000 do removeWorldModel(i,10000,0,0,0) end setOcclusionsEnabled(false) -- Also disable occlusions when removing certain models setWaterLevel(-5000)
  4. I think like this commands = {} commands.engine = 'setengine' commands.lock = 'lock' newcommands = {} newcommands.engine = get ( "engine" ) or commands.engine newcommands.lock = get( "lock" ) or commands.lock addCommandHandler(newcommands.engine, testFunction) addCommandHandler(newcommands.lock, test1Function)
  5. https://wiki.multitheftauto.com/wiki/Settings_system
  6. lcd1232

    Some problems

    U must put there uncompiled versions of scripts, because u can't compile script which are already compiled.
  7. Show source of script, not compiled version of server.lua
  8. or use setElementStreamable
  9. lcd1232

    Some problems

    to compile scripts use luac.multitheftauto.com
  10. it doesn't work because vehicle have rotation
  11. I have problem with getComponentPosition. I want to find coordinates of vehicle's part, but it doesn't work. Here code: addCommandHandler("getposit", function () --getPositionFromElementOffset = exports.functions:getPositionFromElementOffset local theVehicle = getPedOccupiedVehicle(getLocalPlayer()) local vx,vy,vz = getElementPosition( theVehicle ) local cx,cy,cz = getVehicleComponentPosition( theVehicle, 'bump_rear_dummy' ) local vfx,vfy,vfz = getElementRotation( theVehicle ) local result = 'vx = '..vx..' vy = '..vy..' vz = '..vz outputDebugString( result ) result = 'cx = '..cx..' cy = '..cy..' cz = '..cz outputDebugString( result ) result = 'vfx = '..vfx..' vfy = '..vfy..' vfz = '..vfz outputDebugString( result ) local zx, zy, zz = exports.functions:getPositionFromElementOffset( theVehicle, cx, cy, cz ) --local zx, zy, zz = call( getResourceFromName( 'functions' ), 'getPositionFromElementOffset', theVehicle, 0, 4, 0 ) createColSphere( zx, zy, zz, 1 ) end ) getPositionFromElementOffset: function getPositionFromElementOffset( theElement, offX, offY, offZ ) local m = getElementMatrix ( theElement ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end Result: http://s010.radikal.ru/i312/1408/4b/7f3906e25539.png
  12. viewtopic.php?f=108&t=36481
  13. Трейлер шикарный. Удачи проекту.
  14. -- this function adds new vehicle without replace old boolean addVehicle( int idModel, table handling, txd txdTexture, dff dffTexture ) -- model must be unique number -- this function adds new object without replace old boolean addObject( int id, col colTexture, txd txdTexture, dff dffTexture ) -- id must be unique nubmer
  15. Все равно плохо понял. А если при событии "onVehicleDestroy" указать root или getRootElement(), то когда оно будет срабатывать?
  16. Не могу до сих пор понять для чего нужен 2 параметр в функции и что в нем можно использовать addEventHandler( 'event', root, function )
  17. Если ты не понял, то тоже объясню. Если ты не будешь учить lua, то не сможешь ничего сам написать, а соответственно будешь просить помощи у всех. Тут тебе могут подсказать как что-то делать, но не писать за тебя. Так что у тебя 2 варианта: либо плати, либо учи.
  18. Нет, элемент theVehicle существует, просто во втором случае он не хочет инвертировать (not). Еще вопрос: функция setHelicopterRotorSpeed работает странно, например нужно вызывать её при событии onClientPreRender каждый раз, чтобы пропеллер не крутился.
  19. Если ввести в автомобиле outputChatBox( tostring( not getVehicleType( theVehicle ) == 'Automobile' ) ) то выводит false, однако если ввести outputChatBox( tostring( not getVehicleType( theVehicle ) == 'Plane' ) ) то выводит все равно false. В чем проблема? И как узнать какое расстояние прошел автомобиль за какой-то промежуток времени? (можно по разнице координат, но может он ездит вперед, назад)
  20. Написал функцию для бессмертных машин. Но почему-то евент не отменяется. Server Side function MakeImmortal( thePlayer ) theText = { [true] = "Поздравляем! Вы теперь бессмертны =)", [false] = "Вот так вот! Смерть теперь видет Вас =)" } setElementData( thePlayer, "Immortal", not getElementData( thePlayer, "Immortal" ) ) outputChatBox( theText[ getElementData( thePlayer, "Immortal" ) ], thePlayer ) end function ImmortalVehicle() local theDriver = getVehicleController( source ) if ( theDriver ~= false ) and ( getElementData( theDriver, "Immortal" ) == true ) then cancelEvent() outputChatBox( tostring( wasEventCancelled() ) ) end end addCommandHandler( "baguvix", MakeImmortal ) addEventHandler( "onVehicleDamage", getRootElement(), ImmortalVehicle ) meta.xml <meta> <script src='assasin.lua' type='server' /> </meta>
×
×
  • Create New...