News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..


Author Topic: Selector themes  (Read 2398 times)

0 Members and 1 Guest are viewing this topic.

Offline boyser

  • Wazzzuuupppp
  • Full Member
  • ***
  • Posts: 176
  • Gender: Male
  • THE REAL G IS ME
    • View Profile
Selector themes
« on: January 29, 2016, 02:17:48 PM »
Sorry for asking alot of questions in a short period of time but can someone tell me how to make my selector look like the one in not another selector?

Offline bullymodder74

  • Jr. Member
  • **
  • Posts: 51
  • Gender: Male
  • Bully Mods
    • View Profile
Re: Selector themes
« Reply #1 on: January 29, 2016, 03:19:36 PM »
Sorry for asking alot of questions in a short period of time but can someone tell me how to make my selector look like the one in not another selector?


 You will have to make a menu revises the tutorial of Unknown Soldier

Offline boyser

  • Wazzzuuupppp
  • Full Member
  • ***
  • Posts: 176
  • Gender: Male
  • THE REAL G IS ME
    • View Profile
Re: Selector themes
« Reply #2 on: January 30, 2016, 09:56:13 AM »
His menu tutorial doesn't show you how you can make menu's look differently it only tells you how to setup a basic menu

Offline bullymodder74

  • Jr. Member
  • **
  • Posts: 51
  • Gender: Male
  • Bully Mods
    • View Profile
Re: Selector themes
« Reply #3 on: January 30, 2016, 10:12:15 AM »
His menu tutorial doesn't show you how you can make menu's look differently it only tells you how to setup a basic menu



Code: [Select]
function f_strafe()
 if IsButtonPressed(10,0) and IsMoving() and not isStrafing and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
  PedSetActionNode(gPlayer,"/Global/J_Grappler_A/Default_KEY/ExecuteNodes/LocomotionOverride/Combat/CombatBasic","Act/Anim/J_Grappler_A.act")
  isStrafing = true
 elseif (not IsButtonPressed(10,0) or not IsMoving()) and isStrafing and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
  PedSetActionTree(gPlayer,"/Global/J_Grappler_A", "Act/Anim/J_Grappler_A.act")
  isStrafing = false
 elseif isStrafing then
  local x,y,z = PedGetPosXYZ(PedGetTargetPed())
  PedFaceXYZ(gPlayer,x,y,z)
 end
end

IsMoving = function()
 local s = 0.08
 return GetStickValue(16,0) > s or GetStickValue(16,0) < -s or GetStickValue(17,0) > s or GetStickValue(17,0) < -s
end


Offline boyser

  • Wazzzuuupppp
  • Full Member
  • ***
  • Posts: 176
  • Gender: Male
  • THE REAL G IS ME
    • View Profile
Re: Selector themes
« Reply #4 on: January 30, 2016, 10:51:37 AM »
His menu tutorial doesn't show you how you can make menu's look differently it only tells you how to setup a basic menu



Code: [Select]
function f_strafe()
 if IsButtonPressed(10,0) and IsMoving() and not isStrafing and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
  PedSetActionNode(gPlayer,"/Global/J_Grappler_A/Default_KEY/ExecuteNodes/LocomotionOverride/Combat/CombatBasic","Act/Anim/J_Grappler_A.act")
  isStrafing = true
 elseif (not IsButtonPressed(10,0) or not IsMoving()) and isStrafing and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
  PedSetActionTree(gPlayer,"/Global/J_Grappler_A", "Act/Anim/J_Grappler_A.act")
  isStrafing = false
 elseif isStrafing then
  local x,y,z = PedGetPosXYZ(PedGetTargetPed())
  PedFaceXYZ(gPlayer,x,y,z)
 end
end

IsMoving = function()
 local s = 0.08
 return GetStickValue(16,0) > s or GetStickValue(16,0) < -s or GetStickValue(17,0) > s or GetStickValue(17,0) < -s
end
What is this???

Offline DaBOSS54320

  • Hero Member
  • ****
  • Posts: 3,398
  • Gender: Female
    • View Profile
Re: Selector themes
« Reply #5 on: January 30, 2016, 12:44:52 PM »
You just need to be a bit creative with how you print your text. Here's a simple example where you're just selecting through a bunch of strings.

Code: [Select]
function MissionSetup()
  AreaTransitionXYZ(0,270,-110,6)
end

function MissionCleanup()
 
end

function main()
  -- Setup variables:
  local blip = BlipAddXYZ(270,-105,6,0,1,1)
  local menu = {"menu item1","spudgun","dildo","RPG-7","Gary Smith","Pete","Damon","Sheldonator"}
  local s = 1
 
  -- Main loop:
  while true do
    if PedIsInAreaXYZ(gPlayer,270,-115,6,0.8) then -- if player is in blip
      TextPrintString("Press \b to use menu",0,2) -- print prompt for blip
      Wait(0) -- suspsend script for 1 frame so text can be printed and buttons can be processed
      if IsButtonBeingPressed(9,0) then
        -- Disable player control so he doesn't move:
        PlayerSetControl(0)
       
        -- Menu loop:
        repeat
          -- Show text:
          local text = "MENU\n\n" -- the title and 2 linebreaks
          for i = s - 2,s + 2 do -- for loop with i starting 2 before our current selection (s) and ending 2 after
            if i == s then -- if i is our current selection, add a > to show that this menu option is currently selected
              text = text..">"
            end
            if i >= 1 and i <= table.getn(menu) then -- if i is in between 1 and the size of our table, use i to get a menu option
              text = text..menu[i]
            end
            text = text.."\n" -- add a linebreak, even if there was no text to show a linebreak still keeps everything positioned properly
          end
          TextPrintString(text,0,1) -- 0 time means 1 frame which is all we need
          Wait(0) -- this suspends the script for one single frame, and during this frame the text above will be printed, and the game will process button preses which is important before our script processes the buttons
         
          -- Process buttons:
          if IsButtonBeingPressed(2,0) then
            s = s - 1
            if s < 1 then
              s = table.getn(menu)
            end
          elseif IsButtonBeingPressed(3,0) then
            s = s + 1
            if s > table.getn(menu) then
              s = 1
            end
          elseif IsButtonBeingPressed(7,0) then
            TextPrintString("You selected "..menu[s],3,1)
            Wait(3000)
          end
        until IsButtonBeingPressed(8,0) -- end the loop when jump is pressed
       
        -- Regain control:
        PlayerSetControl(1)
      end
    else
      Wait(0) -- if the player wasn't in the blip, then we should still wait so that the game doesn't crash from the script never waiting
    end
  end
end