Forum

> > CS2D > Scripts > A wrong with command script ?
Forums overviewCS2D overview Scripts overviewLog in to reply

English A wrong with command script ?

20 replies
Page
To the start Previous 1 2 Next To the start

old Re: A wrong with command script ?

Bowlinghead
User Off Offline

Quote
I think I´ve found the mistake.
1
2
3
4
5
6
7
8
9
10
11
_t1=tostring(_msg[1])
_t2=tonumber(_msg[2])
_t3=tonumber(_msg[3])
	if txt == "!set_lvl" then
          level[_t2]=_t3
          msg2(_t2,"©000255000Admin set your level to ".._t3.."!@C")
          parse("sv_sound2 ".._t2.." levelup.wav")
          msg("©255075000Admin set "..player(_t2,"name").." level to ".._t3.."!")
          return 1;
	elseif ... blabla
	... blablabla
txt is the whole text written by the player like !set_lvl 15 20.
_t1 is your real command like !set_lvl.
_t2 is your first parameter like 15.
_t3 is your second parameter like 20.

But you ask
1
if txt=="!set_lvl" then
instead of
1
if _t1 == "!set_lvl" then
Thats the reason why the text don´t dissapear; you never trigger the "if" block except if you just write the command (!info) but then you do not have the IDs which are needed (thats also the reason why you get errors)

Just replace every
1
if txt == "blabla" then
with
1
if _t1 == "blabla" then
to fix it
edited 4×, last 26.05.15 12:07:06 pm
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview