Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Scripts/Questions/Help

6,770 replies
Page
To the start Previous 1 2199 200 201338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Soja1997
User Off Offline

Quote
Subject is the name of the Lua Scripts / Questions / Help
So this needs a picture of a white bandana that I could change colors

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
@BureX,Piece of cake
1
2
3
4
5
6
7
8
9
10
11
addhook("_walkover","zm_assault")
function zm_assault_walkover(id,x,y)
if (x == 46 and y == 22) then
if (player(id,"money")>2499) then
msg(id,"©255000000You don't have enough money (need 2500 $)")
elseif (player(id,"money")<2499) then
parse("setmoney "..id.." "..(player(id,"money")-2500))
parse("equip "..id.." weapon")
end
end
end

old Re: Lua Scripts/Questions/Help

SkullFace
User Off Offline

Quote
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
addhook("_walkover","zm_assault")
function zm_assault_walkover(id,x,y)
if (x == 46 and y == 22) then
if (player(id,"money")>2499) then
parse("setmoney "..id.." "..(player(id,"money")-2500))
parse("equip "..id.." weapon")
else
msg(id,"©255000000You don't have enough money (need 2500 $)")
end
end
end

if (x == 46 and y == 23) then
if (player(id,"money")>2999) then
parse("setmoney "..id.." "..(player(id,"money")-3000))
parse("equip "..id.." weapon")
else
msg(id,"©255000000You don't have enough money (need 3000 $)")
end
end
end

if (x == 46 and y == 24) then
if (player(id,"money")>3499) then
parse("setmoney "..id.." "..(player(id,"money")-3500))
parse("equip "..id.." weapon")
else
msg(id,"©255000000You don't have enough money (need 3500 $)")
end
end
end

if (x == 46 and y == 25) then
if (player(id,"money")>3999) then
parse("setmoney "..id.." "..(player(id,"money")-4000))
parse("equip "..id.." weapon")
else
msg(id,"©255000000You don't have enough money (need 4000 $)")
end
end
end

if (x == 46 and y == 26) then
if (player(id,"money")>4499) then
parse("setmoney "..id.." "..(player(id,"money")-4500))
parse("equip "..id.." weapon")
else
msg(id,"©255000000You don't have enough money (need 4500 $)")
end
end
end

if (x == 46 and y == 27) then
if (player(id,"money")>4999) then
parse("setmoney "..id.." "..(player(id,"money")-5000))
else
msg(id,"©255000000You don't have enough money (need 5000$)")
end
end
end

if (x == 46 and y == 28) then
if (player(id,"money")>15999) then
parse("setmoney "..id.." "..(player(id,"money")-16000))
parse("setmaxhealth "..id.." 150")
else
msg(id,"©255000000You don't have enough money (need 16000 $)")
end
end
end

if (x == 48 and y == 21) then
msg(id,"©000255000Hi there! Want to buy some thing ?")
end

like this ?! lol

old Re: Lua Scripts/Questions/Help

Caelenn
User Off Offline

Quote
I will make this that when you start you can elect
you character (warrior,magican...).But i don't know
how to start.I had nothing to do with lua scripting.

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
Nelight has written
I will make this that when you start you can elect
you character (warrior,magican...).But i don't know
how to start.I had nothing to do with lua scripting.


see the sample classes at samples folder. maybe that can help you

old Re: Lua Scripts/Questions/Help

Soja1997
User Off Offline

Quote
Subject is the name of the Lua Scripts / Questions / Help
So this needs a picture of a white bandana that I could change colors

old Re: Lua Scripts/Questions/Help

Szkieletor
User Off Offline

Quote
redefinder has written
@Szkieletor,mat5b's Mega Deathmatch script has that feature.


It's not compatible with weiwen's money script which I use too, works, but when I walk through money it dont add it to money count.

old Re: Lua Scripts/Questions/Help

Sudden Death
User Off Offline

Quote
I make map but i need: when player stand on x and y (x=13 y=1,2,3,4,5,6,7) then make hud text in center position: "(name) win the race!". Please help

old Lua Database help

CeLiL_CaN
User Off Offline

Quote
Hi,
I want to be a database for lua...But not mysql or mssql...A text database...

Can I have a text database for Lua?

Pls help me

Sorry my English bad

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
How can I disable the team kill penalty(to make no money lose to players after team killing).Sorry if I missed some of the commands but I just can't find it.

old Re: Lua Scripts/Questions/Help

gabpro
User Off Offline

Quote
@redefinder :
Try to do something like this :
1
2
3
4
5
6
addhook("kill","NoLoseMoney")
function NoLoseMoney(killer,victim,weapon,x,y)
	if player(killer,"team")==player(victim,"team") then
		parse("setmoney "..killer.." "..player(killer,"money")+3300)
	end
end
Not very useful but I think that can do it

Question :
How to know the ID of one player who shots in other player.
I try to do with the hook "Hit",but I fail

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
gabpro has written
@redefinder :
Try to do something like this :
1
2
3
4
5
6
addhook("kill","NoLoseMoney")
function NoLoseMoney(killer,victim,weapon,x,y)
	if player(killer,"team")==player(victim,"team") then
		parse("setmoney "..killer.." "..player(killer,"money")+3300)
	end
end
Not very useful but I think that can do it

Question :
How to know the ID of one player who shots in other player.
I try to do with the hook "Hit",but I fail


player ID in hit hook? maybe a source

old Re: Lua Scripts/Questions/Help

ohaz
User Off Offline

Quote
info.txt has written
hit(id,source,weapon,hpdmg,apdmg)               on hit/damage
-id: player id
-source: source player id or 0
-weapon: weapon type / source type id
-hpdmg: caused damage (health)
-apdmg: caused damage (armor)
>return:     0 - proceed normally
          1 - ignore this hit (no damage)

As you can see, the "source" parameter is the ID of the shooting player

old Re: Lua Scripts/Questions/Help

gabpro
User Off Offline

Quote
@Arctic and TheKilledDeath
Quote
-source: source player id or 0

I try it,but dont work :x
Well,I will test again...

EDIT : Yeah!Some errors in LUA,then i FIX it and works *-*
Thanks!

@redefinder
Quote
Better than nothing,right?

Yeah
edited 1×, last 12.05.10 05:53:42 pm

old Re: Lua Scripts/Questions/Help

0ito
User Off Offline

Quote
I need help to change the limit of setmaxhealth to make a zombie mod(similar to the blazzingxx zombie plague classes)
To the start Previous 1 2199 200 201338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview