Forum

> > CS2D > Scripts > lua erros . .
Forums overviewCS2D overview Scripts overviewLog in to reply

English lua erros . .

5 replies
To the start Previous 1 Next To the start

old lua erros . .

TheBosS_
User Off Offline

Quote
hi guys . . the lua is working 100% . . . but the problem is that in the hudtext2 I put and rank system for admin, mod, and member but it is always member , ,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function updatehud(id)
	if id ~= nil then
		if player(id,"exists") then
			if rp_license[id] >=0 then		
				if rp_license[id] ==0 then
				hudtext2(id,id+4,"254154063","Rank: Newbie",500,339)
				elseif 	rp_license[id] == 1 and rp_vip[id] == 0 then
				hudtext2(id,id+4,"254154063","Rank: License Holder",500,339)
				elseif 	rp_vip[id] == 1 and (not rp_ct[id] == true )then
				hudtext2(id,id+4,"254154063","Rank: Vip",500,339)
				elseif 	rp_Adminlevel[id] >= 1 then
				hudtext2(id,id+4,"254154063","Rank: Member.",500,339)
				elseif 	rp_Adminlevel[id] >= 2 then
				hudtext2(id,id+4, "233114250","Rank: Mod",500,339)
				elseif  rp_Adminlevel[id] >= 3 then
				hudtext2(id,id+4, "255000000","Rank: Adm",500,339)
				end
			hudtext2(id,id,"255255255","Money $: "..rp_money[id],500,359)	
			end
		end
	end
end


and I got error in commands .. the commands can be displayed when I write it , , , ,


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
car_crash_killct = true  
licensemenu_lv = 2
option_lv	 = 2
wallhack_lv  = 1
money_lv 	 = 2 
speed_lv 	 = 1
kill_lv 	 = 1
ban_lv		 = 3
info_lv 	 = 1
vip_lv		 = 2
arrest_lv	 = 1 
free_lv 	 = 1
makect_lv	 = 3
bring_lv 	 = 2 
bring_all_lv = 3
heal_lv 	 = 1
goto_lv 	 = 1
kick_lv 	 = 1 
drop_system_m= 1	--Drop sys on when sv start, suggest not to change
no_kill 	 = 0	--suggest not to change
Mute_text 	 = 0	--suggest not to change
tele_sys	 = 1	--suggest not to change
max_money	 = false--Not allowing  players to pass a certain amount of money (change to true if want)
max_money2	 = 1000000000000


1
2
3
4
5
6
7
8
9
10
elseif cmd == "!k" then
				if rp_Adminlevel[id] >= kill_lv then
					local pl = tonumber(p[2])
					if (pl ~= nil) then
						if player(pl,"exists") then
							parse("killplayer "..pl)
							gmsg2(id,"000255000","You killed"..player(pl,"name"))
							gmsg2(pl,"000255000","You are killed by a admin!")
						end
					end


and the admin say is 2 . .

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
if stag[id] == 1 then
		if txt ~="rank" then
			if rp_ct[id] == true then
				if rp_Adminlevel[id]== 3 then
					gmsg(""..admin_sayco3.."",""..player(id,"name").."("..admin_saylv3.."): "..txt)
				elseif rp_Adminlevel[id] == 2 then
					gmsg(""..admin_sayco2.."",""..player(id,"name").."("..admin_saylv2.."): "..txt)
				elseif rp_Adminlevel[id] == 1 then
					gmsg(""..admin_sayco1.."",""..player(id,"name").."("..admin_saylv1.."): "..txt)
				else
					rc2(id,txt)
				end
			elseif rp_vip[id] == 1 then
			gmsg(""..vip_sayco.."",""..player(id,"name").."("..vip_say.."): "..txt)
			end
			return 1
		end	
	end	
end

hope u guys help me . . thanks !

old Re: lua erros . .

MikuAuahDark
User Off Offline

Quote
user TheBosS_ has written
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function updatehud(id)
	if id ~= nil then
		if player(id,"exists") then
			if rp_license[id] >=0 then		
				if rp_license[id] ==0 then
				hudtext2(id,id+4,"254154063","Rank: Newbie",500,339)
				elseif 	rp_license[id] == 1 and rp_vip[id] == 0 then
				hudtext2(id,id+4,"254154063","Rank: License Holder",500,339)
				elseif 	rp_vip[id] == 1 and (not rp_ct[id] == true )then
				hudtext2(id,id+4,"254154063","Rank: Vip",500,339)
				elseif 	rp_Adminlevel[id] >= 1 then
				hudtext2(id,id+4,"254154063","Rank: Member.",500,339)
				elseif 	rp_Adminlevel[id] >= 2 then
				hudtext2(id,id+4, "233114250","Rank: Mod",500,339)
				elseif  rp_Adminlevel[id] >= 3 then
				hudtext2(id,id+4, "255000000","Rank: Adm",500,339)
				end
			hudtext2(id,id,"255255255","Money $: "..rp_money[id],500,359)	
			end
		end
	end
end

Off Topic >


the problem is
1
2
3
4
5
6
7
elseif 	rp_Adminlevel[id] >= 1 then
					hudtext2(id,id+4,"254154063","Rank: Member.",500,339)
				elseif 	rp_Adminlevel[id] >= 2 then
					hudtext2(id,id+4, "233114250","Rank: Mod",500,339)
				elseif  rp_Adminlevel[id] >= 3 then
					hudtext2(id,id+4, "255000000","Rank: Adm",500,339)
				end
you need to use == operation(variable1 same with variable2(strings, number, boolean, or nil))
new code:
1
2
3
4
5
6
7
elseif 	rp_Adminlevel[id] == 1 then
					hudtext2(id,id+4,"254154063","Rank: Member.",500,339)
				elseif 	rp_Adminlevel[id] == 2 then
					hudtext2(id,id+4, "233114250","Rank: Mod",500,339)
				elseif  rp_Adminlevel[id] == 3 then
					hudtext2(id,id+4, "255000000","Rank: Adm",500,339)
				end

old Re: lua erros . .

TheBosS_
User Off Offline

Quote
btw guys . . I got an restart lua and put it in the file . .

but the money wont be shown in the right side . . and for information: the restart timer is at the left . .

restart:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function Array(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end

timer=60
time=29 -- Change it to your time (OPS this is for Second) so if you want 1 min then type 60
saat=-1

addhook("startround","time_start")
function time_start()
timer=60
time=29
saat=-1
end

addhook("second","time_go")
function time_go()
timer=timer-1
if timer==0 then
time=time-1
timer=60	
if time==saat then
		parse("restart 2")
		msg("©255255255Round has ended, Get ready for another round!@C")

end
end
end


addhook("always","time_hud")
function time_hud()
	parse('hudtxt 1 "©255172000RestartTime: ('..time..':'..timer..') "8 408')
	if time==saat then
		parse('hudtxt 1 "©255255255Time: Round Ended "15 415')
		end
end


Money:

1
2
3
4
5
hudtext2(id,id,"255255255","Money $: "..rp_money[id],500,359)	
			end
		end
	end
end

and thanks for who will help and thanks rain .. it rally works

old Re: lua erros . .

omg
User Off Offline

Quote
should be easy to fix
try adding time_start() at the bottom

old Re: lua erros . .

TheBosS_
User Off Offline

Quote
user omg has written
should be easy to fix
try adding time_start() at the bottom


aha . . .ty

and btw where I add it ? at which error ?


hey guys . . I really need help . . plz help me
edited 3×, last 05.08.12 03:20:55 pm

old Re: lua erros . .

Shawni
User Off Offline

Quote
user TheBosS_ has written
user omg has written
should be easy to fix
try adding time_start() at the bottom


aha . . .ty

and btw where I add it ? at which error ?


hey guys . . I really need help . . plz help me


1
at the bottom
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview