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 2232 233 234338 339 Next To the start

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
tom282f3 has written
Well, default serverinfo.txt have some colored text and looks like "?55000000", but when I see them in Notepad++, it's unicode "[xA9]" then "255000000". So I want to ask, how to type [xA9] in Notepad++ or Notepad?


© that one?

alt + 0169

old Re: Lua Scripts/Questions/Help

tom282f3
User Off Offline

Quote
HaRe has written
tom282f3 has written
Well, default serverinfo.txt have some colored text and looks like "?55000000", but when I see them in Notepad++, it's unicode "[xA9]" then "255000000". So I want to ask, how to type [xA9] in Notepad++ or Notepad?


© that one?

alt + 0169


That's not works Someway else?

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
tom282f3 has written
HaRe has written
tom282f3 has written
Well, default serverinfo.txt have some colored text and looks like "?55000000", but when I see them in Notepad++, it's unicode "[xA9]" then "255000000". So I want to ask, how to type [xA9] in Notepad++ or Notepad?


© that one?

alt + 0169


That's not works Someway else?


copy and past then -.-"

old Breakable

KaBooMa
User Off Offline

Quote
Hey guys! Ive not posted so long here for a question Ive made so much progress in lua scripting...if you've been to the Az rp server you'd see Anyways...so i just wanted to know this so i know it because ive ran into this question before and never asked...how would i go about making a breakable respawn? like...they destroy all breakables...take the money... then they go to respawn and the breakables respawn so they got to kill all breakables again for the money. Just a random question id like to know for the future.

old Re: Lua Scripts/Questions/Help

KaBooMa
User Off Offline

Quote
thanks fast reply...im guessing you just trigger it? i thought i tryed and it didnt work tho...i guess ill try again


alright so i tryed it and it failed me >.< the breakables went boom any ideas?
edited 2×, last 13.08.10 10:44:11 am

old Re: Lua Scripts/Questions/Help

Loooser
User Off Offline

Quote
write:
1
2
3
4
5
6
addhook("walkover","pickup")
function pickup(id,iid,type)
         if type<"firstflag" and type>"secondflag" then --there are two flags Red and Blue write the smaller iid in firstflag and...
          return 1
         end
end

old Re: Lua Scripts/Questions/Help

beckerchen
User Off Offline

Quote
Akmin has written
thanks fast reply...im guessing you just trigger it? i thought i tryed and it didnt work tho...i guess ill try again


alright so i tryed it and it failed me >.< the breakables went boom any ideas?


My English is terrible but I will try

I got an Idea how to make that:

1
2
3
4
5
6
7
8
addhook("projectile","bamms")
function bamms(id,weapon,x,y)
	if(x>=1 and x<=32 and y>=1 and y<=32) then
		parse("trigger Dwall11")
		parse("spawnitem 66 1 1")
		parse("trigger Dwall11del")
	end
end

the "x>=1 and x<=32 and y>=1 and y<=32" is just an example for the tile 1|1 you must do that for every tile where should be a destroyable rebuildable objekt.

On this Tile you place a Dynamic Wall and call it "Dwall11" (11 for position 1|1 so its easier) anywhere else you place a trigger_delay and call this one "Dwall11del" (because its the delay of the Dwall on Tile 1|1) as Trigger of this Delay you choose the "Dwall11" andthe delay time is your choose (the time which the Dwall needs to rebuild)

I test this Script but it doesn't work I don't know why, I tried very much but this would be the only possibility to rebuild a destroyable objekt.

Maybe another Member find the error in this script.

Greetings
Robin

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
MSek has written
ok, pick uping flag enabled, now i need script to drop only flags, not other items


1
2
3
4
addhook("drop","dropflag")
function dropflag()
	return 1
end

Lol simple


or you maybe mean die drop xD?

write

1
2
3
4
addhook("die","dieflag")
function dieflag()
	return 1
end

old Re: Lua Scripts/Questions/Help

murilog
User Off Offline

Quote
is this correct ?

Code:

function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end

license = initArray(32)
posy = initArray(32)
posx = initArray(32)
collect = initArray(32)

addhook("leave","license_leave")
function license_leave(id)
license[id]=0
collect[id]=0
posy[id]=0
posx[id]=0
end

addhook("serveraction","license_action")
function license_action(id,b)
if license[id]==1 and b==1 then
menu(id,"License Menu,Set Pos,Teleport,Collect")
elseif license[id]==0 and b==1 then
msg2(id,"You dont have license")
end
end

