Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. Ошибся Скрипт рабочий проверял только что , возвращает true но колёса не заменяет. local wheels = { {"wheel_or1",1025}, {"wheel_sr1",1079}, {"wheel_sr2",1075}, {"wheel_sr3",1074}, {"wheel_sr4",1081}, {"wheel_sr5",1080}, {"wheel_sr6",1073}, {"wheel_lr1",1077}, {"wheel_lr2",1083}, {"wheel_lr3",1078}, {"wheel_lr4",1076}, {"wheel_lr5",1084}, {"wheel_gn1",1082}, {"wheel_gn2",1085}, {"wheel_gn3",1096}, {"wheel_gn4",1097}, {"wheel_gn5",1098} } function replace( ) for i,v in pairs( wheels ) do engineImportTXD( engineLoadTXD ( v[1]..".txd" ),tonumber( v[2] ) ) engineReplaceModel( engineLoadDFF( v[1]..".dff", 0 ),tonumber( v[2] ) ) end end setTimer( replace,1000,1 ) P.S Давно помню заменял тоже такие проблемы были, попробуй заменить другие модельки колёс.
  2. Ну так пусть проверяет возвращаемое значение в цикле ... local wheels = { {"wheel_or1",1025}, {"wheel_sr1",1079}, {"wheel_sr2",1075}, {"wheel_sr3",1074}, {"wheel_sr4",1081}, {"wheel_sr5",1080}, {"wheel_sr6",1073}, {"wheel_lr1",1077}, {"wheel_lr2",1083}, {"wheel_lr3",1078}, {"wheel_lr4",1076}, {"wheel_lr5",1084}, {"wheel_gn1",1082}, {"wheel_gn2",1085}, {"wheel_gn3",1096}, {"wheel_gn4",1097}, {"wheel_gn5",1098} } function replace( ) for _,v in pairs( wheels ) do outputChatBox( "Import TXD NAME = '"..v[1].."' ID = '"..v[2].."' RETURN = '"..tostring( engineImportTXD( outputChatBox( "Load TXD NAME = '"..v[1].."' RETURN = '"..tostring( engineLoadTXD ( v[1]..".txd" ) ).."'" ),v[2] ) ).."'" ) outputChatBox( "Replace DFF NAME = '"..v[1].." ID = '"..v[2].."' RETURN = '"..tostring( engineReplaceModel( outputChatBox( "Load DFF NAME = '"..v[1].."' RETURN = '"..tostring( engineLoadDFF( v[1]..".dff", 0 ) ).."'" ),v[2] ) ).."'" ) outputChatBox( "------------------------------------------------------") end end setTimer( replace,1000,1 )
  3. Ты хоть понял что ты написал ваще? У тебя nil будет в любом случае т.к переменной ( txd1 ) и ( dff1 ) не существует. Посмотри эту тему viewtopic.php?f=141&t=32458 и наконец то пойми скриптовой язык Lua. outputChatBox ( "txd01 = "..tostring(txd1)..", dff01 = "..tostring(dff1) ) ... outputChatBox ( "txd17 = "..tostring(txd1)..", dff17 = "..tostring(dff1) ) Надеюсь ты понял что я имею ввиду . Попробуй local wheels = { {"wheel_or1",1025}, {"wheel_sr1",1079}, {"wheel_sr2",1075}, {"wheel_sr3",1074}, {"wheel_sr4",1081}, {"wheel_sr5",1080}, {"wheel_sr6",1073}, {"wheel_lr1",1077}, {"wheel_lr2",1083}, {"wheel_lr3",1078}, {"wheel_lr4",1076}, {"wheel_lr5",1084}, {"wheel_gn1",1082}, {"wheel_gn2",1085}, {"wheel_gn3",1096}, {"wheel_gn4",1097}, {"wheel_gn5",1098} } function replace( ) for _,v in pairs( wheels ) do engineImportTXD( engineLoadTXD ( v[1]..".txd" ),v[2] ) engineReplaceModel( engineLoadDFF( v[1]..".dff", 0 ),v[2] ) end end setTimer( replace,1000,1 )
  4. Я начал делать библиотеку т.к на форуме видел частенько что не хватает событий для команд и некоторых функций. Версия 0.1.1 События: onTeamCreate onTeamRemove onTeamChange onTeamColorChange onPlayerTeamChange Функций не стал выкладывать т.к их очень много. Могут быть ошибки т.к я не всё проверял всё. Постараюсь проверить всё и сделать больше функций и событий. Не судите строго Скачать
  5. Самому не как не сделать? при убийстве игрока -> onPlayerWasted он взрывается - > createExplosion( позиция убитого игрока ,тип взрыва ) addEventHandler( "onPlayerWasted",root, function( ) local x,y,z = getElementPosition( source ) createExplosion( x,y,z,0 ) end )
  6. Ты вызываешь функцию callServerFunction которой не существует Ваш кэп
  7. Что это вообще? function createVehicleForPlayer(thePlayer, "veh 411", "411") мб ты имел ввиду это? function createVehicleForPlayer( thePlayer,model ) local x,y,z = getElementPosition( thePlayer ) -- получить позицию игрока local createdVehicle = createVehicle( tonumber( model ),x + 5,y,z ) if not createdVehicle then outputChatBox( "Failed to create vehicle.",thePlayer ) end end addCommandHandler( "veh", createVehicleForPlayer ) Пожалуйста прочитай эту тему: viewtopic.php?f=141&t=32458
  8. Kenix

    Problem

    hmm ok thx you
  9. Kenix

    Problem

    Hi guys.I have problem with sql So code: local sql = { create = executeSQLCreateTable } addEventHandler("onResourceStart",resourceRoot, function( ) sql.create( "achievements", [[ user STRING DEFAULT '', ach1 STRING DEFAULT '0', ach2 STRING DEFAULT '0', ach3 STRING DEFAULT '0', ach4 STRING DEFAULT '0', ach5 STRING DEFAULT '0', ach6 STRING DEFAULT '0', ach7 STRING DEFAULT '0', ach8 STRING DEFAULT '0', ach9 STRING DEFAULT '0', ach10 STRING DEFAULT '0' ]] ) end ) debugscript 3 not write errors DEFAULT not working and not set default value Help please
  10. Покажи весь код
  11. Kenix

    help plz

    please show your config ( mtaserver.conf )
  12. Try and say what debug write function DestructionMoney2() local alivePlayers = getAlivePlayers( ) if info == "Destruction derby" then if #alivePlayers ~= 0 then local selectPlayer = alivePlayers[1] if selectPlayer then local playername = getPlayerName ( selectPlayer ) local serial = getPlayerSerial( selectPlayer ) givePlayerMoney( selectPlayer, 1200) local oldData = executeSQLSelect( "RaceStats", "RaceWins","serial = '" .. serial .. "'") if oldData and #oldData ~= 0 then local newData = tonumber( oldData[1]["RaceWins"] ) + 1 setElementData( selectPlayer,"Points",tonumber( getElementData( selectPlayer,"Points" ) ) +5 ) setElementData( selectPlayer,"Race Wins",tonumber( getElementData( selectPlayer,"Race Wins") ) +1 ) local update = executeSQLUpdate ( "RaceStats", "RaceWins = '"..newData.."'","serial = '" .. serial .. "'" ) outputChatBox( getPlayerName ( selectPlayer ) .. " has won $1200 for be the last player alive!",root,0,255,0 ) if not update then error( "can't update" ) end else local insert = executeSQLInsert ( "RaceStats", "'0','none'" ) if not insert then error( "can't insert" ) end end else error( "not selected player" ) end else error( "not alive players" ) end end end p.s update code
  13. What the problem ? /debugscript 3 ?
  14. У меня такое бывало часто. Хотя с видеокартой всё норм.
  15. сервер addCommandHandler("gravitys", function( source,cmd,name ) if type( name ) == "string" then local from = getPlayerFromName( name ) if from then setPedGravity( from,0 ) setTimer( setPedGravity,2000,1,from,0.2 ) end else setPedGravity( root,0 ) setTimer( setPedGravity,2000,1,root,0.2 ) end end)
  16. server addCommandHandler ( "party", function ( source ) triggerClientEvent( "PlaySound",root ) local function xxx( ) for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random( 0,255 ) color[2] = math.random( 0,255 ) color[3] = math.random( 0,255 ) setVehicleColor ( car, color[1], color[2], color[3] ) setSkyGradient ( math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255) ) setWaterColor( math.random (0,255), math.random (0,255), math.random (0,255) ) end end setTimer( xxx,300,46 ) end ) client addEvent( "PlaySound",true ) addEventHandler( "PlaySound",root, function( ) local sound = playSound( "disco_pogo.mp3" ) setSoundVolume( sound, 0.5 ) end ) Open acl.xml find: and add <right name="command.party" access="true"></right> Also you can create it with admin resource
  17. You not needed add it to acl. or you need create only admin can use this command or what? LOL You use it in client side and local player( only you ) can see it you need create it in server side.
  18. Because you not use correct arguments for function setVehicleColor see where from 1.1 https://wiki.multitheftauto.com/wiki/SetVehicleColor addCommandHandler ( "party", function () local sound = playSound( "disco_pogo.mp3" ) setSoundVolume( sound, 0.5 ) local function xxx() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random( 0,255 ) color[2] = math.random( 0,255 ) color[3] = math.random( 0,255 ) setVehicleColor ( car, color[1], color[2], color[3] ) setSkyGradient ( math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255) ) setWaterColor( math.random (0,255), math.random (0,255), math.random (0,255) ) end end setTimer(xxx,300,46) end )
  19. Shader? Possibly, but i don't know how to make it.( If anyone could please help I would be very grateful. ) After all, it is necessary that the player was illuminated as by day, perhaps there are other options for how to do it.
×
×
  • Create New...