FAQFAQ    Board RulesBoard Rules    SearchSearch    LotteryLottery    RouletteRoulette    UsergroupsUsergroups
     RegisterRegister  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Shop    Log inLog in 
View posts since last visitView your postsView unanswered posts

Can someone explain flt's for me?

 
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding
View previous topic :: View next topic  
Author Message
Rented91951

New Member
New Member


Joined: 15 Jan 2021
Posts: 9
Location: Cairo, Egypt
24 Bank Notes
Items

PostPosted: Fri Mar 19, 2021 1:09 pm    Post subject: Can someone explain flt's for me? Reply with quote

you can do alot of stuff with the flt's commands. I'm so confused by them tho. can someone explain them to me? my discord is Rented#9159 or you can answer here, thanks! Very happy
Back to top
View user's profile Send private message
Muggy

Site Staff
Site Staff


Joined: 05 Jan 2005
Posts: 1011
Location: Sydenham London
278068 Bank Notes
Items

PostPosted: Sat Mar 20, 2021 12:27 pm    Post subject: Can someone explain flt's for me? Reply with quote

Moved to Ask a Modder: Modding
_________________

Back to top
View user's profile Send private message Visit poster's website
Frog_808

New Member
New Member


Joined: 13 May 2020
Posts: 20

55 Bank Notes
Items

PostPosted: Sat Mar 20, 2021 3:12 pm    Post subject: Can someone explain flt's for me? Reply with quote

Hello,

I have written a scripte for you, which I would like to use to briefly explain the function:

As an example, let's take the command "car_getspeed". If we look in the script reference, we see that this command outputs a variable value (speed).
We want to use this value to create a kind of "switch".

Let's take a look at the flt command.

if flt[nn] = xx,yy,zz

nn is the name of the variable. You can name it like you want.

xx is the value that should decide when what should be done.

yy is the name of the label to which the script should jump if the variable has the same value as the number at xx.

zz is the value of the label where the script jumps to if the variable nn has a different value than we entered at xx.

Now our test-script, which should end the game if Tommy drives faster than 60 km/h.

--------------------------------------------
dim_flt 1
dim_act 1

findactor 0, "car"

car_getspeed 0,SPEED

label c
if flt[SPEED] < 60,a,b


label a
//set something you want or keep it clear.
goto c

label b
endofmission

---------------------------------------------------
You see the command "car_getspeed". This command outputs a variable number that we cannot see, but which hides under the name "SPEED". (It does not have to be called SPEED, just an example)

If the car is driving 50 km/h, then the value of "SPEED" is 50.

So we have 50 < 60

This is true, because 50 is smaller than 60.
So the Script will jump to the label a.


If the car is driving 80 km/h, then the value of "SPEED" is 80.

So we have 80 < 60.

But this isn´t true. So the script will jump to the label b.
And at label b there is command "endofmission".


You can also manually assign a value to a variable. This is done with the command "let flt[nn] = xx.

If you want your variable named "0" to have the value 5, then it must be called:
"let flt[0] = 5".

Please let me know if it hasn't helped yet to understand the flt commands.
Back to top
View user's profile Send private message
Rented91951

New Member
New Member


Joined: 15 Jan 2021
Posts: 9
Location: Cairo, Egypt
24 Bank Notes
Items

PostPosted: Tue Mar 23, 2021 6:58 pm    Post subject: Can someone explain flt's for me? Reply with quote

Hey, I sent you a message on your inbox
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

Generation Time: 0.020 | Queries: 18