home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


My zoom script isn't working...

by TimMcD on 07/09/2009 22:32, 5 messages, last message: 07/10/2009 00:29, 936 views, last view: 05/05/2024 02:11

Hey, I'm new to scripting (Much better than what Im used to with Quake3 based games...).

The below script doesn't work. It displays the 'BOO' and then '1' but nothing else, and the fov isn't changed. Any help?

myzoom = [
if ($zoomvar = 1) [
fov 50
echo FOV SHOULD BE 50
zoomvar = 0
echo ZOOMVAR SHOULD BE 0
]
if ($zoomvar = 0) [
fov 100
zoomvar = 1
]
echo BOO!
echo $zoomvar
]

and in my autoexec:

exec myzoom.cfg

bind "MOUSE2" [myzoom]

   Board Index   

#1: ..

by Quin on 07/09/2009 23:21

You should really look at other scripts to see how they work. CubeScript uses hungarian notation.

(= $zoomvar 1) not ($zoomvar = 1)

reply to this message

#2: Re: ..

by TimMcD on 07/09/2009 23:30, refers to #1

It didn't work either way. I made one without a silly if statement (No point, imo)

reply to this message

#3: Re: ..

by SheeEttin on 07/09/2009 23:41, refers to #2

Why use $zoomvar, and not the FOV directly?

reply to this message

#4: Re: ..

by TimMcD on 07/09/2009 23:46, refers to #3

Exactly, thats why I changed it... >_>

reply to this message

#5: ..

by Stealth on 07/10/2009 00:29

first you are setting $zoomvar = 0 , then you check if $zoomvar = 0. It is always going to be 0. Use "else" instead.

reply to this message

   Board Index   


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
53863139 visitors requested 71638247 pages
page created in 0.014 seconds using 10 queries
hosted by Boost Digital