SRL Archive - OSR Help

Need help with settings


King

2013-04-05 13:47:28

Im trying to set user settings at the top of my script, my true and false settings dont work when I use them in cases,

Such as:


const
Prayer := true;


If prayer then
begin
WithdrawPots;
end;

The above does not do anything, how should I declare and use my settings? Never had issues before this.

Ashaman88

2013-04-05 14:17:22

Well prayer is false…so why would it do anything?

King

2013-04-05 14:35:33

From: Ashaman88
Well prayer is false…so why would it do anything?


Sorry, meant to make it true. When it is true it doesn't do anything either :p

http://villavu.com/forum/showthread.php?t=100541 <—- script I'm using them in. It just ignores it whether true or false/:

WeBot4u

2013-04-05 16:45:21

I think you need to have the capital letter P with Prayer not prayer, sorry if im wrong still a roockie.

The Mayor

2013-04-05 16:46:57

From: SRLKing
Im trying to set user settings at the top of my script, my true and false settings dont work when I use them in cases,

Such as:


const
Prayer := true;


If prayer then
begin
WithdrawPots;
end;

The above does not do anything, how should I declare and use my settings? Never had issues before this.


Try
Prayer = True;

rather than

Prayer := True;

superuser

2013-04-05 16:51:19

From: SRLKing
Im trying to set user settings at the top of my script, my true and false settings dont work when I use them in cases,

Such as:


const
Prayer := true;


If prayer then
begin
WithdrawPots;
end;

The above does not do anything, how should I declare and use my settings? Never had issues before this.


const
PRAYER = true;

if PRAYER = true then // Or .. prayer = false
WithdrawPots();

NKN

2013-04-05 18:26:03

For const, you use a equal sign, not a :=

superuser

2013-04-05 18:38:23

From: NKN
For const, you use a equal sign, not a :=


No wonder you've got 2.4k posts :D Why post that when The Mayor already said the exactly same thing couple of posts up?

NKN

2013-04-05 18:44:22

From: superuser
No wonder you've got 2.4k posts :D Why post that when The Mayor already said the exactly same thing couple of posts up?

I don't really read the comments, I just post an answer. ;)

Been a long day.

King

2013-04-05 21:36:35

From: The Mayor
Try
Prayer = True;

rather than

Prayer := True;


I'm face palming pretty hard right now >.<

The Mayor

2013-04-05 23:42:33

From: SRLKing
I'm face palming pretty hard right now >.<


At least you won't make that mistake again :)

King

2013-04-05 23:45:19

From: The Mayor
At least you won't make that mistake again :)



I need to stop coding at 3am XD

Ian

2013-04-06 00:08:14

From: superuser

const
PRAYER = true;

if PRAYER = true then // Or .. prayer = false
WithdrawPots();


You can just do

const
PRAYER = true;

if PRAYER then // Or .. not PRAYER
WithdrawPots();
:)