Bully-Board

Bully Modding Section => Modding Questions/Help => Modding Questions/Help Archives => Topic started by: luizd90 on January 14, 2014, 10:55:32 AM

Title: how to return to normal game?
Post by: luizd90 on January 14, 2014, 10:55:32 AM
I tried
Code: [Select]
MissionCleanup = function()
 if PedIsDead(Bully01) then
 TextPrint("M_PASS", 3, 0) Wait(10000) MissionSucceed()
 if PedIsDead(gPlayer) then
 TextPrint("M_FAIL", 3, 0) Wait(10000) MissionFail()
end
end
end

then

Code: [Select]
MissionSetup = function() -- basic mission setup function which is used in almost all bully scripts
  local l_1_0 = 270 -- X coords
  local l_1_1 = -110 -- Y coords
  local l_1_2 = 6.4000000953674 -- Z coords
  PlayerSetHealth(200) -- gives the player 200 health
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)

  Bully01 = PedCreateXYZ(99, l_1_0 + 1, l_1_1 + 1, l_1_2 + 1)
   if PedIsDead(Bully01) then
 TextPrint("M_PASS", 3, 0) Wait(10000) MissionSucceed()
 end
 if PedIsDead(gPlayer) then
 TextPrint("M_FAIL", 3, 0) Wait(10000) MissionFail()
  end
end

and did not complete the mission
not back to normal game
sorry for bad english
Title: Re: how to return to normal game?
Post by: BullworthChampion on January 14, 2014, 01:42:13 PM
IMA USE THIS!
Title: Re: how to return to normal game?
Post by: c00ld0c26 on January 14, 2014, 05:35:06 PM
Code: [Select]
MissionSetup = function() -- basic mission setup function which is used in almost all bully scripts
          l_2_0 = 1
          l_2_1 = 1
          MissionRunning = 1
  local l_1_0 = 270 -- X coords
  local l_1_1 = -110 -- Y coords
  local l_1_2 = 6.4000000953674 -- Z coords
  PlayerSetHealth(200) -- gives the player 200 health
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)

  Bully01 = PedCreateXYZ(99, l_1_0 + 1, l_1_1 + 1, l_1_2 + 1)
   if PedIsDead(Bully01) then
 TextPrint("M_PASS", 3, 0) Wait(10000) MissionSucceed()
 end
 if PedIsDead(gPlayer) then
 TextPrint("M_FAIL", 3, 0) Wait(10000) MissionFail()
  end
end

Fix :

Code: [Select]
MissionSetup = function() -- basic mission setup function which is used in almost all bully scripts
  local l_1_0 = 270 -- X coords
  local l_1_1 = -110 -- Y coords
  local l_1_2 = 6.4000000953674 -- Z coords
  PlayerSetHealth(200) -- gives the player 200 health
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)

  Bully01 = PedCreateXYZ(99, l_1_0 + 1, l_1_1 + 1, l_1_2 + 1)
end

Condition = function()
if PedGetHealth(Bully01) <= 0 then
l_2_0 = 2
elseif PedGetHealth(gPlayer) <= 0 then
l_2_1 = 2
end
end


MissionEnd = function()
if l_2_0 ~= 1 then
 TextPrint("M_PASS", 3, 0)
 Wait(10000)
MissionSucceed()
MissionRunning = 2
elseif l_2_1 ~= 1 then
 TextPrint("M_FAIL", 3, 0)
 Wait(10000)
MissionFail()
MissionRunning = 2
end
end

main = function()
repeat
condition()
MissionEnd()
Wait(0)
until MissionRunning == 2
end
end
Title: Re: how to return to normal game?
Post by: BullworthChampion on January 15, 2014, 09:04:56 PM
IMA USE THIS TOO!
Title: Re: how to return to normal game?
Post by: c00ld0c26 on January 15, 2014, 11:56:43 PM
Made a small fix at the main = function() at the post above.
Now I believe it works.
Title: Re: how to return to normal game?
Post by: luizd90 on January 16, 2014, 06:25:39 AM
I was a day without internet, sorry
thank you :D :D
Title: Re: how to return to normal game?
Post by: BullworthChampion on January 16, 2014, 08:46:14 AM
mmhmmm