Jump to content

Adding/Changing The Day Of Dirt Track Days on Main.scm [Classic]


ArmanCan

Recommended Posts

Hello people 🙂

 

I'm here with another request..i've tried so many approaches but no luck and my request is so annoyingly simple... I WANT TO START THIS DIRT TRACK ON FRIDAY(And off course Monday and Wednesday also).. How can i do it? I'm posting the mission script "KICKS" here..  Any help will be appreciated.. 🙂🙏

 

:KICKS
script_name 'KICKS' 

:KICKS_11
wait 0 // $DEFAULT_WAIT_TIME 
if 
  $ONMISSION == 0 
jf @KICKS_271 
if 
  Player.Defined($PLAYER_CHAR)
jf @KICKS_271 
if 
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere $1742 $1743 $1744 radius 1.4 1.8 1.5 on_foot 
jf @KICKS_271 
if 
  Player.Controllable($PLAYER_CHAR)
jf @KICKS_271 
07D0: $WEEKDAY = weekday 
if or
  $WEEKDAY == 0 
  $WEEKDAY == 2 
  $WEEKDAY == 4 
jf @KICKS_243 
0652: $STAT_DRIVING_SKILL = integer_stat 229 
if 
  $STAT_DRIVING_SKILL > 199 
jf @KICKS_220 
00BA: show_text_styled GXT 'STAD_01' time 1000 style 2  // Dirt Track
LITCAS_267()
04AE: $RACE_INDEX = 26 // = constant 
$CUSTOM_TOURNAMENT_FLAG = 0 
start_mission 35  // Race Tournament / 8-track / Dirt Track
jump @KICKS_236 

:KICKS_220
00BC: show_text_highpriority GXT 'STATBIK' time 500 flag 1  // ~s~Your ~h~bike skill ~s~is not high enough to enter this race.

:KICKS_236
jump @KICKS_271 

:KICKS_243
00BA: show_text_styled GXT 'STAD_02' time 1000 style 2  // Kickstart
LITCAS_267()
start_mission 129  // Arena Mission: Kickstart

:KICKS_271
jump @KICKS_11

 

Thanks, take care of yourself and have a nice weekend 😉

Edited by ArmanCan
Link to comment
Share on other sites

5 hours ago, ArmanCan said:
if or
  $WEEKDAY == 0 
  $WEEKDAY == 2 
  $WEEKDAY == 4 
jf @KICKS_243

As far as I understand - this condition means that 

"If the day is not 0,2 or 4 - then start Kickstart".

So, you need to figure out what day is weekday 0 and change accordingly. 
Let's presume that Monday is 0.

