Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. Kenix

    getElementData

    setTimer( rank, 1000, 1 ) ?
  2. Kenix

    getElementData

    Your example wrong You call function uText, but this function not exists. Correct local pLabel = guiCreateLabel( 0.5, 0.5, 0.5, 0.5, '', true ) guiSetText( pLabel, 'Label' ) setTimer( guiSetText, 1000, 1, pLabel, 'Updated' )
  3. Kenix

    getElementData

    Why? I don't understand.
  4. Можно https://community.multitheftauto.com/ind ... ls&id=2540 + анимацию примени
  5. Kenix

    getElementData

    function rank ( ) local nData = tonumber( getElementData ( localPlayer, 'rank' ) or 0 ) if nData > 0 and nData < 50 then -- TODO elseif nData > 50 and nData < 115 then -- TODO elseif nData > 115 and nData < 500 then -- TODO end end addEventHandler ( 'onClientResourceStart', resourceRoot, rank ) ?
  6. Kenix

    getElementData

    Explain this: elseif tonumber( getElementData ( localPlayer, "rank" ) ) < 50-115 then I don't understand.
  7. Kenix

    getElementData

    No. It's normal. If you call function with 1 argument and this argument is string or table you not need use '( )'. Example print 'ye' -- ye for _, s in pairs { '1', '2' } do print( s ) --[[ Output: 1 2 ]] end You can check this in lua demo http://www.lua.org/cgi-bin/demo
  8. Kenix

    getElementData

    Your data 'rank' return string type. Convert string to number with function tonumber if tonumber( getElementData ( localPlayer, 'rank' ) ) < 50 then outputChatBox 'hey' end If this not working try check what return data 'rank'.
  9. if ( allowedGroups getElementData ( player, "FBI" ) ) then and local allowedGroups = { "FBI"=true } Correct local aAllowedGroups = { [ 'FBI' ] = true; [ false ] = false; } local pCol = createColSphere ( 927.4365234375, -1022.5947265625, 35.913665771484, 27.5 ) local pGate = createObject ( 3113, 941.1669921875, -1012.3310546875, 32.369918823242, 0, 15, 272.5 ) function ColShapeManager( pElement ) if getElementType( pElement ) == 'player' and aAllowedGroups[ getElementData ( pElement, 'FBI' ) ] then if eventName == 'onColShapeHit' then moveObject ( pGate, 941.1669921875, -1012.3310546875, 21.369918823242, 0, 15, 272.5 ) else moveObject( pGate, 3037, 941.1669921875, -1012.3310546875, 32.369918823242, 0, 15, 272.5 ) end end end addEventHandler( 'onColShapeHit', pCol, ColShapeManager ) addEventHandler( 'onColShapeLeave', pCol, ColShapeManager ) What return data 'FBI' ?
  10. Как же ещё ты сделаешь?
  11. function loginPlayerDB( pPlayer, sName, sPass ) local aResult = dbPoll( dbQuery( SQLconnect, "SELECT password FROM players WHERE name = '" .. sName .. "' LIMIT 1" ), - 1 ) if aResult and type( aResult ) == 'table' then local sPassword = aResult[ 1 ][ 'password' ] -- get password from table -- TODO end -- TODO end
  12. i gave you link. You not want read. Good luck.
  13. Check returned value all functions. Also, try replace other model.
  14. https://forum.multitheftauto.com/viewtop ... 42b29ceffe
  15. Вообще можно. Лепим объект стекла в 3D Max'e -> аттачим стекло к тачке -> двигаем через moveObject Гемор будет с офсетами для каждой тачки.
  16. I tested this script all working perfectly if you not like something just change.
  17. local bBoostState, pTimer addEventHandler( 'onClientKey', root, function( sButton, bPressed ) local pVehicle = getPedOccupiedVehicle ( localPlayer ) if getVehicleController ( pVehicle ) == localPlayer then if sButton == 'lshift' and not bBoostState then bBoostState = true pTimer = setTimer( function( pVehicle ) if pVehicle and isElement( pVehicle ) and getElementType( pVehicle ) == 'vehicle' then local fVehSpeedX, fVehSpeedY, fVehSpeedZ = getElementVelocity ( pVehicle ) setElementVelocity ( pVehicle, fVehSpeedX * 1.1, fVehSpeedY * 1.1, fVehSpeedZ * 1 ) end end, 50, 0, pVehicle ) elseif sButton == 'lalt' and bBoostState then if isTimer( pTimer ) then bBoostState = nil killTimer( pTimer ) pTimer = nil end end else outputChatBox( 'You need to be the driver!', 255, 0, 0 ) end end )
  18. karthik184 said about this. Lua is case sensitive!
  19. Wrong. Example print( 'empty = ' .. tostring( #{ [0] = 'a' } == 0 ) ) -- empty = true Operator # used ipairs method for calculate! ipairs loop only numeric indexes ( from 1 index ) and only in order. Use my function. function table.empty( a ) if type( a ) ~= "table" then return false end return not next( a ) end Example print( 'empty = ' .. tostring( table.empty { [0] = 1 } ) ) -- false print( 'empty = ' .. tostring( table.empty { [10] = 10, [2] = 2 } ) ) -- false print( 'empty = ' .. tostring( table.empty { } ) ) -- true Added to useful functions. https://wiki.multitheftauto.com/wiki/Table.empty
  20. if table == nil then print("table is empty") end It's wrong! You check if variable is nil. I written this function function table.empty( a ) if type( a ) ~= "table" then return false end return not next( a ) end
  21. onElementDataChange ? onClientElementDataChange ?
×
×
  • Create New...