But...How !
Forum
CS2D Scripts Lua Scripts/Questions/HelpBut...How !
could you help me with this?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("move","gm.o.move") function gm.o.move(id,walk) tid = player(id,"team") if (walk==1 and tid==1) then parse("setarmor "..id.." 206") else if (walk==0 and tid==1) then parse("setarmor "..id.." 0") end end end
BF2D
how i can make an menu,
this not works good
Quote
addhook("spawn","sid")
function sid(id)
menu(id,"Select Class,Medic,Super")
end
addhook("menu","selection")
function selection(id,men,sele)
menu(id,"Select Class,Medic,Super")
if (sele=="1") then
parse("killplayer "..i.."")
parse("spawn "..i.."")
parse("equip "..i.." 82")
parse("equip "..i.." 78")
parse("equip "..i.." 20")
parse("setmaxhealth "..i.." 138")
if (sele=="2") then
parse("killplayer "..i)
parse("spawn "..i)
parse("equip "..i.." 83")
parse("equip "..i.." 45")
parse("speedmod "..i.." 100")
end
end
end
function sid(id)
menu(id,"Select Class,Medic,Super")
end
addhook("menu","selection")
function selection(id,men,sele)
menu(id,"Select Class,Medic,Super")
if (sele=="1") then
parse("killplayer "..i.."")
parse("spawn "..i.."")
parse("equip "..i.." 82")
parse("equip "..i.." 78")
parse("equip "..i.." 20")
parse("setmaxhealth "..i.." 138")
if (sele=="2") then
parse("killplayer "..i)
parse("spawn "..i)
parse("equip "..i.." 83")
parse("equip "..i.." 45")
parse("speedmod "..i.." 100")
end
end
end
what the problem is?
and is that the whole "mod" ?
else can't help you
CmDark has written
@ someone
could you help me with this?
could you help me with this?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("move","gm.o.move") function gm.o.move(id,walk) tid = player(id,"team") if (walk==1 and tid==1) then parse("setarmor "..id.." 206") else if (walk==0 and tid==1) then parse("setarmor "..id.." 0") end end end
do you have function for walk? because im pretty sure walk is not a whatever
playa slaya has written
do you have function for walk? because im pretty sure walk is not a whatever
CmDark has written
@ someone
could you help me with this?
could you help me with this?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("move","gm.o.move") function gm.o.move(id,walk) tid = player(id,"team") if (walk==1 and tid==1) then parse("setarmor "..id.." 206") else if (walk==0 and tid==1) then parse("setarmor "..id.." 0") end end end
do you have function for walk? because im pretty sure walk is not a whatever
um could you say that in English please?
EDIT I:
(If you do not know what "no-clipping" is then that is where you walk through walls and obstacles)
that could be easily be done
even without lua
make a whole map with sprites(non walled)
or dynwalls with sprites
and trigger .. easy
but the map might need to be altered
so.. yeah until dc releases
a command like:
removetile <x> <y>
then pretty much impossible
edit:
oh and you need a spawntile <x> <y> <tileid>
too
All of the values are good, but when the player changes the team it says:
"LUA ERROR: sys/lua/server.lua:1457: attempt to concatenate field '?' (a nil value)"
The 1457 line is the first long line in the spoiled script:
So what is wrong?
(DO NOT COPY THIS SCRIPT TO YOUR ONE)
edited 1×, last 27.10.09 08:20:42 pm
mat5b has written
(DO NOT COPY THIS SCRIPT TO YOUR ONE)
LOL, look what's talking (I'm sure you not the guy who created U.S.G.N. saves)
You are sure it's that line?
You can use for command for that. But that values...
1
2
3
2
3
For i = 1,50 	 file:write(value[i]) -- there should be special values for it. end
Anyway, it's mess with values and you should rescript your work.
Anyway, forget about this.
It's impossible to find bug here becouse its not in this part.
Blazzingxx has written
LOL, look what's talking (I'm sure you not the guy who created U.S.G.N. saves)
mat5b has written
(DO NOT COPY THIS SCRIPT TO YOUR ONE)
LOL, look what's talking (I'm sure you not the guy who created U.S.G.N. saves)
Haha, he can't tell you to not copy his idea, ideas are free and can't be patented by any means, what you can patent is what you have done. Scripts for example. Not what you think, like a video game using blue bananas as protagonists fighting polar bears with light sabres.
Maybe he is talking about his script and not his idea?
mat5b has written
Oh yea, sure. I just need to re-script 50 achievements. Veeery easy. (sarcasm)
Anyway, forget about this.
Anyway, forget about this.
Programmers can write good code in all the program and have no problems with it.
Or they can write bad code in all a program and have to rewrite lots of his code because he forgot some simple thing.
But they rarely abandon the projects they have put a big effort in.
Flacko has written
Anyway, who would copy his "useful" script.
It's part of script which doesn't help at all.
Yes, you are actualy right about ideas.
Of course there is some cases then people buying ideas.
There is so much mods with my ideas and scripts...
I can't do anything, just say that add my credits.
Flacko has written
Programmers can write good code in all the program and have no problems with it.
Or they can write bad code in all a program and have to rewrite lots of his code because he forgot some simple thing.
But they rarely abandon the projects they have put a big effort in.
Or they can write bad code in all a program and have to rewrite lots of his code because he forgot some simple thing.
But they rarely abandon the projects they have put a big effort in.
Great point, I would also like to point out that testing is/should be encouraged during scripting.
And also, another point, common functions needs to be refactored so that you won't ever have the need to rescript everything due to minor changes.
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
addhook("reload","noreloadtoa") function noreloadtoa (id,mode) 	if (mode==1) then 	parse("equip "..id.." "..player(id,"weaponid").."") end end
But I got this error
ERROR: equip - item with type id 0 does not exist!
So then I made this script
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
addhook("reload","noreloadtoa") function noreloadtoa (id,mode) 	if (mode==1) then 	if (player(id,"weaponid") == 0) then 	return 0 	else parse("equip "..id.." "..player(id,"weaponid").."") end end end
This script doesn't work because it still reads my wepid as a 0 value.
What can i do to change that?
Or, am I approaching it completely wrong?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
if noreload==nil then noreload={} end noreload={} addhook ("attack","noreload") function noreload(id) 	for i=1,90 do 	 		wid = player(id,"weapontype") 		 		if (wid == i) then 		parse ("equip "..id.." "..wid) 		end 	end end
notice the i=1,90
EDIT: CAN SOMEONE HELP ME WITH THIS:
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
score = player(id,"score") deaths = player(id,"deaths") health = player(id,"health") 	parse ('hudtext 4 "©000235115Kills: "..score,113 425 2') 	parse ('hudtext 5 "©000255000Deaths: "..deaths,10 420 2') 	parse ('hudtext 6 "©255010003Health: "..health,10 425 2') I'm tryin to make hud for my ghostmatch script (not a edit of Kiffer-Opa's ghostmatch (custom version)) appreciate the help..
EDIT 2: (mainly i suck at lua)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
i need to make usgn save that records the weapons and money that the person has when he/she leaves and loads when they come back yeah.... i don't understand how to use the code to read the weapons and money T_T -- Open File io.open() -- Close File close() -- Write File write() -------------Edit 3= I got playa slaya to help------ even if you can't help me but can explain, please do so....
edited 4×, last 28.10.09 03:32:02 am