Jump to content

Timer refuses to work


Maxandmov

Recommended Posts

Hello again people. Got another problem here. Again. So I've made a script which would allow you to bury some body, alright? And it doesn't work properly. I assume there is some problem with timer, but I still didn't find a problem. Can you help me? Much appreciate any help provided.

 

As you might see in the script below, I've set timer value and timer still doesn't work...

P.S. The script is full copy, nothing cut.

scn MDMWastelanderDeadSCRIPT

short Responce
short Button
short Timer
short BuryTimerActive
short ControlsTimerActive
short DoOnce

begin GameMode

	if(DoOnce!=1)
		set Responce to 0
		set Button to -1
		set Timer to 0
		set BuryTimerActive to 0
		set ControlsTimerActive to 0
		set DoOnce to 1
		MDMWastelanderDeadRef.KillActor MDMWastelanderDeadRef 3
		MDMWastelanderDeadRef.KillActor MDMWastelanderDeadRef 10
	endif

	if(Responce == 1)
		set Button to GetButtonPressed
		if Button > -1
			set Responce to 0
			set BuryTimerActive to 1
			DisablePlayerControls
			imod FadeToBlackISFX
		endif
	endif

	if(BuryTimerActive == 1)
		if timer < 3
	     	set timer to timer + GetSecondsPassed
	   	else
	     	        set BuryTimerActive to 0
	      	        set timer to 0
	      	        set ControlsTimerActive to 1
			MDMWastelanderDeadRef.disable
			MDMBlood1Ref.disable
			MDMBlood2Ref.disable
			MDMWastelanderGraveRef.enable
			set GameHour to GameHour + 0.5
		endif
	endif

	if(ControlsTimerActive == 1)
		if timer < 2
			set timer to timer + GetSecondsPassed
		else
			set ControlsTimerActive to 0
			set timer to 0
			ShowMessage MDMWastelanderBuriedMSG
			EnablePlayerControls
		endif
	endif

end

begin OnActivate

	if IsActionRef Player
		if(Player.GetItemCount MDMShackKey == 0)
			ShowMessage MDMWastelanderUnownedMSG
		else
			ShowMessage MDMWastelanderOwnedMSG
			set Responce to 1
		endif
	endif

end

Edited by Maxandmov
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...