9
« on: April 05, 2016, 03:00:28 PM »
@Shrimp Can I actually finish scripting the mission Jesus Fucking Christ.
@AWiseMelson Fixed your spawn point the other one didn't show the first time.
[codeMissionSetup = function()
-- (0) is the area code for the main map, all area codes are placed here.
PlayerSetHealth(800)
AreaTransitionXYZ(0, 477.5798, -107.3748, 16.6911)
PedSetUniqueModelStatus(29, -1)
SoundPlayInteractiveStream("MS_BikeFunLow.rsm", 0.5)
SoundSetMidIntensityStream("MS_BikeFunMid.rsm", 0.60000002384186)
SoundSetHighIntensityStream("MS_BikeFunHigh.rsm", 0.60000002384186)
Norton = PedCreateXYZ(29,503.7057,-112.5930,5.1166)
TestBlip = BlipAddXYZ(503.7057,-112.5930,5.1166,0) --(0 is the small Yellow X appearing on the map) (The blip's location should always be the same as the objective location not any wear else. If you script the blip in another location you may mess up player's in finding certain things.)
TextPrintString("Follow the X on the map to go to the location!",4,1)
Wait(3000)
MissionObjective()
end
MissionObjective = function()
local x,y = 503,-112 --(Created by Daboss, can be used to make a certain instance.)
local r1 = x + 3.5
local r2 = y + 3.5
local r3 = x - 3.5
local r4 = y - 3.5
repeat
Wait(0)
until PedInRectangle(gPlayer,r1,r2,r3,r4)
BlipRemove(TestBlip)
TextPrintString("Jimmy: Norton! Where's that punk Johnny!?", 4, 1)
TextPrintString("Norton: Sorry, Hopkins, Johnny couldn't make it",4.5, 1)
TextPrintString("Jimmy: Well then I guess there'll be one more grease ball hurting after this!", 5, 1)
PedSetPedToTypeAttitude(Norton, 13, 0)
PlayerSetControl(1)
TextPrintString("Beat up Norton.", 3, 1)
IsNortonDead = false
end
MissionObjectiveFinal = function()
if PedIsDead(Norton) and IsNortonDead == false then
IsNortonDead = true
TextPrintString("Great you've defeated!",4,1)
Wait(3000)
SoundPlayMissionEndMusic(true, 8)
MissionSucceed(true, false, false)
CameraSetWidescreen(true)
Wait(4000)
CameraFade(500, 0)
AreaTransitionXYZ(14, -501.4, 316.11, 31.5)
Wait(500)
CameraAllowChange(true)
SoundSetAudioFocusPlayer()
CameraReturnToPlayer()
CameraReset()
CameraSetWidescreen(false)
PlayerSetControl(1)
end
if PedIsDead(Norton) and IsNortonDead == false then
IsNortonDead = true
TextPrintString("Great you've defeated!",4,1)
Wait(3000)
SoundPlayMissionEndMusic(true, 8)
MissionSucceed(true, false, false)
CameraSetWidescreen(true)
Wait(4000)
CameraFade(500, 0)
AreaTransitionXYZ(14, -501.4, 316.11, 31.5)
Wait(500)
CameraAllowChange(true)
SoundSetAudioFocusPlayer()
CameraReturnToPlayer()
CameraReset()
CameraSetWidescreen(false)
PlayerSetControl(1)
end
end
F_PlayerFail = function()
if PedIsDead(gPlayer) then
SoundPlayMissionEndMusic(true, 6)
MissionFail(true, false, false)
Wait(4000)
CameraSetWidescreen(true)
CameraFade(700, 0)
AreaTransitionXYZ(14, -501.4, 316.11, 31.5)
Wait(500)
CameraAllowChange(true)
SoundSetAudioFocusPlayer()
CameraReturnToPlayer()
CameraReset()
CameraSetWidescreen(false)
PlayerSetControl(1)
end
if PedIsDead(gPlayer) then
SoundPlayMissionEndMusic(true, 6)
MissionFail(true, false, false)
Wait(4000)
CameraSetWidescreen(true)
CameraFade(700, 0)
AreaTransitionXYZ(14, -501.4, 316.11, 31.5)
Wait(500)
CameraAllowChange(true)
SoundSetAudioFocusPlayer()
CameraReturnToPlayer()
CameraReset()
CameraSetWidescreen(false)
PlayerSetControl(1)
end
end
F_LoadAnim = function()
LoadAnimationGroup("Cheer_Cool2")
LoadAnimationGroup("NPC_Adult")
LoadAnimationGroup("TSGate")
LoadAnimationGroup("SCgrdoor")
LoadAnimationGroup("Sbarels1")
LoadAnimationGroup("Area_School")
LoadAnimationGroup("Px_Rail")
LoadAnimationGroup("DO_Grap")
LoadAnimationGroup("1_07_SaveBucky")
LoadAnimationGroup("TSGate")
LoadAnimationGroup("F_Nerds")
LoadAnimationGroup("Hang_Jock")
LoadAnimationGroup("NPC_AggroTaunt")
LoadAnimationGroup("Hang_Talking")
LoadAnimationGroup("1_07_Sk8Board")
Load("Act/Conv/1_07.act")
LoadActionTree("Act/Props/SBarels1.act")
LoadActionTree("Act/Props/barrelLad.act")
LoadActionTree("Act/Conv/1_03.act")
LoadActionTree("Act/Anim/1_03_Davis.act")
end
F_CleanUpAnim = function() --(Not necessary to use the mission will work either way.)
UnLoadAnimationGroup("Cheer_Cool2")
UnLoadAnimationGroup("NPC_Adult")
UnLoadAnimationGroup("TSGate")
UnLoadAnimationGroup("SCgrdoor")
UnLoadAnimationGroup("Sbarels1")
UnLoadAnimationGroup("Area_School")
UnLoadAnimationGroup("Px_Rail")
UnLoadAnimationGroup("DO_Grap")
UnLoadAnimationGroup("1_07_SaveBucky")
UnLoadAnimationGroup("TSGate")
UnLoadAnimationGroup("F_Nerds")
UnLoadAnimationGroup("Hang_Jock")
UnLoadAnimationGroup("NPC_AggroTaunt")
UnLoadAnimationGroup("Hang_Talking")
UnLoadAnimationGroup("1_07_Sk8Board")
collectgarbage()
end
main = function()
F_LoadAnim()
repeat
F_PlayerFail()
MissionObjectiveFinal()
Wait(0)
until not Alive
end]