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 2113 114 115338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

ohaz
User Off Offline

Zitieren
Yeah, I was to lazy to finish it. I have a version on my harddrive where I started the "Making a little menu" part, but I had much to do with school and it also didn't make fun anymore. Perhaps I'll finish it sometimes, but I don't know when this will be.

alt Re: Lua Scripts/Questions/Help

KimKat
GAME BANNED Off Offline

Zitieren
Deatherr hat geschrieben
How do you make a bank lua?So you can deposit and withdraw money? ( also to have more than 16000)
MiroslavR is working on stuff like that, and no 16000 is the limit of the $ currency, with LUA you can create your own currency.

alt Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Zitieren
you have to do an array for that like:
1
2
3
4
5
6
7
8
9
function array(m)
	local array = {}
	for i = 1, m do
		array[i] = 0
	end
	return array
end
money = array(32) -- you can also set a maxplayers value and use that value instead of 32
bank_money = array(32)
you'll also have to do ways of getting money... obviously.
and the bank... it should be a menu with deposit and withdraw options, you choose the values.
Spoiler >

alt Re: Lua Scripts/Questions/Help

Starkkz
Moderator Off Offline

Zitieren
Here is.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function initArray(m) 
     local array = {} 
     for i = 1, m do 
          array[i] = 0 
     end 
     return array 
end 

money = initArray(32)

addhook("kill","max_mn")
function max_mn(id,victim,x,y,wpn)
	money[id] = money[id]+300
end

this part is for kill. next need buy menu with f2, or doesn't work the buy menu.

alt Re: Lua Scripts/Questions/Help

Deatherr
User Off Offline

Zitieren
-WiLSoN- hat geschrieben
you have to do an array for that like:
1
2
3
4
5
6
7
8
9
function array(m)
	local array = {}
	for i = 1, m do
		array[i] = 0
	end
	return array
end
money = array(32) -- you can also set a maxplayers value and use that value instead of 32
bank_money = array(32)
you'll also have to do ways of getting money... obviously.
and the bank... it should be a menu with deposit and withdraw options, you choose the values.
Spoiler >


Is that the whole script for the bank? ... i Don't see in the script that you can open the bank menu ...(no offense)
1× editiert, zuletzt 11.12.09 03:24:17

alt Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Zitieren
Deatherr hat geschrieben
Is that the whole script for the bank? ... i Don't see in the script that you can open the bank menu ...(no offense)

Obviously it isn't the whole script, if you are going to make a map for the script then you can use the "usebutton" or "trigger" hook, to open the bank menu, also you can do it with serveractions and etc,also you have to do ways of winning money, can be by killing,building and etc
Good Luck

alt Re: Lua Scripts/Questions/Help

memo
COMMUNITY BANNED Off Offline

Zitieren
Hi guys i just want to make a Fun Game Mod
can you please help me the script must give you s weapon every round i make the No drop and No buy script but this msg show's when i enter the map on console :
LUA ERROR : attempt to call a nil value

the Script is :
Spoiler >


please Help me

alt Re: Lua Scripts/Questions/Help

RAVENOUS
BANNED Off Offline

Zitieren
Lol, you want to make the same script like me. It works with random..I post it here.

But then please notice me in the Credits
1× editiert, zuletzt 11.12.09 16:23:15

alt Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Zitieren
memo hat geschrieben
Hi guys i just want to make a Fun Game Mod
can you please help me the script must give you s weapon every round i make the No drop and No buy script but this msg show's when i enter the map on console :
LUA ERROR : attempt to call a nil value

the Script is :
Spoiler >


please Help me


try restart CS2D, this problem fixed after I restart CS2D
if work.

alt Re: Lua Scripts/Questions/Help

memo
COMMUNITY BANNED Off Offline

Zitieren
so you know why the random script didnot work and what the mean of that msg ??

@Admirdee
same same nothing happen the msg still go on console every time i play on script
1× editiert, zuletzt 11.12.09 16:24:49

alt Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Zitieren
Hmm, no just restart CS2D (Admirdee, that's hook nil):
1
2
addhook("startround","[b]FunGame[/b]")
function [b]Fun[/b](id)
Does Startround hook have ID parameter? Answer - No.

alt Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Zitieren
Blazzingxx hat geschrieben
Hmm, no just restart CS2D (Admirdee, that's hook nil):
1
2
addhook("startround","[b]FunGame[/b]")
function [b]Fun[/b](id)
Does Startround hook have ID parameter? Answer - No.


lol. I don't see the hook and function x_x
and yes, startround only have mode parameter

@memo

1
2
addhook("startround","FunGame")
function FunGame()

have you try this?

alt Re: Lua Scripts/Questions/Help

memo
COMMUNITY BANNED Off Offline

Zitieren
its not work ether with make FunGame()

but the confuse thing that no drop script and no buy script work ?!


thanks Blazzingxx very much its my first script and i am so confuse !

and by the way what the function to add a msg every (time)
same same the one you put on your script like
Gun Game Mod By Blazzingxx
....
can you edit to it to .

alt Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Zitieren
Ok, that's my script.
In this system you can simple add 10 weapons for each level.
Just edit weapons table:
1
weapons_table[b][round][weapon][/b]
That's enough for you?

Random Weapon Rounds By Blazzingxx
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
addhook("startround","fun_startround")
addhook("buy","fun_buy")
addhook("drop","fun_drop")

weapons_table = {{38,21},{11},{24,5},{30,51},{32,51},{34,35},{87,88},{10,47}} -- [Round][Weapons]
speed_table = {0,0,0,0,0,0,0,0,0} -- Table Of Speed For Each Level

function fun_startround()
	local i
	local m
	local msg_wpn = ""
	local items = math.random(1,#weapons_table)
	for i = 1,32,1 do		
		for m = 1,#weapons_table[items],1 do
			parse("equip "..i.." "..weapons_table[items][m])
		end
		if (speed_table[items] == true) then
			parse('speedmod '..i..' '..speed_table[items])
		end
	end
	for i = 1, #weapons_table[items] do
		if (i > 1) then
			msg_wpn = msg_wpn.." + "
		end
		msg_wpn = msg_wpn..""..itemtype(weapons_table[items][i],"name")
	end
	msg("©000255000"..msg_wpn.." Round!@C")
end

function fun_buy()
	return 1
end

function fun_drop()
	return 1
end
3× editiert, zuletzt 11.12.09 17:04:01

alt Re: Lua Scripts/Questions/Help

Deatherr
User Off Offline

Zitieren
-WiLSoN- hat geschrieben
Deatherr hat geschrieben
Is that the whole script for the bank? ... i Don't see in the script that you can open the bank menu ...(no offense)

Obviously it isn't the whole script, if you are going to make a map for the script then you can use the "usebutton" or "trigger" hook, to open the bank menu, also you can do it with serveractions and etc,also you have to do ways of winning money, can be by killing,building and etc
Good Luck


I'm going to mess up the bank lua so bad XD...
Zum Anfang Vorherige 1 2113 114 115338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht