Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. А если таск проверять, не? getPedTask Ну и биндом можно ещё.
  2. Your module mysql not found! Put this module in your directory. server/mods/deathmatch/modules/
  3. Kenix

    How?

    This event not canceled.
  4. Kenix

    Help

    Ninguem[ATZ] viewtopic.php?f=148&t=40809 https://wiki.multitheftauto.com/wiki/Scr ... troduction warpPedIntoVehicle server side only!
  5. Read all. https://wiki.multitheftauto.com/wiki/Mysql
  6. Download -> Include mysql module in server config. https://wiki.multitheftauto.com/wiki/Mysql
  7. You have already some resources. And you not include module mysql.
  8. Kenix

    Question !!

    local tTeams = { tTeamBlue = { [46] = { [31] = 50; [29] = 50; }; }; tTeamRed = { [45] = { [28] = 50; [26] = 50; }; }; } for sIndex, t in pairs( tTeams ) do createTeam( sIndex ) end function fTableGetIndexs( t ) local tTest = { } for m, _ in pairs( t ) do table.insert( tTest, m ) end return tTest end addEventHandler( 'onResourceStart', resourceRoot, function( ) for _, uPlayer in pairs( getElementsByType 'player' ) do setTimer( setPlayerTeam, 100, 1, uPlayer, getTeamFromName( fTableGetIndexs( tTeams )[ math.random( #fTableGetIndexs( tTeams ) ) ] ) ) -- set random team for example setTimer( function( uPlayer, tTeams ) local sTeam = getTeamName( getPlayerTeam( uPlayer ) ) setElementModel( uPlayer, fTableGetIndexs( tTeams[ sTeam ] )[1] ) for nIndex, nValue in pairs( tTeams[ sTeam ][ fTableGetIndexs( tTeams[ sTeam ] )[1] ] ) do setTimer( giveWeapon, 100, 1, uPlayer, nIndex, nValue ) end end, 200, 1, uPlayer, tTeams ) end end ) Updated
  9. Как вариант. Путь к бд не содержит латинских символов.
  10. События вообще срабатывают? В коде нет синтаксических ошибок? Проверься viewtopic.php?f=141&t=40703
  11. Kenix

    Question !!

    index = value !! Your code totally wrong .. local tTeams = { tTeamBlue = { [46] = { [31] = 50; [29] = 50; }; }; tTeamRed = { [45] = { [28] = 50; [26] = 50; }; }; } http://lua-users.org/wiki/TablesTutorial t = { } t[1] = 1 print( t[1] ) -- 1 table.insert( t, 2 ) print( t[2] ) -- 2 t = { 1 } print( t[1] ) -- 1 --If you not define index it defined default -- Example t = { 1; 2; 3; } print( t[3] ) -- 3 -- Next example t = { '1'; '2'; '3'; } print( t[3], type( t[3] ) ) -- 3 string t = { } t['index'] = 'value' print( t.index, '...', t['index'] ) --[[ value ... value ]]
  12. Kenix

    Question !!

    Again learn lua?
  13. Kenix

    Help

    /debugscript 3?
  14. Event: onPlayerFinish https://wiki.multitheftauto.com/wiki/RU/Resource:Race givePlayerMoney
  15. https://community.multitheftauto.com/index.php?p= ... ls&id=4592
  16. Kenix

    Object help

    getColorFromString ?
  17. https://wiki.multitheftauto.com/wiki/OnVehicleStartEnter + https://wiki.multitheftauto.com/wiki/Set ... ngineState ?
  18. Kenix

    Stats gui

    Maybe better read wiki? He get player element via function getPlayerFromName Yakuza.Real Not defined Variables: money, theSerial, un. You should trigger to server -> get serial, money, ... -> trigger this data to client -> guiSetText
  19. It's wrong. In last argument you attach function Here local theMarker = createMarker ( x + 2, y + 2, z, "cylinder", 1.5, 255, 255, 0, 170,see) Also if ( thePlayer ) then This condition not needed. This command triggered when you type this command. So if you type this command player is element in any case. Better way addCommandHandler ( 'createmarker', function( uPlayer ) local nX, nY, nZ = getElementPosition ( uPlayer ) local uMarker = createMarker ( nX + 2, nY + 2, nZ, 'cylinder', 1.5, 255, 255, 0, 170, uPlayer ) end )
  20. source ( element who call event ) = latent predefined variable in event. You don't need add 'source' to arguments function-handler. https://wiki.multitheftauto.com/wiki/AddEventHandler
  21. This this sync only for localPlayer .. You should trigger to server and use setElementModel.
×
×
  • Create New...