Forum

> > CS2D > Scripts > Trying to modify conrols
Forums overviewCS2D overview Scripts overviewLog in to reply

English Trying to modify conrols

1 reply
To the start Previous 1 Next To the start

old Trying to modify conrols

SashaG
User Off Offline

Quote
Hello. I just starting in Lua and need your help. I write a script and it doesn't work.

I want to switch weapons fast by mousewheel.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
bind "mwheelup" "cw(1)"
bind "mwheeldown" "cw(-1)"

cwSN = 10;

function cw(IoD)
 cwSN = cwSN + IoD
 eSN = cwSN % 10
 eSNd = (cwSN % 10) + 10
 if (cwSN % 10) >= 0
  parse("menuselect "..eSN)
 if (cwSN % 10) < 0
   parse("menuselect "..eSNd)
 return 0
end

The code is bad, i know, but i don't know how to realize it yet...

Console says, that unknown command "cwsn"...
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview