HunT Posted October 21, 2011 Share Posted October 21, 2011 (edited) Hi All. i need help for the position nos This is 1280x960 (i want this ) And This is 800 x 800 ( Facepalm ) File Client : g_Settings = { DisplayGauge = true, GaugePosition = { g_ScreenSize[1] * 0.75, g_ScreenSize[2] * 0.87 }, ControlStyle = "normal", SustainOnPickup = true, NosDuration = 40, NosRechargeDelay = 40, NosRechargeDuration = 15, KeepNosOnPlayerWasted = true, KeepNosOnVehicleChange = true }; and dxDrawImage(g_Settings.GaugePosition[1], g_Settings.GaugePosition[2], 100, 100, "img/nos_gauge.png", 0, 0, 0, color) dxDrawImage(g_Settings.GaugePosition[1] + 45, g_Settings.GaugePosition[2] + 41, 10, 40, "img/nos_arrow.png", nosangle, 0, -11, tocolor(255, 255, 255)) Help please Edited October 23, 2011 by Guest Link to comment
Aibo Posted October 21, 2011 Share Posted October 21, 2011 GaugePosition = { g_ScreenSize[1] - 318, g_ScreenSize[2] - 126 }, Link to comment
HunT Posted October 21, 2011 Author Share Posted October 21, 2011 Work Tnx U are the Best AiboForcen Link to comment
HunT Posted October 23, 2011 Author Share Posted October 23, 2011 I Have other problem i add the spec. number in the nos,but the nos image destroy on finish the nos (epic eng sorry ) This is image with nos : and this is with nos finish : This is the client from race_nos2 (c_main.lua) g_Me = getLocalPlayer() g_Root = getRootElement() g_ResRoot = getResourceRootElement() g_ScreenSize = { guiGetScreenSize() } local isEditingPosition = false c_NitroUpgradeID = 1010 g_Nos = 0 c_NosMax = 100 g_IsHoldingFire = false g_NosState = false g_NosStartTick = 0 g_ShowGauge = false g_VehicleModelID = nil g_NosRechargeTimer = nil g_NosRefillState = false g_RefillStartTick = 0 g_Settings = { DisplayGauge = true, GaugePosition = { g_ScreenSize[1] - 318, g_ScreenSize[2] - 126 }, ControlStyle = "normal", SustainOnPickup = true, NosDuration = 40, NosRechargeDelay = 40, NosRechargeDuration = 15, KeepNosOnPlayerWasted = false, KeepNosOnVehicleChange = false }; -- stops the NOS recharge timer function DisposeTimer() g_NosRefillState = false if g_NosRechargeTimer ~= nil then killTimer(g_NosRechargeTimer) g_NosRechargeTimer = nil end end function Dispose() alert("Resetting NOS...") g_Nos = 0 g_NosState = true g_VehicleModelID = nil NosStop() DisposeTimer() end function SaveVehicleNos(vehicle, sync) setElementData(vehicle, "nos", g_Nos, sync or false) end function RestoreVehicleNos() local vehicle = getPedOccupiedVehicle(g_Me) if vehicle then local vehNos = getElementData(vehicle, "nos", false) if vehNos then g_Nos = vehNos end end end function SetupEvents() alert("Re-binding events") removeEventHandler("onClientResourceStop", g_ResRoot, Dispose) removeEventHandler("onClientMapStopping", g_Me, Dispose) removeEventHandler("onClientPlayerFinish", g_Me, Dispose) addEventHandler("onClientResourceStop", g_ResRoot, Dispose) addEventHandler("onClientMapStopping", g_Me, Dispose) addEventHandler("onClientPlayerFinish", g_Me, Dispose) end addEventHandler("onClientResourceStart", g_ResRoot, function() alert("onClientResourceStart") label = guiCreateLabel(0, 0, 200, 40, "Click anywhere on the screen to\nchange gauge position", false) guiSetFont(label, "default-bold-small") guiSetVisible(label, false) loadSettingsFromFile() triggerServerEvent("onRequestNosSettings", g_Me) bindKey("vehicle_fire", "both", ToggleNOS) bindKey("vehicle_secondary_fire", "both", ToggleNOS) g_ShowGauge = true SetupEvents() RestoreVehicleNos() end ) addEventHandler("onClientMapStarting", g_Me, function() alert("onClientMapStarting") g_Nos = 0 g_NosState = false g_VehicleModelID = nil g_NosRefillState = false end ) function NosStart() local vehicle = getPedOccupiedVehicle(g_Me) if not vehicle then return end addVehicleUpgrade(vehicle, c_NitroUpgradeID) setControlState("vehicle_fire", true) g_NosState = true g_NosStartTick = getTickCount() end function NosStop() local vehicle = getPedOccupiedVehicle(g_Me) if not vehicle then return end removeVehicleUpgrade(vehicle, c_NitroUpgradeID) setControlState("vehicle_fire", false) g_NosState = false SaveVehicleNos(vehicle, true) end g_HandleNosControl = { -- hybrid-style NOS : fire once to start NOS, fire again to stop hybrid = function(state) if state == "down" then g_IsHoldingFire = true if not g_NosState then if g_Nos > 0 then NosStart() end else NosStop() end else g_IsHoldingFire = false end end, -- NFS-style NOS : hold fire to start NOS, release to stop nfs = function(state) if state == "down" then g_IsHoldingFire = true if g_Nos > 0 then NosStart() end else g_IsHoldingFire = false NosStop() end end, -- Default game style : press fire to start. normal = function(state) if state == "down" then g_IsHoldingFire = true if not g_NosState then if g_Nos > 0 then NosStart() end end else g_IsHoldingFire = false end end } function ToggleNOS(key, state) if isEditingPosition then return end local vehicle = getPedOccupiedVehicle(g_Me) if not vehicle then return end -- We don't want a passenger to control NOS, to avoid inconsistent states. local driver = getVehicleOccupant(vehicle, 0) if driver ~= g_Me then return end g_HandleNosControl[g_Settings.ControlStyle](state) end addEvent("onClientScreenFadedIn", true) addEventHandler("onClientScreenFadedIn", g_Root, function() SetupEvents() g_ShowGauge = true end ) addEvent("onClientScreenFadedOut", true) addEventHandler("onClientScreenFadedOut", g_Root, function () g_ShowGauge = false end ) function StartNosRechargeTimer() DisposeTimer() if g_Settings.NosRechargeDelay > 0 then alert("Starting gradual refill in "..g_Settings.NosRechargeDelay.." seconds.") g_NosRechargeTimer = setTimer(StartGradualRefillNos, g_Settings.NosRechargeDelay * 1000, 1, c_NosMax) elseif g_Settings.NosRechargeDelay == 0 then alert("Refilling NOS to max.") RefillNos(c_NosMax) end end function ConsumeNos() if not g_NosState then return end local vehicle = getPedOccupiedVehicle(g_Me) if not vehicle then return end local driver = getVehicleOccupant(vehicle, 0) if driver ~= g_Me then return end local nitro = getVehicleUpgradeOnSlot(vehicle, 8) if not (type(nitro) == "number" and nitro ~= 0) then return end local ConsumptionRate = c_NosMax / (FPSAvg * g_Settings.NosDuration) if g_Nos > 0 then --outputDebugString("OnConsume: State="..tostring(g_NosState).."; NOS="..g_Nos.."; Diff="..tostring(getTickCount() - g_NosStartTick).."; Fps Avg="..FPSAvg) g_Nos = g_Nos - ConsumptionRate if getTickCount() - g_NosStartTick > 20000 then NosStart() end Link to comment
HunT Posted October 23, 2011 Author Share Posted October 23, 2011 i Never use The "UP" but i realy need info about the visible nos ever . . .Tnx and sorry 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