So, if we want to start Kickstart on Monday than we have to delete $WEEKDAY == 0 or replace it to $WEEKDAY == 1 (Kickstart won't start on Tuesday).

Link to comment
Share on other sites

6 hours ago, vladvo said:

"If the day is not 0,2 or 4 - then start Kickstart".

let's breaks this down little bit..

 

- Kickstart starts on Tuesday, Thursday, Friday, Saturday and Sunday..

- Dirt Track only starts on Monday and Wednesday..

 

According to storyline CJ arrives to Los Santos on WEDNESDAY and when we look at the stats menu "day zero" is actually wednesday but let's agree your opinion and assume that "Monday is 0"..

This condition is still wrong.. even our opinions..if i want to start Kickstart normally i would code like this..

if or
  $WEEKDAY == 0 
  $WEEKDAY == 2
jf @KICKS_243

but why they added "$WEEKDAY ==4" into the code block?  Is it something like "Odd/Even Number" thing? It's definitely annoying 🙁

Link to comment
Share on other sites

4 hours ago, ArmanCan said:

Is it something like "Odd/Even Number" thing?

https://library.sannybuilder.com/#/sa/default/07D0

 

@ArmanCan

05A9: s$PLANES_DayNames[1] = 'PLA_9' // s$  // SUNDAY
05A9: s$PLANES_DayNames[2] = 'PLA_3' // s$  // MONDAY
05A9: s$PLANES_DayNames[3] = 'PLA_4' // s$  // TUESDAY
05A9: s$PLANES_DayNames[4] = 'PLA_5' // s$  // WEDNESDAY
05A9: s$PLANES_DayNames[5] = 'PLA_6' // s$  // THURSDAY
05A9: s$PLANES_DayNames[6] = 'PLA_7' // s$  // FRIDAY
05A9: s$PLANES_DayNames[7] = 'PLA_8' // s$  // SATURDAY
$PLANES_Weekday = 0 
--------
if 
  $PLANES_Weekday == 7 
jf @PLANES_392

Weekday is mentioned several time through the script. Code above (from main.scm) kinda proves that the numbers should be

1 to 7, where weekday 1 is Sunday. What is weekday 0 ? I don't know. Maybe something for debugging purposes. 

Sunday == 1

Monday == 2

Tuesday == 3

Wednesday == 4

Thursday == 5

Friday == 6

Saturday == 7

 

So, to start Kickstart on Mon, Wed, Fri - we need to specify on which weekdays it would not start.

if or
$WEEKDAY == 0 //try with it first
$WEEKDAY == 1
$WEEKDAY == 3
$WEEKDAY == 5
$WEEKDAY == 7
jf @KICKS_243

 

Edited by vladvo
Update
Link to comment
Share on other sites

5 hours ago, vladvo said:

So, to start Kickstart on Mon, Wed, Fri - we need to specify on which weekdays it would not start.

thank you so much for the additional informations.. well no.. my actual intention is to start the Dirt Track more frequently.. it's kinda nonsense to wait for the Monday or Wednesday to start this mission.. I may also try to remove the "day conditions" and put the "hour conditions" instead 😉

  

5 hours ago, vladvo said:

What is weekday 0 ? I don't know. Maybe something for debugging purposes. 

Actually hold up.. if we ignore "$WEEKDAY == 0" all i have to do is add "$WEEKDAY ==6" to the end of the code block.. i will try both of them.. thanks again..😃

Edited by ArmanCan
Link to comment
Share on other sites

SUNDAY = 1
MONDAY = 2
TUESDAY = 3
WEDNESDAY = 4
THURSDAY = 5
FRIDAY = 6
SATURDAY = 7

 

just write a simple script that shows on screen what opcode 07D0: returns, press TAB ingame and watch to the info

 

{$CLEO .cs}
thread 'weekday'

{
SUNDAY = 1
MONDAY = 2
TUESDAY = 3
WEDNESDAY = 4
THURSDAY = 5
FRIDAY = 6
SATURDAY = 7
}

while true
    wait 0
    07D0: 5@ = weekday 
    03F0: enable_text_draw 1
    045A: text_draw_1number  50.0  300.0 'NUMBER' 5@
    if
        0AB0:   key_pressed 8// 	backspace key
    then
        088E: set_next_day 
        wait 500
    end
end 

 

0 = unused

$PLANES_Weekday = 0 is a simple var declaration at script beginn and doesn´t mean anything

 

 

 

On 8/5/2023 at 9:04 PM, ArmanCan said:

 I WANT TO START THIS DIRT TRACK ON FRIDAY(And off course Monday and Wednesday also)..

if or
  $WEEKDAY == 2
  $WEEKDAY == 4
  $WEEKDAY == 6
jf @KICKS_243// start Kickstart
start_mission 35  // Race Tournament / 8-track / Dirt Track

 

:KICKS
script_name 'KICKS' 
{
SUNDAY = 1
MONDAY = 2
TUESDAY = 3
WEDNESDAY = 4
THURSDAY = 5
FRIDAY = 6
SATURDAY = 7
}
:KICKS_11
wait 0 // $DEFAULT_WAIT_TIME 
if 
  $ONMISSION == 0 
jf @KICKS_11 
if 
  Player.Defined($PLAYER_CHAR)
jf @KICKS_11 
if 
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere $1742 $1743 $1744 radius 1.4 1.8 1.5 on_foot 
jf @KICKS_11 
if 
  Player.Controllable($PLAYER_CHAR)
jf @KICKS_11 
07D0: $WEEKDAY = weekday 
if or
  $WEEKDAY == 2 
  $WEEKDAY == 4 
  $WEEKDAY == 6 
jf @KICKS_243// start Kickstart 

0652: $STAT_DRIVING_SKILL = integer_stat 229 
if 
  $STAT_DRIVING_SKILL > 199 
jf @KICKS_220 
00BA: show_text_styled GXT 'STAD_01' time 1000 style 2  // Dirt Track
LITCAS_267()
04AE: $RACE_INDEX = 26 // = constant 
$CUSTOM_TOURNAMENT_FLAG = 0 
start_mission 35  // Race Tournament / 8-track / Dirt Track
jump @KICKS_11 

:KICKS_220
00BC: show_text_highpriority GXT 'STATBIK' time 500 flag 1  // ~s~Your ~h~bike skill ~s~is not high enough to enter this race.
jump @KICKS_11 

:KICKS_243// start Kickstart
00BA: show_text_styled GXT 'STAD_02' time 1000 style 2  // Kickstart
LITCAS_267()
start_mission 129  // Arena Mission: Kickstart
jump @KICKS_11

 

Edited by ZAZ
Link to comment
Share on other sites

1 hour ago, ZAZ said:
if or
  $WEEKDAY == 2 
  $WEEKDAY == 4 
  $WEEKDAY == 6 
jf @KICKS_243// start Kickstart 

How is that supposed to work out ? There is "jump_if_false @kicks_243".

It means that if $weekday is not 2,4,6 - then start Kickstart. He needs the opposite.

if or
$WEEKDAY == 1
$WEEKDAY == 3
$WEEKDAY == 5
$WEEKDAY == 7
jf @KICKS_243
Link to comment
Share on other sites

4 hours ago, vladvo said:

How is that supposed to work out ? There is "jump_if_false @kicks_243".

It means that if $weekday is not 2,4,6 - then start Kickstart.

that`s right, else_jump @kicks_243 leads to start Kickstart

 

Quote

He needs the opposite.

No, it just need to pass the check instead the else_jump

But then it also need to pass the check for $STAT_DRIVING_SKILL

 

If the checks for weekday and $STAT_DRIVING_SKILL will be passed,

then it starts  DIRT TRACK

 

 

07D0: $WEEKDAY = weekday 
if or
  $WEEKDAY == 2 
  $WEEKDAY == 4 
  $WEEKDAY == 6 
jf @KICKS_243// ----> start Kickstart 
	|
	|
	V
0652: $STAT_DRIVING_SKILL = integer_stat 229 
if 
  $STAT_DRIVING_SKILL > 199 
jf @KICKS_220
	|
	|
	V
00BA: show_text_styled GXT 'STAD_01' time 1000 style 2  // Dirt Track
LITCAS_267()
04AE: $RACE_INDEX = 26 // = constant 
$CUSTOM_TOURNAMENT_FLAG = 0
	|
	|
	V
start_mission 35  // Race Tournament / 8-track / Dirt Track

 

 

Link to comment
Share on other sites

Ugh. I was not paying enough attention to what I read. I was sure he wants Kickstart more often. Must be the heat.

Link to comment
Share on other sites

2 hours ago, vladvo said:

Must be the heat.

yeah.. the heat is currently playing with everyone's mind.. i was angry until today but it seems the heat is getting back to normal 🙂 stay hydrated and try to pour some cold water to your head (not only your face) or take a shower everyday 😉

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.