Forum

> > CS2D > Scripts > What's wrong with this code?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch What's wrong with this code?

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt What's wrong with this code?

4729
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
addhook("second","x.second")

x.time=0

function x.second()
	x.time=x.time+1
	if x.time>=3 then
		x.time=0
		parse("setmoney "..id.." "..0)
	end
end

Why will go wrong?

and this code

1
2
3
4
5
6
7
8
9
addhook("walkover","x.wo")

function x.wo(id,idd,type)
	if type>=66 and type<=66 then
		parse("setmoney "..id.." "..0)
	return 0
	end
return 0
end

When I pick up COINS from 0 to 100 money will not change.
sorry, my english is very bad.

alt Re: What's wrong with this code?

Avo
User Off Offline

Zitieren
1
2
3
4
5
6
7
function x.second()
     x.time=x.time+1
     if x.time>=3 then
          x.time=0
          parse("setmoney "..id.." "..0)
     end
end
In this function, id is nil value.Fixed:
1
2
3
4
5
6
7
8
9
function x.second()
     x.time=x.time+1
     if x.time>=3 then
          x.time=0
	 for id=1,32 do
		parse("setmoney "..id.." "..0)
	 end 
     end
end
But I don't see sense in this part of code. Setting money to 0 every 3 seconds?
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht