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 2334 335 336338 339 Next To the start

old any way to trigger a domination point?

VaiN
User Off Offline

Quote
Just wondering if there is any way to trigger/set a domination point to be captured by a team. I can't find any info on this.

My intention is to allow the game mode I am working on to be persisted between server resets. Loading which team controls which domination points is kind of an essential part of that. parse("trigger <name>") doesn't seem to have any effect on domination points. Any advice?

Thanks,
VaiN

old Re: Lua Scripts/Questions/Help

Casper-
User Off Offline

Quote
can somebody fix me this ?
1
2
3
4
5
6
7
8
9
addhook("team","pointstwo")
addhook("hit","points")
function points(id)
function pointstwo(id,team)
if team == 2 then
parse("setmoney "..id.." "..(player(id,"money")+10))
end
end
end
i want to get here that person who shot an enemy gets 10 $ (i mean that person which attacked enemy gets 10$ per shot)

old Re: Lua Scripts/Questions/Help

J4x
User Off Offline

Quote
@burex

1
2
3
4
addhook("hit","points")
function points(id)
parse("setmoney "..id.." "..(player(id,"money")+10)
end
edited 1×, last 24.12.10 08:20:53 pm

old Re: Lua Scripts/Questions/Help

Cure Pikachu
User Off Offline

Quote
This is the right version
1
2
3
4
5
6
addhook("hit","points")
function points(id,source)
	if player(source,"team")~=player(id,"team") then
		parse("setmoney "..source.." "..(player(source,"money")+10))
	end
end

old Re: Lua Scripts/Questions/Help

brk951753
User Off Offline

Quote
i need help
i dont know how to make save system :S
i will save licences

pls use minute function

if rp_hplicence[id]== true or rp_hitlicence[id]== true or rp_buldlicence[id]== true or rp_license[id]==true or yourmon[id] >= 1 then


save =>>rp_hplicence[id]
save =>>rp_hitlicence[id]
save =>>rp_buldlicence[id]
save =>>yourmon[id]
save =>>rp_license[id]


pls help me...

plssss

old Re: Lua Scripts/Questions/Help

JONY
User Off Offline

Quote
@Pikachu:
this is "more correct" version:
1
2
3
4
5
6
addhook("hit","points")
function points(id,source)
	if player(source,"team")~=player(id,"team") and player(source,"money")<=15990 then
		parse("setmoney "..source.." "..(player(source,"money")+10))
	end
end

@brk951753:
how do you want to save it? In a file?
What exactly do you want to save? If a player has any of the licenses? Do you want to make 1 file for everyone or 1 file for each player?

old Re: Lua Scripts/Questions/Help

J4x
User Off Offline

Quote
Burex this si the correect version:
1
2
3
4
addhook("attack","points")
function points(id)
parse("setmoney "..id.." "..(player(id,"money")+10))
end

why we where wrong? because we use Hit hook...

old Re: Lua Scripts/Questions/Help

Simplest
User Off Offline

Quote
brk951753 has written
i need help.

players cannot drop wrench.

ONLY WRENCH NOT OTHER

help me


If it is construction, then you cannot drop the wrench.
But if it is tdm,dm,standard, or zombies, then you can drop the wrench only if you pick it up.

old Re: Lua Scripts/Questions/Help

ULtiMa
User Off Offline

Quote
I am making a simple script about when a player join a msg appears.....

A nooby question: how to add hudtxt?in the center??

old Re: Lua Scripts/Questions/Help

brk951753
User Off Offline

Quote
Simple - You has written
brk951753 has written
i need help.

players cannot drop wrench.

ONLY WRENCH NOT OTHER

help me


If it is construction, then you cannot drop the wrench.
But if it is tdm,dm,standard, or zombies, then you can drop the wrench only if you pick it up.


my game is tdm and i need "players cannot or cannot pick up "wrench""

old Re: Lua Scripts/Questions/Help

Rainoth
Moderator Off Offline

Quote
AdrienneTheGreat213 has written
I am making a simple script about when a player join a msg appears.....

A nooby question: how to add hudtxt?in the center??


1
2
3
4
5
6
7
8
addhook("ms100","ms_hud")
function ms_hud()
     for id = 1,32 do
          if (player(id,"exists")) then
               parse('hudtxt2 '..id..' 44 "©000255000This Script was made by Batlaizys " 220 13')
          end
     end
end
It will show "This Script was made by Batlaizys" in green color.

old Re: Lua Scripts/Questions/Help

Fiz
User Off Offline

Quote
First: Merry Christmas!

second:
With lua and an 'addhook', how do i add a simple scorelimit in Team DM?

Example:
when CT's team scores add to 75, CT's win.
I have tried and tried and i'm really stuck but i know its possible so please someone help, greatly appreciated :).
Will

old Re: Lua Scripts/Questions/Help

JONY
User Off Offline

Quote
fizzykil has written
First: Merry Christmas!

second:
With lua and an 'addhook', how do i add a simple scorelimit in Team DM?

Example:
when CT's team scores add to 75, CT's win.
I have tried and tried and i'm really stuck but i know its possible so please someone help, greatly appreciated :).
Will


Merry Christmas to you too
On your map put 2 Func_GameAction and name one of them win1 (action 1-T Win) and name the other one win2 (action 2-CT Win). Here's the script:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
addhook("kill","updateScores")
function updateScores(killer,victim,weapon,x,y)
	local sum = 0
	for i=1,32 do
		if (player(i,"exists")) and (player(i,"team")) == (player(killer,"team")) then
			sum = sum + player(i,"score")
		end
	end

	if sum > 74 then
		local wintrigger = "win"..(player(killer,"team"))
		parse("trigger "..wintrigger)
	end
end

addhook("startround","rest")
function rest()
	for i=1,32 do
		if (player(i,"exists")) then
			parse("setdeaths "..i.." 0")
			parse("setscore "..i.." 0")
		end
	end
end
J.
To the start Previous 1 2334 335 336338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview