Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. Kenix

    Jobs problem

    https://wiki.multitheftauto.com/wiki/Scr ... troduction viewtopic.php?f=148&t=40809 Also what is it???!! S.W.A.T = createTeam ( "S.W.A.T", 255, 255, 255 ) You can not call as a variable name. Your should create like this: Example S = { W = { A = { } } } S.W.A.T = createTeam ( "S.W.A.T", 255, 255, 255 ) print( S.W.A.T ) --> userdata You need learn lua.
  2. Kenix

    Some help

    setWeaponProperty is server side function. But you use in client side And also event onPlayerWasted is server side event, but you use in client side. Your code full wrong. Also you need attach handler to function at the bottom of the script. You need understand: Server side events ( onPlayerWasted, onPlayerSpawn, ... ) use only in server side. Client side events ( onClientPlayerWasted, onClientPlayerSpawn, ... ) use only in client side. Same thing with the functions ( There are exceptions, where you can use on the server and the client too ). https://wiki.multitheftauto.com/wiki/Scr ... troduction
  3. Kenix

    Jobs problem

    /debugscript 3? https://wiki.multitheftauto.com/wiki/Debugging
  4. function fOnScroll( ) local scrollvolume = guiScrollBarGetScrollPosition ( scrolll ) if scrollvolume > 0 and scrollvolume < 20 then startA( ) elseif scrollvolume > 20 and scrollvolume < 40 then startB( ) elseif scrollvolume > 40 and scrollvolume < 60 then startC( ) elseif scrollvolume > 60 and scrollvolume < 80 then startD( ) elseif scrollvolume > 80 and scrollvolume < 100 then startE( ) end end addEventHandler( "onClientGUIScroll", root, fOnScroll ) Условия неверные были. viewtopic.php?f=141&t=32458
  5. No problem. I'm always glad to help.
  6. function fMain( ) -- You:execute function I am:Define function local nVar = 1 -- You:the value = 1 I am:Define number variable with value 1 if nVar == 0 then -- You:check if it has been changed return false -- You:it will not return to this function I am:It return false. end return true -- You:execute function again? I am:It return true end print( fMain( ) -- You:Output:true -- output ??? I am:It output returned value by function fMain. So it output true. ) -- Also i said if you use operator 'return' it quit from function. Say me if you not understand something.
  7. Function fTest return number value 1. P.S I update last post.
  8. function fTest( ) return 1 end function fCheck( nValue ) if nValue == 1 then return 'False' end return 'True' end nValue = fTest( ) -- We call function fTest and function return number 1. print( fCheck( nValue ) --Call function fCheck with argument variable nValue ( number 1 ). ) --> output: False You mean it? Read all comments. Also what i forgot say. if you use operator 'return' then you out of function or something. Example function fMain( ) local nVar = 1 if nVar == 0 then return false end return true end print( fMain( ) -- Output:true ) Also do if true then return end print 'false' end Not output anything.
  9. Kenix

    [solved]

    viewtopic.php?f=108&t=24262&hilit=textlib Download http://www.mediafire.com/?o3ndd7jtf8gqf54
  10. setTimer ( destroyElement(wdwWarning) wdwWarning = false, 2600, 1) --Таймер по которому должно закрыться Может быть? setTimer ( function( wdwWarning ) destroyElement( wdwWarning ) end, 2600, 1, wdwWarning ) -- На вики написано, что 1 аргумент это функция, которая вызывается через промежуток времени ( который ты задал в аргументах ). В этой функции и делай что нужно.
  11. https://wiki.multitheftauto.com/wiki/Int ... ng_the_GUI
  12. Kenix

    World Objects

    It example working. It's client side. https://wiki.multitheftauto.com/wiki/Scr ... troduction
  13. Kenix

    Col Shape

    Try test with development mode. https://wiki.multitheftauto.com/wiki/SetDevelopmentMode
  14. Kenix

    damage bug..

    Copy again. I did think you need it Anyway you yourself can change arguments in function showPlayerHudComponent.
  15. Kenix

    damage bug..

    local uTimer function fDamage ( ) showPlayerHudComponent ( "health", true ) showPlayerHudComponent ( "armour", true ) if isTimer( uTimer ) then killTimer( uTimer ) end uTimer = setTimer( function( ) showPlayerHudComponent ( "health", false ) showPlayerHudComponent ( "armour", false ) end, 5000, 1 ) end addEventHandler ( "onClientPlayerDamage", localPlayer, fDamage ) I think you mean it ^^ So onPlayerDamage is server side event and you use showPlayerHudComponent with client side arguments.
  16. Kenix

    Col Shape

    Server local uRadar = createRadarArea( -466.317, -468.559, -150, -90, 255, 255, 0, 175 ) local uRectangle = createColRectangle( -466.317, -468.559, -150, -90 ) function fColshapeManager ( uElement, bDim ) if getElementType( uElement ) == 'player' then outputChatBox( eventName == 'onColShapeHit' and 'You entered the zone. Welcome!' or eventName == 'onColShapeLeave' and 'You left the zone. Bye bye!', uElement, 0, 255, 0 ) end end addEventHandler ( 'onColShapeHit', uRectangle, fColshapeManager ) addEventHandler ( 'onColShapeLeave', uRectangle, fColshapeManager )
  17. Report about it in bug tracker.
  18. Also https://wiki.multitheftauto.com/wiki/GetPlayerTeam https://wiki.multitheftauto.com/wiki/CreateTeam
  19. Kenix

    Problem with text

    Buke, You need show all where you create/change code ( not show all code ).
  20. Kenix

    Loggin in

    [RHD]ReFleX, Read viewtopic.php?f=148&t=40809
  21. Kenix

    Loggin in

    addEventHandler( "onPlayerLogin", root, function( ) outputChatBox( getPlayerName( source ):gsub( '#%x%x%x%x%x%x', '' ) .." has logged in!" ) end ) addEventHandler( "onPlayerLogout", root, function( ) outputChatBox( getPlayerName( source ):gsub( '#%x%x%x%x%x%x', '' ) .." has logged out!" ) end )
  22. Kenix

    Loggin in

    <meta> <info author="ReFleX" type="script" name="Logged" version="1.0.3" /> <script src="Logged.lua" /> </meta> Because onPlayerLogin and onPlayerLogout is server side events.
  23. Kenix

    Loggin in

    Show meta.xml. Also why you define 2 times variable root? root is predefined variable viewtopic.php?f=91&t=39678
  24. https://wiki.multitheftauto.com/wiki/Scr ... troduction https://wiki.multitheftauto.com/wiki/Int ... ng_the_GUI
×
×
  • Create New...