Forum
CS2D Scripts Lua Scripts/Questions/Help LilCoder has written
Pff, when will you learn it?
im trying and i thought thats what this thread was about is help.and your script did not work anyway so maybe you also need to learn better because i fixed this part:
you put parse("setmoney "..id.." "1100")
me parse("setmoney "..id.." 1100")
dont need extra quote
oh and is still not fixed
edited 2×, last 05.09.09 03:34:13 am
3
2
1...
saladface27 has written
how to detect if variable is array?
1
if(type(yourvariable)=="table") then
http://www.unrealsoftware.de/files_show.php?file=2094
It was made by fps_css, the reason i don't want to make L4D LUA is the bug.
Mod-_er_- has written
OK check this file out.
http://www.unrealsoftware.de/files_show.php?file=2094
It was made by fps_css, the reason i don't want to make L4D LUA is the bug.
http://www.unrealsoftware.de/files_show.php?file=2094
It was made by fps_css, the reason i don't want to make L4D LUA is the bug.
What bug? I don't want to download a script and test it for bugs, ty.
Flacko has written
1
if(type(yourvariable)=="table") then
thanks flacko
or to remove the light that comes out of your head when u have them?
lHunter has written
is there any way to edit the night vision colour?
or to remove the light that comes out of your head when u have them?
or to remove the light that comes out of your head when u have them?
No.
You can change it tho, if you have decent debugging skills.
Listen, I dearly need someone to explain this one to me. I go through a lot of lua scripts i download to edit them (make them more user friendly, or bend them in my favour, without taking any credz 4 it) and I come across a few lines of code, all dead set similar to this one:
1
2
3
4
5
6
7
2
3
4
5
6
7
function iar(a,b) local ar = {} for i = 1, a do ar[i]=b end return ar end
Im using 'wups' portal system lua from the files section as an example, as its the one im editing.
What I'd like to know, is what does all these arguements etc. mean, what can it be used for, what is it called, and how do i use it to my advantage to search for players that have knives and remove their knives as they respawn after a while (i already have this code:)
1
2
3
4
5
2
3
4
5
addhook("spawn","shifty") function shifty(id) parse("strip "..id.." 50") -- steals knife. return"88" -- gives portal gun, and thats all they have (as map has a noweapons entity) end
oh and by the way, i found a function namely function ctimer but there is no addhook for it? i searched the WHOLE thing. No ctimer.
edited 1×, last 06.09.09 08:42:32 am
For the first piece of code, what it does is returning a table.
For example iar(32,4) will return a table with a size of 32 containing 4.
The first parameter determines the size and the second the value.
That's all
Flacko has written
What you are doing is ok, but you have to strip knife AFTER equiping portal gun.
For the first piece of code, what it does is returning a table.
For example iar(32,4) will return a table with a size of 32 containing 4.
The first parameter determines the size and the second the value.
That's all
For the first piece of code, what it does is returning a table.
For example iar(32,4) will return a table with a size of 32 containing 4.
The first parameter determines the size and the second the value.
That's all
so, in order to get a list of players who have knives, i would do something like...
[code]
function always() -- i know it dont work like that but bear with me.
for x = 1, y and weapon==50 -- or whatever it is -- do
ar[x]=b
end
return ar
end
or is it like that? dont bother telling me im hopeless. i figured that one out when i started trying.
also when i strip the knife at spawn, i lose the knife for about 10 minutes, then it mysteriously re apears?
edited 1×, last 06.09.09 08:54:15 am
Mod-_er_- has written
OK check this file out.
http://www.unrealsoftware.d...s_show.php?file=2094
http://www.unrealsoftware.d...s_show.php?file=2094
Um... wat do you do once you have downloaded these scripts
[2nd Edit] - [Figured It Out] Very nice scripting, 1 problem when I become a zombie there is absolutely no change in respect to the classes.
edited 1×, last 06.09.09 08:58:41 am
Hell-Jumper has written
Um... wat do you do once you have downloaded these scripts
Mod-_er_- has written
OK check this file out.
http://www.unrealsoftware.d...s_show.php?file=2094
http://www.unrealsoftware.d...s_show.php?file=2094
Um... wat do you do once you have downloaded these scripts
you put them in sys/lua and write to server.lua (at the bottom) dofile(sys/lua/*.lua)
replace * with the name of the file.
if the file doesnt agree with other lua files u have readied in server.lua, then in cs2d, when you host a server, before clicking start, goto more options, and look through there untill you find mp_luaserver or something similar. change it to whatever you were gonna put into server.lua
edit: oops, damn i seem to be slow
edited 1×, last 06.09.09 09:17:20 am
1
2
3
4
5
2
3
4
5
addhook("spawn","shifty") function shifty(id) parse("equip "..id" 88") -- gives portal gun, and thats all they have (as map has a noweapons entity) parse("strip "..id.." 50") -- steals knife. end
to the arguments. the arguments in a function is a "place" where you can safe other integers or strings for example. look at this:
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
function i(a,b,c 	parse("strip "..c.." "..a) 	a=a-b 	parse("equip "..c.." "..a) end function j() 	for k=1,32 do 		d=player(k,"weapontype") 		i(d,5,k) 	end end
this is just an example of saving intergers or numbers from a function into another function i hope you understand it
now to my question: is it possible to make a script that bans a player with a similiar name for example
1
2
3
4
2
3
4
déjavu 1 connected déjavu 1 has left the game(banned) déjavu 2 connected ...