Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. Ok. addEventHandler ( 'onGamemodeMapStart', root, function ( uMapStart ) setGameType ( getResourceInfo( uMapStart, 'name' ) ) end ) Copy paste
  2. Try Server addEventHandler ( 'onGamemodeMapStart', root, function ( uMapStart ) setGameType ( getResourceName( uMapStart ) ) end ) Updated again.
  3. Meta generator viewtopic.php?f=108&t=41111 http://development.mtasa.com/index.php? ... U/Meta.xml <meta> <info version="1.0" type="script" /> <min_mta_version client="1.3.0" server="1.3.0" /> <script src="rwo.lua" type="server"/> </meta>
  4. Just use this CDraw = { } function TableAssert( t ) if type( t ) == 'table' then for _, v in pairs( t ) do if v.value and v.condition then assert( v.value == v.condition, v.sMsg ) elseif v.condition == false then assert( v.condition, v.sMsg ) end end return true end return false end nScreenX, nScreenY = guiGetScreenSize( ) local tVisible = { } function CDraw:CreateText( sText, nPosX, nPosY, bRelative, bResizeText ) TableAssert( { { value = type( sText ); condition = 'string'; sMsg = '1 argument is not string!'; }; { value = type( nPosX ); condition = 'number'; sMsg = '2 argument is not number!'; }; { value = type( nPosY ); condition = 'number'; sMsg = '3 argument is not number!'; }; { value = type( bRelative ); condition = 'boolean'; sMsg = '4 argument is not boolean!'; }; } ) return setmetatable( { sText = sText; nScale = bResizeText and ( nScreenX / nPosX ) * 1.0 or 1.0; nPosX = nPosX; nPosY = nPosY; bRelative = bRelative; tMainColor = { nR = 255, nG = 255, nB = 255, nA = 255 }; sData = 'Text'; sMixedFont = 'default'; sAlignX = 'left'; sAlignY = 'top'; bClip = false; bWordBreak = false; bPostGUI = false; bResizeText = bResizeText or false; }, { __index = CDraw; } ) end function CDraw:CreateRectangle( nPosX, nPosY, nWidth, nHeight, bRelative ) TableAssert( { { value = type( nPosX ); condition = 'number'; sMsg = '1 argument is not number!'; }; { value = type( nPosY ); condition = 'number'; sMsg = '2 argument is not number!'; }; { value = type( nWidth ); condition = 'number'; sMsg = '3 argument is not number!'; }; { value = type( nHeight ); condition = 'number'; sMsg = '4 argument is not number!'; }; { value = type( bRelative ); condition = 'boolean'; sMsg = '5 argument is not boolean!'; }; } ) return setmetatable( { nPosX = nPosX; nPosY = nPosY; nWidth = nWidth; nHeight = nHeight; bRelative = bRelative; tMainColor = { nR = 255, nG = 255, nB = 255, nA = 255 }; bPostGUI = false; sData = 'Rectangle'; }, { __index = CDraw; } ) end function CDraw:CreateImage( nPosX, nPosY, nWidth, nHeight, sPath, bRelative ) TableAssert( { { value = type( nPosX ); condition = 'number'; sMsg = '1 argument is not number!'; }; { value = type( nPosY ); condition = 'number'; sMsg = '2 argument is not number!'; }; { value = type( nWidth ); condition = 'number'; sMsg = '3 argument is not number!'; }; { value = type( nHeight ); condition = 'number'; sMsg = '4 argument is not number!'; }; { value = type( sPath ); condition = 'string'; sMsg = '5 argument is not string!'; }; { value = type( bRelative ); condition = 'boolean'; sMsg = '6 argument is not boolean!'; }; { value = fileExists( sPath ); condition = true; sMsg = 'File: \'' .. sPath .. '\' not exists!'; }; } ) return setmetatable( { nPosX = nPosX, nPosY = nPosY; nWidth = nWidth; nHeight = nHeight; sPath = sPath; bRelative = bRelative; nRotation = 0; nRotationCenterOffsetX = 0; nRotationCenterOffsetY = 0; tMainColor = { nR = 255, nG = 255, nB = 255, nA = 255 }; bPostGUI = false; sData = 'Image'; }, { __index = CDraw; } ) end function CDraw:Clip( bClip ) if self.sData == 'Text' then if type( bClip ) == 'boolean' then self.bClip = bClip return true end return self.bClip end return false end function CDraw:WordBreak( bWordBreak ) if self.sData == 'Text' then if type( bWordBreak ) == 'boolean' then self.bWordBreak = bWordBreak return true end return self.bWordBreak end return false end function CDraw:HorizontalAlign( sAlignX ) if self.sData == 'Text' then if type( sAlignX ) == 'string' and type( sAlignX ) == 'left' and type( sAlignX ) == 'center' and type( sAlignX ) == 'right' then self.sAlignX = sAlignX return true end return self.sAlignX end return false end function CDraw:VerticalAlign( sAlignY ) if self.sData == 'Text' then if type( sAlignY ) == 'string' and type( sAlignY ) == 'top' and type( sAlignY ) == 'center' and type( sAlignY ) == 'bottom' then self.sAlignY = sAlignY return true end return self.sAlignY end return false end function CDraw:Scale( nScale, bConvertToRelative ) if self.sData == 'Text' then if type( nScale ) == 'number' and type( bConvertToRelative ) == 'boolean' then self.nScale = bConvertToRelative and ( nScreenX / self.nPosX ) * nScale or nScale return true end return self.nScale end return false end function CDraw:Text( sText ) if self.sData == 'Text' then if type( sText ) == 'string' then self.sText = sText
  5. X-SHADOW, viewtopic.php?f=148&t=40809
  6. Вообщем так: Поставь на 9000 Уйди из стрима. Вернись обратно.
  7. Радиус нужен больше, а не 10 юнитов.
  8. Toxiic, viewtopic.php?f=148&t=40809 math.random(#weaponsTable) --[[ It return random number 1 to 4 ( it's indexes table, but you need get value in indexes ) #is table size ]] weaponsTable[ math.random( #weaponsTable ) ] --[[ So, math.random( #weaponsTable ) return random number 1 to 4 And you get value from table with this random index. ]] local t = { [1] = 1; [2] = 2; [3] = 3; } print( t[ math.random( #t ) ] )
  9. t = { [0] = 0; [1] = 1; [2] = 2; } for i, _ in pairs( t ) do print( i ) end --[[ 0 1 2 ]] for i, _ in ipairs( t ) do print( i ) end --[[ 1 2 ]] pairs loop all indexes in table. ipairs loop only number indexes and only in order. t = { [1] = 1; [3] = 3; [4] = 4; } for i, _ in ipairs( t ) do print( i ) end --[[ 1 ]]
  10. Fail. Only in server side you can add in first argument command-function-handler element player.
  11. https://community.multitheftauto.com/index.php?p= ... ls&id=4231
  12. ex <group name="mysql"> <acl name="mysqlACL"></acl> <object name="resource.yourresourcename"></object> </group> <acl name="mysqlACL"> <right name="function.restartResource" access="true"></right> </acl> Updated.
  13. DirectX SDK, Microsoft ® Windows Server® 2003 R2 Platform SDK. Ну из них добавляешь Просто выбираешь папку и всё.
  14. Я так и думал Вообщем Tools->Options->Project and solutions->VC++ Directories->Кликаешь на значок папки-> указываешь путь к либам( .lib ), заголовочным файлам( .h ) и т.д
  15. Компиляции. Чую, что ты не подключил в проект необходимые заголовочные файлы, либы, .. Ща разберём всё.
  16. Kenix

    Problems

    t = { [1] = function( ) return 'GanJaRuleZ' end; [2] = function( ) return 'Learn' end; [3] = function( ) return 'Lua' end; } for i = 1, #t do print( t[ i ]( ) ) end --[[ Output: GanJaRuleZ Learn Lua ]] ?
  17. Kenix

    Problems

    Learn again. It's hard?
  18. Kenix

    Problems

    You need learn! 292 posts only help .. If you like it ok.
  19. Kenix

    Problems

    I not understand anything! https://wiki.multitheftauto.com/wiki/Scr ... troduction https://wiki.multitheftauto.com/wiki/SetElementData https://wiki.multitheftauto.com/wiki/Element_data viewtopic.php?f=148&t=40809 Go ahead!
  20. https://wiki.multitheftauto.com/wiki/Get ... ceRotation не?
×
×
  • Create New...