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 290 91 92338 339 Next To the start

old Re: Lua Scripts/Questions/Help

mafia_man
User Off Offline

Quote
lol its very easy ... (only add else)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function serveraction(id,action)
     if (action == 1) then
          menu(id,"Main Menu,Buy Menu >>,Inventory >>,Bounty >>,Manage Data >>") else
     end
     if (action == 2) then
          menu(id,"Buy Menu Main,Primary Ammo|$00.005,Secondary Ammo|$00.005,Armor >>,Weapons >>,Miscellaneous >>,Air-Strikes >>,Special Items >>,Back <<")
     end
end

function menu(id,xmenu,select)
	if (xmenu == "Main Menu") then
		if (select == 1) then menu(id,"Buy Menu Main,Primary Ammo|$00.005,Secondary Ammo|$00.005,Armor >>,Weapons >>,Miscellaneous >>,Air-Strikes >>,Special Items >>,Back <<") else
		end
		if (select == 2) then menu(id,"Inventory Main,Armor >>,Weapons >>,Miscellaneous >>,Air-Strikes >>,Special Items >>,Back <<") else
		end
		if (select == 3) then menu(id,"Bounty Menu,Pay Bounty >>,Back <<") else
		end
		if (select == 4) then menu(id,"Manage Data Menu,Save Game >>,Load Game >>,Auto-Save Settings >>,Back <<")
		end
	end
end

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
I think you are doing this in the wrong way.
But try this
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function serveraction(id,action)
	if (action == 1) then
		menu(id,"Main Menu,Buy Menu >>,Inventory >>,Bounty >>,Manage Data >>")
	elseif (action == 2) then
		menu(id,"Buy Menu Main,Primary Ammo|$00.005,Secondary Ammo|$00.005,Armor >>,Weapons >>,Miscellaneous >>,Air-Strikes >>,Special Items >>,Back <<")
	end
end

function menu(id,xmenu,select)
	if (xmenu == "Main Menu") then
		if (select == 1) then
			menu(id,"Buy Menu Main,Primary Ammo|$00.005,Secondary Ammo|$00.005,Armor >>,Weapons >>,Miscellaneous >>,Air-Strikes >>,Special Items >>,Back <<")
		elseif (select == 2) then
			menu(id,"Inventory Main,Armor >>,Weapons >>,Miscellaneous >>,Air-Strikes >>,Special Items >>,Back <<")
		elseif (select == 3) then
			menu(id,"Bounty Menu,Pay Bounty >>,Back <<")
		elseif (select == 4) then
			menu(id,"Manage Data Menu,Save Game >>,Load Game >>,Auto-Save Settings >>,Back <<")
		end
	end
end

old Re: Lua Scripts/Questions/Help

craza424
User Off Offline

Quote
I was wondering if you can make a script where the script is set to 1 id and when you put a mine down and you say !bomb it explode's on command like C4.
If so could someone make it... I couldn't make a script if my life depended on it...

P.S. I ment a Unreal Software ID

EDIT: By the way DO NOT send me message's with how to use LUA, I have tryed and I cannot.
edited 1×, last 15.11.09 05:27:56 pm

old Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Quote
can anyone give me an example of how to use new timers ?
i don't understand it too much with the info.txt :S
also can someone explain me the images thing ?
thanks

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
function my_function(message)
	parse("sv_msg "..message)
end

timer
(
	1000*60,      --1000*60 milliseconds = One minute
	my_function, --Call my_function() every minute
	"Welcome :D", --We will pass this little nice msg.
	0                   --Repeat the timer forever, or until it's freed
)

This way you will call the function my_function() once per minute until its freed or you shut the server down

old Re: Lua Scripts/Questions/Help

Chunks
User Off Offline

Quote
hey can some1 give me god script to amx2d ?
like
function adm.god.superadmin

and the script i really need it to my server
my sv lags me much
then i recive much kill yes i am good but
the new version lags much :p

EDIT:
The God I mean its like unvunerable
no health
no die
inf hitpoints
edited 1×, last 16.11.09 02:02:02 am

old Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Quote
@Flacko
thanks Flacko
@anyone else
can you give me an image exaple ?
one that uses all image "things"(image,imagecolor,imagealpha,imageblend,imagescale,imagepos)
explain it if you can too please

old Re: Lua Scripts/Questions/Help

playa slaya
COMMUNITY BANNED Off Offline

Quote
what is booleen ?
@wilson
you need a custom function for that
1
2
3
4
5
function img_draw(id,file,color,alpha,blend,scale,pos,rot)
	image(file)
	imagecolor(color)
	--And so on
end

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
A boolean variable is a variable that can be 1 or 0 (true or false).
It occupies one bit of RAM in most programming languages...

old Re: Lua Scripts/Questions/Help

Night Till Death
User Off Offline

Quote
hey guyz can you please help me with my script it doesnt work
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-- Say2 !impulse101
addhook("say","impulse")
function impulse(id,txt,p)
        if(txt=="!impulse101") then
          parse ("equip "..id.." 83")
          parse ("equip "..id.." 45")
          parse ("equip "..id.." 88")
          parse ("equip "..id.." 87")
          parse ("equip "..id.." 74")
          parse ("equip "..id.." 10")
          parse ("equip "..id.." 3")
          parse ("equip "..id.." 35")
          parse ("equip "..id.." 55")
          parse ("equip "..id.." 56")
          parse ("equip "..id.." 48")
          parse ("equip "..id.." 49")
          parse ("equip "..id.." 64")
end

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
@NTD: Is that your WHOLE script?
The part you gave us seems to be ok, because you haven't used the last (unexistant) parameter...
edited 1×, last 16.11.09 05:26:58 pm
To the start Previous 1 290 91 92338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview