Veho*360 Posted April 12, 2013 Share Posted April 12, 2013 hello everyone I'm starting to record some MTA maps but I can hide the hud/chat and because I dont know how to script this I'd like if someone of you help me regards: Veho*360 Link to comment
Puma Posted April 12, 2013 Share Posted April 12, 2013 Chatbox can be hidden using /showchat . Since the chatbox is gone after you hid it, you need to use the F8-console and 'showchta' (without /) to unhide the chatbox. Link to comment
Veho*360 Posted April 12, 2013 Author Share Posted April 12, 2013 Mr.Pres[T]ege. I've seen the link but I don't know what to do I'm noob @edit: Tkx PUMA its working Link to comment
iPrestege Posted April 12, 2013 Share Posted April 12, 2013 Do you know thing about "Lua" ? if not then open server admin panel then resources "Tab" then "execteCommandHandler" You will see edit box but this code inside it and press client button and try ; showPlayerHudComponent("all",false) Link to comment
Veho*360 Posted April 12, 2013 Author Share Posted April 12, 2013 I'm so stupid . I open my server then go to admincp.Then resources and copy this there right? Link to comment
iPrestege Posted April 12, 2013 Share Posted April 12, 2013 No dont say that here : http://im39.gulfup.com/ZW1Q9.png and put the code in the box you see where i put it? put it there and after put this code : showPlayerHudComponent("all",false) put this to hide the chat : showChat(false) The same way put it in the box and press client button and that's all . Link to comment
Veho*360 Posted April 12, 2013 Author Share Posted April 12, 2013 tkz man. btw can you tell me how to hide the map name, time left and timer im taking too? sorry if im being boring Link to comment
iPrestege Posted April 12, 2013 Share Posted April 12, 2013 No Problem but the map and...etc u have to edit the race gamemode Link to comment
Veho*360 Posted April 12, 2013 Author Share Posted April 12, 2013 the map I've already found out how but I didn't find how to disable the timer and the time I've got left and also the speed and health... @EDIT: I can't change the option in the race name pls tell me how to do it Link to comment
codeluaeveryday Posted April 13, 2013 Share Posted April 13, 2013 Untested: replace race_client.lua with: g_Root = getRootElement() g_ResRoot = getResourceRootElement(getThisResource()) g_Me = getLocalPlayer() g_ArmedVehicleIDs = table.create({ 425, 447, 520, 430, 464, 432 }, true) g_WaterCraftIDs = table.create({ 539, 460, 417, 447, 472, 473, 493, 595, 484, 430, 453, 452, 446, 454 }, true) g_ModelForPickupType = { nitro = 2221, repair = 2222, vehiclechange = 2223 } g_HunterID = 425 g_Checkpoints = {} g_Pickups = {} g_VisiblePickups = {} g_Objects = {} addEventHandler('onClientResourceStart', g_ResRoot, function() g_Players = getElementsByType('player') fadeCamera(false,0.0) -- create GUI local screenWidth, screenHeight = guiGetScreenSize() g_dxGUI = { } g_GUI = { speedbar = FancyProgress.create(0, 1.5, 'img/progress_speed_bg.png', -65, 90, 123, 30, 'img/progress_speed.png', 8, 8, 108, 15), } guiSetFont(g_GUI.timeleft, 'default-bold-small') guiLabelSetHorizontalAlign(g_GUI.timeleft, 'center') g_GUI.speedbar:setProgress(0) RankingBoard.precreateLabels(10) -- set update handlers g_PickupStartTick = getTickCount() g_WaterCheckTimer = setTimer(checkWater, 1000, 0) -- load pickup models and textures for name,id in pairs(g_ModelForPickupType) do engineImportTXD(engineLoadTXD('model/' .. name .. '.txd'), id) engineReplaceModel(engineLoadDFF('model/' .. name .. '.dff', id), id) -- Double draw distance for pickups engineSetModelLODDistance( id, 60 ) end if isVersion101Compatible() then -- Dont clip vehicles (1.0.1 function) setCameraClip ( true, false ) end -- Init presentation screens TravelScreen.init() TitleScreen.init() -- Show title screen now TitleScreen.show() setPedCanBeKnockedOffBike(g_Me, false) end ) ------------------------------------------------------- -- Title screen - Shown when player first joins the game ------------------------------------------------------- TitleScreen = {} TitleScreen.startTime = 0 function TitleScreen.init() local screenWidth, screenHeight = guiGetScreenSize() local adjustY = math.clamp( -30, -15 + (-30- -15) * (screenHeight - 480)/(900 - 480), -15 ); g_GUI['titleImage'] = guiCreateStaticImage(screenWidth/2-256, screenHeight/2-256+adjustY, 512, 512, 'img/title.png', false) g_dxGUI['titleText1'] = dxText:create('', 30, screenHeight-67, false, 'bankgothic', 0.70, 'left' ) g_dxGUI['titleText2'] = dxText:create('', 120, screenHeight-67, false, 'bankgothic', 0.70, 'left' ) g_dxGUI['titleText1']:text( 'KEYS: \n' .. 'F4 \n' .. 'F5 \n' .. 'ENTER' ) g_dxGUI['titleText2']:text( '\n' .. '- TRAFFIC ARROWS \n' .. '- TOP TIMES \n' .. '- RETRY' ) hideGUIComponents('titleImage','titleText1','titleText2') end function TitleScreen.show() showGUIComponents('titleImage','titleText1','titleText2') guiMoveToBack(g_GUI['titleImage']) TitleScreen.startTime = getTickCount() TitleScreen.bringForward = 0 addEventHandler('onClientRender', g_Root, TitleScreen.update) end function TitleScreen.update() local secondsLeft = TitleScreen.getTicksRemaining() / 1000 local alpha = math.min(1,math.max( secondsLeft ,0)) guiSetAlpha(g_GUI['titleImage'], alpha) g_dxGUI['titleText1']:color(220,220,220,255*alpha) g_dxGUI['titleText2']:color(220,220,220,255*alpha) if alpha == 0 then hideGUIComponents('titleImage','titleText1','titleText2') removeEventHandler('onClientRender', g_Root, TitleScreen.update) end end function TitleScreen.getTicksRemaining() return math.max( 0, TitleScreen.startTime - TitleScreen.bringForward + 10000 - getTickCount() ) end -- Start the fadeout as soon as possible function TitleScreen.bringForwardFadeout(maxSkip) local ticksLeft = TitleScreen.getTicksRemaining() local bringForward = ticksLeft - 1000 outputDebug( 'MISC', 'bringForward ' .. bringForward ) if bringForward > 0 then TitleScreen.bringForward = math.min(TitleScreen.bringForward + bringForward,maxSkip) outputDebug( 'MISC', 'TitleScreen.bringForward ' .. TitleScreen.bringForward ) end end ------------------------------------------------------- ------------------------------------------------------- -- Travel screen - Message for client feedback when loading maps ------------------------------------------------------- TravelScreen = {} TravelScreen.startTime = 0 function TravelScreen.init() local screenWidth, screenHeight = guiGetScreenSize() g_GUI['travelImage'] = guiCreateStaticImage(screenWidth/2-256, screenHeight/2-90, 512, 256, 'img/travelling.png', false, nil) g_dxGUI['travelText1'] = dxText:create('Travelling to', screenWidth/2, screenHeight/2-130, false, 'bankgothic', 0.60, 'center' ) g_dxGUI['travelText2'] = dxText:create('', screenWidth/2, screenHeight/2-100, false, 'bankgothic', 0.70, 'center' ) g_dxGUI['travelText3'] = dxText:create('', screenWidth/2, screenHeight/2-70, false, 'bankgothic', 0.70, 'center' ) g_dxGUI['travelText1']:color(240,240,240) hideGUIComponents('travelImage', 'travelText1', 'travelText2', 'travelText3') end function TravelScreen.show( mapName, authorName ) TravelScreen.startTime = getTickCount() g_dxGUI['travelText2']:text(mapName) g_dxGUI['travelText3']:text(authorName and "Author: " .. authorName or "") showGUIComponents('travelImage', 'travelText1', 'travelText2', 'travelText3') guiMoveToBack(g_GUI['travelImage']) end function TravelScreen.hide() hideGUIComponents('travelImage', 'travelText1', 'travelText2', 'travelText3') end function TravelScreen.getTicksRemaining() return math.max( 0, TravelScreen.startTime + 3000 - getTickCount() ) end ------------------------------------------------------- -- Called from server function notifyLoadingMap( mapName, authorName ) fadeCamera( false, 0.0, 0,0,0 ) -- fadeout, instant, black TravelScreen.show( mapName, authorName ) end -- Called from server function initRace(vehicle, checkpoints, objects, pickups, mapoptions, ranked, duration, gameoptions, mapinfo, playerInfo) outputDebug( 'MISC', 'initRace start' ) unloadAll() g_Players = getElementsByType('player') g_MapOptions = mapoptions g_GameOptions = gameoptions g_MapInfo = mapinfo g_PlayerInfo = playerInfo triggerEvent('onClientMapStarting', g_Me, mapinfo ) g_dxGUI.mapdisplay:text("Map: "..g_MapInfo.name) fadeCamera(true) showHUD(false) g_Vehicle = vehicle setVehicleDamageProof(g_Vehicle, true) OverrideClient.updateVars(g_Vehicle) --local x, y, z = getElementPosition(g_Vehicle) setCameraBehindVehicle(vehicle) --alignVehicleToGround(vehicle) updateVehicleWeapons() setCloudsEnabled(g_GameOptions.cloudsenable) setBlurLevel(g_GameOptions.blurlevel) g_dxGUI.mapdisplay:visible(g_GameOptions.showmapname) if engineSetAsynchronousLoading then engineSetAsynchronousLoading( g_GameOptions.asyncloading ) end -- checkpoints g_Checkpoints = checkpoints -- pickups local object local pos local colshape for i,pickup in pairs(pickups) do pos = pickup.position object = createObject(g_ModelForPickupType[pickup.type], pos[1], pos[2], pos[3]) setElementCollisionsEnabled(object, false) colshape = createColSphere(pos[1], pos[2], pos[3], 3.5) g_Pickups[colshape] = { object = object } for k,v in pairs(pickup) do g_Pickups[colshape][k] = v end g_Pickups[colshape].load = true if g_Pickups[colshape].type == 'vehiclechange' then g_Pickups[colshape].label = dxText:create(getVehicleNameFromModel(g_Pickups[colshape].vehicle), 0.5, 0.5) g_Pickups[colshape].label:color(255, 255, 255, 0) g_Pickups[colshape].label:type("shadow",2) end end -- objects g_Objects = {} local pos, rot for i,object in ipairs(objects) do pos = object.position rot = object.rotation g_Objects[i] = createObject(object.model, pos[1], pos[2], pos[3], rot[1], rot[2], rot[3]) end if #g_Checkpoints > 0 then g_CurrentCheckpoint = 0 showNextCheckpoint() end -- GUI g_dxGUI.timepassed:text('0:00:00') showGUIComponents('healthbar', 'speedbar', 'timepassed') hideGUIComponents('timeleftbg', 'timeleft') if ranked then showGUIComponents('ranknum', 'ranksuffix') else hideGUIComponents('ranknum', 'ranksuffix') end if #g_Checkpoints > 0 then showGUIComponents('checkpoint') else hideGUIComponents('checkpoint') end g_HurryDuration = g_GameOptions.hurrytime if duration then launchRace(duration) end Link to comment
Veho*360 Posted April 13, 2013 Author Share Posted April 13, 2013 It doesn't work the map loads but It doesn't passes the black part But thank you anyway Link to comment
50p Posted April 13, 2013 Share Posted April 13, 2013 local playerRecorderState = { } function togglePlayerRecorder( plr ) playerRecorderState[ plr ] = not playerRecorderState[ plr ]; -- first time player calls this function the state will be "true" so they'll have to press it again to hide chat and HUD showPlayerHudComponent( plr, "all", playerRecorderState[ plr ] ); showChat( plr, playerRecorderState[ plr ] ); end function bindRecorder( plr ) bindKey( plr, "home", "down", togglePlayerRecorder, plr ); -- change it to any key you want end addEventHandler( "onPlayerJoin", root, function ( ) bindRecorder( source ); end ) addEventHandler( "onResourceStart", resourceRoot, function( ) for _, plr in getElementsByType( "player" ) do bindRecorder( plr ); end end ) Link to comment
Veho*360 Posted April 14, 2013 Author Share Posted April 14, 2013 here do i put that?? (im noob ;<) Link to comment
Castillo Posted April 14, 2013 Share Posted April 14, 2013 Please read the following things: https://wiki.multitheftauto.com/wiki/Resources https://wiki.multitheftauto.com/wiki/Se ... our_server https://wiki.multitheftauto.com/wiki/Meta.xml Link to comment
itoko Posted April 30, 2013 Share Posted April 30, 2013 You can also use this race i edited: viewtopic.php?f=108&t=43277&p=436482#p436482 Just replace your race in the resource folder Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now