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 2230 231 232338 339 Next To the start

old Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Quote
yes, its here:

1
2
3
4
5
6
addhook("say","godmode_say")
function godmode_say(id,txt)
     if txt == "!god" then
          parse("setarmor "..id.." 206")
     end
end

old HELP

texnonikWP
User Off Offline

Quote
H1 need new super hero mod
:
100 level max ,
to open 2 nd character need 10 level to 3nd 20 ,
level start 0 ,
3 the same skills , 3 enather the same skills , enather 3 the same skills , and 1 super skill (in one character)(need in 2 nd character save weapon skill) .

Pliz you can write in my skype scripts maded : dawbawBK
Big Tnx
Name of mod can change because its will be dont like super hero mod .

old Re: Lua Scripts/Questions/Help

Starkkz
Moderator Off Offline

Quote
MSek has written
yes, its here:

1
2
3
4
5
6
addhook("say","godmode_say")
function godmode_say(id,txt)
     if txt == "!god" then
          parse("setarmor "..id.." 206")
     end
end


No it isn't.

Quote
function player_admin(id)
     admin_table = {} -- Write your U.S.G.N Here
     for _, usgn in pairs(admin_table) do
          if player(id,"usgn") == usgn then
               return true
          end
     end
     return false
end

pl_god = {}
addhook("say","godmode_say")
function godmode_say(id,txt)
     if txt == "!god" and player_admin(id) then
          if pl_god[id] then
               pl_god[id] = nil
          else
               pl_god[id] = true
          end
          return 1
     end
end

addhook("hit","godmode_hit")
function godmode_hit(id)
     if pl_god[id] then
          return 1
     end
end

addhook("leave","godmode_leave")
function godmode_leave(id)
     pl_god[id] = nil
end

old dude

Sparty
Reviewer Off Offline

Quote
THAT's LOT!

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
Dark Byte has written
What could I do with luac.out? Is there a way to run it as an exe?

I don't think so. You just have to dofile() it.

old Re: Lua Scripts/Questions/Help

Lee
Moderator Off Offline

Quote
It's possible to load either the bytecode or the direct sourcecode as an independent exe, however there are no elegant ways of doing it. For now, see

http://www.megaupload.com/?d=WBRF0D3C

and modify lua2exe.c to your needs. Since I wrote this on the fly, there may be various issues left in hindsight that you may need to manually debug.

To compile and link, assuming that you have GCC via mingw, use the following:

Compilation: gcc [-mno-cygwin] -oFILENAME lua2exe.c -I./include -L./lib -L./clibs -llua51

If you need to link more auxiliary libraries into your exe, just add -lLIBNAME to the end of the chain, but it's only necessary if you need to preload certain libraries into the Lua environment. (You can also discard the clibs directory altogether, that'll cut the size down quite a bit)

IMG:https://i560.photobucket.com/albums/ss44/leegao/lua2exe.png

old Re: Lua Scripts/Questions/Help

Casper-
User Off Offline

Quote
Is this correct ?

1
2
3
4
5
addhook("drop","sample.classes.drop")
function sample.classes.drop(id)
if player(id,"team") == 1 then
	return 1
end

old Re: Lua Scripts/Questions/Help

Cure Pikachu
User Off Offline

Quote
@BureX
I don't think it is correct.
Maybe this...

1
2
3
4
5
6
7
8
addhook("drop","sample.classes.drop")
function sample.classes.drop() -- Drop hook has no parameters
	for id = 1,32 do
		if player(id,"team") == 1 then
			return 1
		end
	end -- Missing end
end

old Re: Lua Scripts/Questions/Help

murilog
User Off Offline

Quote
Is This Correct ?
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
60
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("collect","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
@MuH_: i made that one anyways change

1
2
3
4
5
6
7
8
addhook("collect","license_collect")
function license_collect(id)
if collect[id]==1 then
return 1
elseif collect[id]==0 then
return 0
end
end

to

1
2
3
4
5
6
7
8
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

PAlllUCH
User Off Offline

Quote
Hi all,
I would ask someone to write scripts, namely, the script has to rely on the fact that the CT will die automatically moves it to TT and can not return.That how in zombie mod.

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
PAlllUCH has written
Hi all,
I would ask someone to write scripts, namely, the script has to rely on the fact that the CT will die automatically moves it to TT and can not return.That how in zombie mod.


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

iszombie=array(32)

addhook("die","zombie_die")
function zombie_die(vic,kill)
	if (player(kill,"team") == 1) then
		iszombie[vic]=1
		parse("maket "..vic)
	else
		return 0
	end
end

addhook("team","zombie_team")
function zombie_team(id,team)
	if iszombie[id]==1 and team==1 then
		msg2(id,"You cant join this team")
		return 1
	elseif iszombie[id]==0 and team==1 then
		msg2(id,"You cant join this team")
		return 1
	end
end

addhook("end","zombie_end")
function zombie_end()
	for id = 1,32 do
		if (player(id,"exists")) then
			iszombie[id]=0
			parse("makect "..id)
		end
	end
end

old Re: Lua Scripts/Questions/Help

PAlllUCH
User Off Offline

Quote
I meant is that the TT can reach it whenever you want and add bots to TT. Admin and players in the early rounds can lead to the CT and the CT will die automatically takes the player to CT and TT will die if nothing is happening with him. And in this script is so that you can come to CT, but you can not go to TT, or you can not add bots to TT, and CT after death is not transferred to the TT.T

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
PAlllUCH has written
I meant is that the TT can reach it whenever you want and add bots to TT. Admin and players in the early rounds can lead to the CT and the CT will die automatically takes the player to CT and TT will die if nothing is happening with him. And in this script is so that you can come to CT, but you can not go to TT, or you can not add bots to TT, and CT after death is not transferred to the TT.T


i understand NADA
Stop using translators they are just F*cked, Idk if this i right so u mean

Admins cant put any Bots in TT only in CT and if your CT you cant join TT?

/edit

Can anyone show me how to do an Save script and an Load script
To the start Previous 1 2230 231 232338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview