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 2231 232 233338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

Snake_Eater
User Off Offline

Zitieren
Hi all I want to make a time script.
But the hudtxt does not work.
I want that the hudtxt(time) appears at the right site!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
h = 0
min = 0
sec = 0

addhook ("ms100","a")
function a()
sec = sec + 6
if sec==60 then
sec = 0
min = min + 1
     if min==60 then
     min = 0
     h = h + 1
         if h==24 then
         h = 0
         end
     end
end
end

addhook ("ms100","b")
function b()
parse ("hudtxt 1 "..h..":"..min..":"..sec.." 550 20 0")--Here I need help! 
end

The text appears in the upper left corner and not top right.

HELP PLS!

alt Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Zitieren
Snake_Eater hat geschrieben
Hi all I want to make a time script.
But the hudtxt does not work.
I want that the hudtxt(time) appears at the right site!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
h = 0
min = 0
sec = 0

addhook ("ms100","a")
function a()
sec = sec + 6
if sec==60 then
sec = 0
min = min + 1
     if min==60 then
     min = 0
     h = h + 1
         if h==24 then
         h = 0
         end
     end
end
end

addhook ("ms100","b")
function b()
parse ("hudtxt 1 "..h..":"..min..":"..sec.." 550 20 0")--Here I need help! 
end

The text appears in the upper left corner and not top right.

HELP PLS!


change
1
550 20 0

alt Re: Lua Scripts/Questions/Help

proxe
User Off Offline

Zitieren
hey, just a quick question.
Why is it that bots stand still in some custom maps when there is a visible easy to go path for them to use?

alt please script

murilog
User Off Offline

Zitieren
someone makes one script to me ? i want , if txt !moneyto <id> <amount> and give money for id , THANK FOR YOUR HELP

alt Re: Lua Scripts/Questions/Help

proxe
User Off Offline

Zitieren
not to be offending but would an english lesson do any damage? its like half the forum cant write decent english
This aint ment to be a flame post just a recomendation to people. Its really hard to understand what that they mean sometimes

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
proxe hat geschrieben
hey, just a quick question.
Why is it that bots stand still in some custom maps when there is a visible easy to go path for them to use?

No idea, this problem is not related to Lua (yet), it has to do with the inner workings of CS2D and it's nothing we can fix with lua.

alt Re: Lua Scripts/Questions/Help

Snake_Eater
User Off Offline

Zitieren
MuH_ hat geschrieben
someone makes one script to me ? i want , if txt !moneyto <id> <amount> and give money for id , THANK FOR YOUR HELP


Here is it!

1
2
3
4
5
6
7
8
9
10
11
addhook ("say","f")
function f(p,t)
local m=t:sub(1,8)
local m2=t:sub(10,11)
local m3=t:sub(12)
if m=="!moneyto" then
   if player(m2,"exists") then
   parse ("setmoney "..m2.." "..player(m2,"money")+m3)
   end
end
end

alt Load File in Lua, but not works!

tom282f3
User Off Offline

Zitieren
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
addhook("say","loadcash")
function loadcash(p,t)
if t=="!load" then
	local usgn, i = player(p,[[usgn]])
	if player(p,[[usgn]]) > 0 then
		msg2(p,[[Your U.S.G.N. ID: ]]..usgn)
		local f = io.open([[data/usgn_stats/]]..usgn..[[.txt]],[[r]])
		if f then
			msg2(p,[[Your Save File Found!@C]])
			for line in f:lines() do
				i = 1
				if (i == 1) then
					bank_money_player[p] = tonumber(line)
				else
					break
				end
			end
			f:close()
			i = 1
		else
			msg2(p,[[We are sorry, but failed to load save!@C]])
		end
	else
		msg2(p,2,[[Please Check Your U.S.G.N. Account Settings!@C]])
	end
end
end

Above, bank_money_player[p] is player's bank's money.

But when I run this script, it says
1
LUA ERROR: bad argument #1 to '?' (function expected, got number)

Pleeeeeeeaase help me!!! It's a important function on my script!!!

alt Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Zitieren
tom282f3 hat geschrieben
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
addhook("say","loadcash")
function loadcash(p,t)
if t=="!load" then
	local usgn, i = player(p,[[usgn]])
	if player(p,[[usgn]]) > 0 then
		msg2(p,[[Your U.S.G.N. ID: ]]..usgn)
		local f = io.open([[data/usgn_stats/]]..usgn..[[.txt]],[[r]])
		if f then
			msg2(p,[[Your Save File Found!@C]])
			for line in f:lines() do
				i = 1
				if (i == 1) then
					bank_money_player[p] = tonumber(line)
				else
					break
				end
			end
			f:close()
			i = 1
		else
			msg2(p,[[We are sorry, but failed to load save!@C]])
		end
	else
		msg2(p,2,[[Please Check Your U.S.G.N. Account Settings!@C]])
	end
end
end

Above, bank_money_player[p] is player's bank's money.

But when I run this script, it says
1
LUA ERROR: bad argument #1 to '?' (function expected, got number)

Pleeeeeeeaase help me!!! It's a important function on my script!!!


1
2
3
4
5
6
7
8
9
function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end

bank_money_player = initArray(32)

this should work, Also the bank_money_player dont exists thats why it didnt work

alt Re: Lua Scripts/Questions/Help

tom282f3
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
function initArray(m)
     local array = {}
     for i = 1, m do
          array[i]=0
     end
     return array
end

bank_money_player = initArray(32)
Well actually I wrote it on another script, and use dofile() to connect, so I think that might not the problem. (I run it and connection is sucessful)

alt Re: Lua Scripts/Questions/Help

Ruirize
User Off Offline

Zitieren
proxe hat geschrieben
hey, just a quick question.
Why is it that bots stand still in some custom maps when there is a visible easy to go path for them to use?


Sorry to follow this up but meh.

The map has no bot_nodes. Bots require nodes spread about the map to work, with each one having a clear line of sight to at least one other, preferably two.

alt Disable Dispenser Limit

tom282f3
User Off Offline

Zitieren
How to disable minimum range of each dispenser by script?

Admin/Mod Kommentar

I deleted this "big" shit. You are not more important than any other user here! /TheKilledDeath

alt Re: Lua Scripts/Questions/Help

ohaz
User Off Offline

Zitieren
Ruirize hat geschrieben
proxe hat geschrieben
hey, just a quick question.
Why is it that bots stand still in some custom maps when there is a visible easy to go path for them to use?


Sorry to follow this up but meh.

The map has no bot_nodes. Bots require nodes spread about the map to work, with each one having a clear line of sight to at least one other, preferably two.
No, maps don't need bot nodes. Bot nodes are fully additional! They just make the chance higher that a bot walks there. But they are not like the old botnodes which had to exist.

alt Help!!!

GreenStatic
User Off Offline

Zitieren
Guys, I see that you know LUA,
Help please, I want to create a mod STALKER and I need a script that will create a lot of monsters on the map and they will kill players)
Just like Pokemon mod...

alt Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Zitieren
@Dark Byte yes i can do this, but i want laser for player at 100dmg and laser for player at 0dmg (from pacman-gaming.de | SpecialFor Server)

@EDIT: Fixed, thx

alt How to type xA9 in Lua

tom282f3
User Off Offline

Zitieren
Well, default serverinfo.txt have some colored text and looks like "?55000000", but when I see them in Notepad++, it's unicode "[xA9]" then "255000000". So I want to ask, how to type [xA9] in Notepad++ or Notepad?
Zum Anfang Vorherige 1 2231 232 233338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht