Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Lua Scripts/Questions/Help

6.770 Antworten
Seite
Zum Anfang Vorherige 1 248 49 50338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

playa slaya
COMMUNITY BANNED Off Offline

Zitieren
LilCoder hat geschrieben
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
2× editiert, zuletzt 05.09.09 03:34:13

alt Re: Lua Scripts/Questions/Help

LilCoder
BANNED Off Offline

Zitieren
here the script is...

Spoiler >

alt Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Zitieren
lHunter hat geschrieben
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?

No.

alt Re: Lua Scripts/Questions/Help

Lee
Moderator Off Offline

Zitieren
less of debugging and more of a comprehensive dissassembling and rev-eng skill. I have to warn you upfront that the literal labels for the functions are arbitrary due to the fact that Max destroys all non-relevant literals during compilation.

alt Hi pplz, canz uz pleaze be helpingz me?

Nigga Jesus
User Off Offline

Zitieren
Hi all,

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
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
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.
1× editiert, zuletzt 06.09.09 08:42:32

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

Nigga Jesus
User Off Offline

Zitieren
Flacko hat geschrieben
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


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?
1× editiert, zuletzt 06.09.09 08:54:15

alt Re: Lua Scripts/Questions/Help

Nigga Jesus
User Off Offline

Zitieren
Hell-Jumper hat geschrieben
Mod-_er_- hat geschrieben

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
1× editiert, zuletzt 06.09.09 09:17:20

alt Re: Lua Scripts/Questions/Help

wave2
User Off Offline

Zitieren
hey somegamer you need to strip the knife after equipment because the knife always "respawns" if you have no weapon or thrown a grenade.
1
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
and thats all.
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
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
déjavu 1 connected
déjavu 1 has left the game(banned)
déjavu 2 connected
...
so that i can say all players with the name déjavu... gets automatically banned by join is it possible??
Zum Anfang Vorherige 1 248 49 50338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht