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


Author Topic: lua code help and how to create a menu that can allow the user to select a ped  (Read 1796 times)

0 Members and 1 Guest are viewing this topic.

Offline AlphaTech

  • LostInSpace
  • Sr. Member
  • ***
  • Posts: 758
  • Gender: Male
  • The name's AlphaTECH, whatca need help with?! :)
    • View Profile
Hey everyone if anyone could help me with some if button codes that would be great some of the buttons in my mod aren't working right. So the part of the menu with the clique functions work perfectly but it is the other part on the bottom that doesn't work right. If anyone can help me with creating a menu that would be awesome and when a player cliques a button they can select certain characters that is all.

F_CreatePlayer = function()
  AreaTransitionXYZ(0,551,-75,12)
  Wait(2000)
  AreaTransitionXYZ(18,-422,378,80)
  PlayerSetHealth(1000)
  AreaOverridePopulation(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
  AreaClearAllPeds(0)
  SoundPlayInteractiveStream("MS_RunningLow.rsm", 0.7)
  SoundSetMidIntensityStream("MS_RunningMid.rsm", 0.60000002384186)
  SoundSetHighIntensityStream("MS_SearchingHigh.rsm", 0.60000002384186)
  DisablePunishmentSystem(false)
  AreaLoadSpecialEntities("Christmas", true)
  AreaLoadSpecialEntities("Rudy1", true)
  AreaLoadSpecialEntities("Rudy2", true)
  AreaLoadSpecialEntities("Rudy3", true)
  AreaLoadSpecialEntities("Miracle", true)
  AreaEnsureSpecialEntitiesAreCreated(true)
  ImportScript("AllowAnimations.lua")
  TextPrintString("White rice with turkey and gravey", 4, 1)
  Wait(4000)
  TextPrintString("Chicken with mac and cheese", 4, 1)
  Wait(4000)
  TextPrintString("Salsa with chips", 4, 1)
  Wait(4000)
  TextPrintString("Chips with dip?", 4, 1)
  Wait(4000)
  TextPrintString("Dips with chips", 4, 1)
  Wait(4000)
  TextPrintString("Never cheat the salsa!", 4, 1)
  Wait(4000)
  TextPrintString("Or you'll be the dip", 4, 1)
  Wait(4000)
  TextPrintString("So a chip stays near the dip or dip you shall be chip", 4, 1)
  Wait(4000)
end

F_CreateCliqueLeaders = function()
TextPrintString("Leaders are not leaders without cliques", 4, 1)
end

F_CliqueSelectorBegin = function()
TextPrintString("PROCESS", 4, 1)
Wait(3000)
TextPrintString("BEGIN", 4, 1)
Wait(6000)
TextPrintString("SYMMETRIC", 4, 1)
Wait(6000)
TextPrintString("STYLE", 4, 1)
Wait(6000)
TextPrintString("MENU", 4, 1)
Wait(6000)
l_0_0 = 1
l_1_2 = 1
end

F_CliqueSelector = function()
if IsButtonBeingReleased(0,0) and l_0_0 == 1 then
CameraFollowPed(gPlayer)
PedSetActionTree(gPlayer, "/Global/Player", "Act/Player.act")
PedSetAITree(gPlayer, "/Global/PlayerAI", "Act/PlayerAI.act")
TextPrintString("GREASERS", 4, 1)
l_0_0 = 2
Wait(1200)
elseif IsButtonBeingReleased(0,0) and l_0_0 == 2 then
CameraFollowPed(gPlayer)
PedSetActionTree(gPlayer, "/Global/Player", "Act/Player.act")
PedSetAITree(gPlayer, "/Global/PlayerAI", "Act/PlayerAI.act")
TextPrintString("JOCKS", 4, 1)
l_0_0 = 3
Wait(1200)
elseif IsButtonBeingReleased(0,0) and l_0_0 == 3 then
CameraFollowPed(gPlayer)
PedSetActionTree(gPlayer, "/Global/Player", "Act/Player.act")
PedSetAITree(gPlayer, "/Global/PlayerAI", "Act/PlayerAI.act")
TextPrintString("DROPOUTS", 4, 1)
l_0_0 = 4
Wait(1200)
elseif IsButtonBeingReleased(0,0) and l_0_0 == 4 then
CameraFollowPed(gPlayer)
PedSetActionTree(gPlayer, "/Global/Player", "Act/Player.act")
PedSetAITree(gPlayer, "/Global/PlayerAI", "Act/PlayerAI.act")
TextPrintString("PREPPIES", 4, 1)
l_0_0 = 5
Wait(1200)
elseif IsButtonBeingReleased(0,0) and l_0_0 == 5 then
CameraFollowPed(gPlayer)
PedSetActionTree(gPlayer, "/Global/Player", "Act/Player.act")
PedSetAITree(gPlayer, "/Global/PlayerAI", "Act/PlayerAI.act")
TextPrintString("BULLIES", 4, 1)
Wait(1200)
l_0_0 = 6
elseif IsButtonBeingReleased(0,0) and l_0_0 == 6 then
CameraFollowPed(gPlayer)
PedSetActionTree(gPlayer, "/Global/Player", "Act/Player.act")
PedSetAITree(gPlayer, "/Global/PlayerAI", "Act/PlayerAI.act")
TextPrintString("NERDS", 4, 1)
l_0_0 = 1
Wait(1200)
repeat
Wait(0)
until IsButtonBeingPressed(8,0)
end
end

F_CliqueSelector2 = function()
if IsButtonBeingReleased(1,0) and l_0_0 == 1 then
CameraFollowPed(gPlayer)
PedSetActionTree(gPlayer, "/Global/Player", "Act/Player.act")
PedSetAITree(gPlayer, "/Global/PlayerAI", "Act/PlayerAI.act")
TextPrintString("GREASERS", 4, 1)
l_0_0 = 2
Wait(1200)
elseif IsButtonBeingReleased(1,0) and l_0_0 == 2 then
CameraFollowPed(gPlayer)
PedSetActionTree(gPlayer, "/Global/Player", "Act/Player.act")
PedSetAITree(gPlayer, "/Global/PlayerAI", "Act/PlayerAI.act")
TextPrintString("JOCKS", 4, 1)
l_0_0 = 3
Wait(1200)
elseif IsButtonBeingReleased(1,0) and l_0_0 == 3 then
CameraFollowPed(gPlayer)
PedSetActionTree(gPlayer, "/Global/Player", "Act/Player.act")
PedSetAITree(gPlayer, "/Global/PlayerAI", "Act/PlayerAI.act")
TextPrintString("DROPOUTS", 4, 1)
l_0_0 = 4
Wait(1200)
elseif IsButtonBeingReleased(1,0) and l_0_0 == 4 then
CameraFollowPed(gPlayer)
PedSetActionTree(gPlayer, "/Global/Player", "Act/Player.act")
PedSetAITree(gPlayer, "/Global/PlayerAI", "Act/PlayerAI.act")
TextPrintString("PREPPIES", 4, 1)
l_0_0 = 5
Wait(1200)
elseif IsButtonBeingReleased(1,0) and l_0_0 == 5 then
CameraFollowPed(gPlayer)
PedSetActionTree(gPlayer, "/Global/Player", "Act/Player.act")
PedSetAITree(gPlayer, "/Global/PlayerAI", "Act/PlayerAI.act")
TextPrintString("BULLIES", 4, 1)
l_0_0 = 6
Wait(1200)
elseif IsButtonBeingReleased(1,0) and l_0_0 == 6 then
CameraFollowPed(gPlayer)
PedSetActionTree(gPlayer, "/Global/Player", "Act/Player.act")
PedSetAITree(gPlayer, "/Global/PlayerAI", "Act/PlayerAI.act")
TextPrintString("NERDS", 4, 1)
l_0_0 = 1
Wait(1200)

repeat
Wait(0)
until IsButtonBeingPressed(8,0)
end
end
(This part of the menu isn't working correctly, I need help with this part)
F_CharacterMenuRun = function()
if IsButtonBeingReleased(15,0) and l_1_2 == 1 then
AreaTransitionXYZ(18,-422,378,80)
PlayerSetHealth(1000)
AreaOverridePopulation(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
AreaClearAllPeds(0)
SoundPlayInteractiveStream("MS_RunningLow.rsm", 0.7)
SoundSetMidIntensityStream("MS_RunningMid.rsm", 0.60000002384186)
SoundSetHighIntensityStream("MS_SearchingHigh.rsm", 0.60000002384186)
DisablePunishmentSystem(false)
(I press the button and it does nothing)
ImportScript("TurkeySalsaChipsandDip.lua")
F_SelectBegin()
F_CliqueSelector3()
F_CliqueSelector4()
F_BullyTeamSelected()
repeat
Wait(0)
until IsButtonBeingPressed(15,0)
end
end

main5 = function()
  repeat
  F_CharacterMenuRun()
  Wait(0)
  until IsButtonBeingReleased(15,0)
end

main3 = function()
  CreateThread("main5")
  repeat
  F_CliqueSelector2()
  Wait(0)
  until IsButtonBeingReleased(8,0)
end

main2 = function()
  CreateThread("main3")
  repeat
  F_CliqueSelector()
  Wait(0)
  until IsButtonBeingReleased(8,0)
end

main = function()
  F_CreatePlayer()
  F_CreateCliqueLeaders()
  F_CliqueSelectorBegin()
  CreateThread("main2")
  repeat
  F_PlayerKnockedOut()
  F_PlayerKnockedOut2()
  MissionCleanup()
  Wait(0)
  until PedIsDead(gPlayer)
end
« Last Edit: November 29, 2014, 08:55:01 PM by LostInSpace »