Forum

> > CS2D > Scripts > something wrong..
Forums overviewCS2D overview Scripts overviewLog in to reply

English something wrong..

4 replies
To the start Previous 1 Next To the start

old something wrong..

Marcell
Super User Off Offline

Quote
Hi something wrong with this part of lua because i get this in console:
LUA ERROR: sys/lua/IF/sys/hooks.lua:337: attempt to index global 'havebal' (a nil value)

1
2
3
4
5
6
7
function rp_drop(id,iid,type,ain,a,mode,x,y)
	if havebal[id]==true then
		parse("strip "..id.." "..type)
		parse("spawnitem "..type.." "..x.." "..y)
		havebal[id]=false
		return 1
	end

Someone know the solution?

old Re: something wrong..

RedizGaming
GAME BANNED Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
havebal = {}

function rp_drop(id,iid,type,ain,a,mode,x,y)
	if havebal[id]==true then
		parse("strip "..id.." "..type)
		parse("spawnitem "..type.." "..x.." "..y)
		havebal[id]=false
		return 1
	end
end

@user Marcell:

old Re: something wrong..

VADemon
User Off Offline

Quote
Sry, but: ARE YOU STUPID PPL? (not you CyberMaster)
Are you looking into his code before helping?

1
if havebal[id]==true then

1) CyberMaster, as other said there's no table called havebal
1.1) You also forgot to add per-user key in that table (array for 32 IDs)

2)
1
if havebal[id]==true then
You should change it to
1
if havebal[id] then
because it's the same if that value is true or false
...aaand it's a bit faster
edited 1×, last 17.08.12 04:41:40 am
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview