require('o_mis') function onStartup(self) myPriority = 0.8 self:SetVar("IconNumber", 1) -- ReRenderNameBillboard -- SetName ---self:SetIconAboveHead{overrideIconLOT = 7561, overrideIsClickable = false , bIconOff = false} MaxSpeed = self:VehicleGetMaxGameSpeed{}.fSpeed MaxBoost = self:VehicleGetMaxGameSpeedWithBoost{}.fSpeed end function onGetPriorityPickListType(self, msg) if ( myPriority > msg.fCurrentPickTypePriority ) then msg.fCurrentPickTypePriority = myPriority msg.ePickType = 14 -- Interactive pick type else msg.ePickType = -1 --print("PickType set to -1") end return msg end function onClientUse(self,msg) myPriority = 0 self:RequestPickTypeUpdate{} UI:SendMessage( "pushGameState", {{"state", "Race" }} ) if GAMEOBJ:GetZoneControlID():GetVar("Set.GameType") == nil then GAMEOBJ:GetTimer():AddTimerWithCancel( 1 , "HideEle", self ) end end function onVehicleUISpeedUpdate(self,msg) print("hello") -- * 2.024 if foo == foo then end UI:SendMessage("RaceGage", {{"mph", tostring(round(msg.fSpeed , 0)) },{"maxSpeed",tostring(MaxSpeed)},{"maxBoost", tostring(MaxBoost)}} ) end function onVehicleUIImaginationUpdate(self,msg) local maxImagin = self:VehicleImaginationGetMax{}.iMaxImagination / 100 local curImagin = msg.iImagination / maxImagin -- UI:SendMessage("RaceBoost", {{"boost", tostring(round(curImagin, 0)) }} ) end function onNotifyClientObject(self, msg) if (msg.name == "updateCarNumber" and msg.param1 > 0) then if self:GetVar("IconNumber") ~= msg.param1 then -- print("SetIcon OFF") self:SetIconAboveHead{iconType = 400 ,bIconOff = true , overrideIsClickable = false } self:SetIconAboveHead{iconType = 400 , overrideIconLOT = msg.param1 , overrideIsClickable = false } self:SetVar("IconNumber", msg.param1 ) end else --print("SetIcon ON") self:SetIconAboveHead{iconType = 400 ,bIconOff = true , overrideIsClickable = false } end end function onTimerDone(self, msg) if msg.name == "HideEle" then UI:SendMessage( "RaceJoin", {{"UI", "hide" }} ) UI:SendMessage( "RaceHud", {{"UI", "hide" }} ) end end