addhook("menu","license_menu")
function license_menu(id,title,button)
if title=="License Menu" then
if button==1 then
posx[id]=player(id,"x")
posy[id]=player(id,"y")
msg2(id,"Youve saved ur positon")
elseif button==2 and posy[id]==1 and posx[id]==1 then
parse ("setpos "..p.." "..posx[id].." "..posy[id])
msg2(id,"Youve teleported your self")
elseif button==2 and posy[id]==0 posx[id]==0 and
msg2(id,"You cant teleport your self, No position setted")
elseif button==3 collect[id]==0 then
msg2(id,"Collection ON")
collect[id]=1
elseif button==3 collect[id]==1 then
msg2(id,"Collection OFF")
collect[id]=0
end
end
end

addhook("walkover","license_collect")
function license_collect(id)
if collect[id]==1 then
return 1
elseif collect[id]==0 then
return 0
end
end

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
@murilog:
this one should work, Ive tested 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
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
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end

license = initArray(32)
posy = initArray(32)
posx = initArray(32)
collect = initArray(32)

addhook("leave","license_leave")
function license_leave(id)
license[id]=0
collect[id]=0
posy[id]=0
posx[id]=0
end

addhook("serveraction","license_action")
function license_action(id,b)
if license[id]==1 and b==1 then
menu(id,"License Menu,Set Pos,Teleport,Collect")
elseif license[id]==0 and b==1 then
msg2(id,"You dont have license")
end
end

addhook("menu","license_menu")
function license_menu(id,title,button)
	if title=="License Menu" then
		if button==1 then
			posx[id]=player(id,"x")
			posy[id]=player(id,"y")
			msg2(id,"Youve saved ur positon")
		elseif button==2 and posy[id]==0 and posx[id]==0 then
			msg2(id,"You cant teleport your self, No position setted")
		else
			parse ("setpos "..id.." "..posx[id].." "..posy[id])
			msg2(id,"Youve teleported your self") end
		elseif button==3 and collect[id]==0 then
			msg2(id,"Collection ON")
			collect[id]=1
		elseif button==3 and collect[id]==1 then
			msg2(id,"Collection OFF")
			collect[id]=0
		end
	end

addhook("walkover","license_collect")
function license_collect(id)
	if collect[id]==1 then
		return 1
	elseif collect[id]==0 then
		return 0
	end
end

/edit

be sure that you write this in your code

1
2
3
4
addhook("minute","license_adv")
function license_adv()
	msg("License script made by HaRe")
end

couse i made this script

http://www.unrealsoftware.de/forum_posts.php?post=190550#jn
edited 1×, last 14.08.10 03:50:57 pm

old Re: Lua Scripts/Questions/Help

archmage
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
usid = {}

addhook("say", "said")

function said (id,s)
	if ( s:lower() == "!laser" ) then
		for i = 1, #usid do
			if ( player(id, "usgn") == usid[i] ) then
				parse("equip "..id.." 45")
				break
			end
		end
	end
end

old Re: Lua Scripts/Questions/Help

Dictatus Papae
User Off Offline

Quote
Hey, I'm making ammo types for my mod, and I need to give them ids (all of them will be primary and secondary ammo) or something so the ammo type can be identified, and I can actually script the thing.

Spoiler >


I also have to find a way to only give ammo to a certain weapon. I would appreciate the help! I really need it!

old Re: Lua Scripts/Questions/Help

beckerchen
User Off Offline

Quote
@ murilog: I don't test this script, I hope that it works


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
function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end


Xposition=initArray(32)
Yposition=initArray(32)
counter=initArray(32)

addhook("say","savepos")
function savepos(id,txt)
	if(txt=="!savepos") then
		Xposition[id]=player(id,"x")
		Yposition[id]=player(id,"y")
		counter[id]=1
		msg2(id,"©255255255your position have been saved")
	end
	if(txt=="!gopos") then
		if(counter[id]==0) then
		msg2(id,"©255000000no position saved")
		else
		parse("setpos "..id.." "..Xposition[id].." "..Yposition[id])
		msg2(id,"©255255255loaded saved position")
		end
	end
end

EDIT!: I test the Script and it does not work, so I change some things and now it works
edited 2×, last 15.08.10 05:45:29 pm

old Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Quote
why it dont work?

1
2
3
4
5
6
addhook("attack","ms_turret")
function ms_turret(id,tilex,tiley)
sx=player(id,"tilex")
sy=player(id,"tiley")
	parse('spawnobject 8 '..sx+1..' '..sy+1..' 0 0 '..player(id,"team")..' '..id)
end
To the start Previous 1 2232 233 234338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview