Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Lua Scripts/Questions/Help

6.770 Antworten
Seite
Zum Anfang Vorherige 1 2100 101 102338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

Lord_CTF
User Off Offline

Zitieren
no one yet helped me... find my post in the 100 page and PLEASE help me
EDIT:
Spoiler >

There is a LOAD of mistakes here. Probably the whole code is a MISTAKE. Thats why i need help...
1× editiert, zuletzt 25.11.09 10:43:49

alt Re: Lua Scripts/Questions/Help

ohaz
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
addhook("say","deagle")
function deagle(id,txt)
if (txt == "deagle") then
if (player(id,"money")>=750) then
parse('equip '..id..' 3')
parse("setmoney "..id.." "..player(id,"money")-750);
elseif(player(id,"money")<750) then
parse('sv_msg2 ..id.. "You dont have enough money!"')
end
end
end

alt Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Zitieren
Spoiler >


why bombplant hook does not exist ?

ps: at changelog
ADDED
Lua Hook bombplant (when planting bomb)

alt Re: Lua Scripts/Questions/Help

Lee
Moderator Off Offline

Zitieren
gandalf hat geschrieben
it doesnt work


tell us what you did so we can debug it, just saying "it doesn't work" doesn't give us anything to help you with...

Post everything that you did and what you expect to happen.

alt Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Zitieren
Admirdee hat geschrieben
1
2
3
4
5
6
7
8
addhook("startround","rstart")
function rstart()
	for i = 1,32 do
		if (player(i,"exists")) then
			parse("strip "..i.." 0")
		end
	end
end

long code for it

I need it just for secondary and primary and need the value of the weapon the person owned...

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
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
42
43
44
45
46
47
48
function array(size,value)
	local asd = {}
	for i=1, size do
		asd[i] = value
	end
	return asd --LOL
end

function getslotweps(id,slot)
	local myweapons = playerweapons(id)
	local rt = {}
	for i,v in ipairs(myweapons)
		if itemtype(v,"slot") == slot then
			table.insert(rt,v)
		end
	end
	return rt
end 

--Global table to save what weapons did each player have
a_table = array(
	32,
	{
		prim={},
		sec={},
		melee={}, --We won't use this
		nades={} --neither this
	}
)

addhook("startround","omg")
function omg()
	for i=1,32 do
		if(player(i,"exists")) then
			if(player(i,"team")>=1) then
				a_table[i].prim=getslotweps(i,1))
				for a=1,#a_table[i].prim do
					parse("strip "..i.." "..a)
				end	
				a_table[i].sec=getslotweps(i,2))
				for m=1,#a_table[i].sec do
					parse("strip "..i.." "..m)
				end
				fo
			end
		end
	end
end

Try that, so you can make yourself an idea...
3× editiert, zuletzt 25.11.09 18:18:17

alt Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Zitieren
tried it.
got this:

LUA ERROR: dir: attempt to call global 'nades' (a nil value)

line was this
1
nades{} --neither this
:S
also that "fo" after the secondary wep thing doesn't go there (right ?)

alt Re: Lua Scripts/Questions/Help

Lord_CTF
User Off Offline

Zitieren
Zitat
gandalf has written:
it doesnt work


tell us what you did so we can debug it, just saying "it doesn't work" doesn't give us anything to help you with...

Post everything that you did and what you expect to happen.

ive writed what i did just look some posts up
TKD has fixed the code, but it still didnt work.

alt Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Zitieren
now i've got this

LUA ERROR: dir: attempt to global index 'a_table' ( a nil value)

line is this:
1
a_table[i].prim=getslotweps(i,1)
may be it will happen on this other too
1
a_table[i].sec=getslotweps(i,2)
sorry of all my questions :S

alt Re: Lua Scripts/Questions/Help

Lee
Moderator Off Offline

Zitieren
gandalf hat geschrieben
ive writed what i did just look some posts up
TKD has fixed the code, but it still didnt work.


... What did you press and type in in-game, what did you expect the script to do, what actually happened, is there any error messages - that's what you "do". Once again, telling us that "it still didn't work" doesn't give us anything to work on. Do you really expect us to magically read your mind?

alt Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Zitieren
if you want us to help you, you should tell us exactly what do you wanna do.
this vampire class sucks hp ?
recovers when killing ?
tell us all the information
(maxhp,speed,weapons,additionals like hp suck)
and then we can help you

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
LOL.
Stupid error
1
2
3
4
5
6
7
function array(size,value)
	local asd = {}
	for i=1, size do
		asd[i] = value
	end
	return asd -->dammit
end

alt Re: Lua Scripts/Questions/Help

h4uja2
User Off Offline

Zitieren
Parametres of vampir class
setmaxhealth 250
sethealth 100
setarmor 100
speedmod 0
equip 39
When vampir attacks anemy he gets 1 hp and when he kills him he gets 20 hp. Thats all

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
h4uja2 hat geschrieben
Im making vampire class, but it doesnt work. Help me pls with this class


Ok, show us what do u have until now...

alt Re: Lua Scripts/Questions/Help

h4uja2
User Off Offline

Zitieren
Its working perfect
Spoiler >


but i cant make sucking HP
something from Heal Claws script and Battle Field 2D Mod Machete (pack munition)

alt Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Zitieren
here's just the hp sucking:
Spoiler >

alt Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Zitieren
@-WiLSoN-,
1
player(id,"health")+[b]1..[/b]
You cant place number like valuable.
1
[b]([/b]player(id,"health")+1[b])[/b]..

Nvm, whole line is wrong there.
1
parse("sethealth "..at..[b]""[/b]..player(at,"health")+1..)
Zum Anfang Vorherige 1 2100 101 102338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht