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 219 20 21338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

Kaka024
User Off Offline

Zitieren
guys. What's wrong here?

1
2
3
4
5
6
7
8
9
10
11
addhook("die","killed")

function killed(n)
parse("sv_msg2 " ..n.. " You got killed! Wait in the cage for a rescue!@C")

if (player(n,"team")=="2") then
parse("spawnplayer " ..n.." 1000 1200")
else
parse("spawnplayer " ..n.. " 1000 1000")
end
end
It spawns me only at 1000x1000 position. Whatever team i have.

alt Re: Lua Scripts/Questions/Help

sonnenschein
User Off Offline

Zitieren
maybe because if you put something in " " its thinks its a text. Try without quotes
ooops, i didn't say where you need to remove quotes:

in line:
if (player(n,"team")=="2") then

remove quotes at 2

alt Re: Lua Scripts/Questions/Help

sonnenschein
User Off Offline

Zitieren
wups hat geschrieben
I think im dumb or it's something wrong with my function.


What is really wrong in this code?
It can find x and y.
But it can't check if x is 1, and y is 4.

1
2
3
4
5
6
7
8
addhook("use","omg")
function omg(p,e,d,x,y)
	msg(" "..x.." "..y)
	if (x==1) and (y==4) then
		msg(doh)
		parse("equip "..p.." 30") 
	end
end

Heavy, nothing is impossible.
Sockets or a file with ips to many locations.

umm, wrong? whats that (doh) doing? isn't it supposed to be msg("doh"), or im just being stupid?

alt Re: Lua Scripts/Questions/Help

sonnenschein
User Off Offline

Zitieren
Whats the problem? you don't get the item?

EDIT: Can someone please help me make a menu under a menu. Im having trouble with when i select a button on a menu, i want it open a new menu.
1× editiert, zuletzt 24.06.09 22:39:20

alt Re: Lua Scripts/Questions/Help

Lee
Moderator Off Offline

Zitieren
LinuxGuy hat geschrieben
Whats the problem? you don't get the item?


The problem is that wups designed a test-for-failure and lua completely skipped over the conditional loop in the scope of the test. The intended result is to have cs2d return an error, it obviously does not thus constituting as a logical error

@wups: Try add a

1
else print(x.." "..y) end

and then go to the same spot and see if anything's wrong with the coordinates.

alt Re: Lua Scripts/Questions/Help

wups
User Off Offline

Zitieren
Sorry, i'm to stupid.. I got the gun, but i have never looked for it in the 1 menu. What a idiot i'm :p.
1× editiert, zuletzt 25.06.09 11:50:12

alt Re: Lua Scripts/Questions/Help

wups
User Off Offline

Zitieren
@LinuxGuy

Nice work, never thinked to create like that before.
Can be it's to hot here. :p

Hmm, seems not that it decrease the money for me.

alt Re: Lua Scripts/Questions/Help

KimKat
GAME BANNED Off Offline

Zitieren
Where is the script to return a players position/coordinates while playing on a map? I think someone had a script like that, Hitsugaya if I remember correctly.

I need that script. It's pretty useful. You could say "@position" and it would print my exact location. Pretty cool script.

I wanna ask if someone has a script like that?

alt Re: Lua Scripts/Questions/Help

ohaz
User Off Offline

Zitieren
1
2
3
4
5
6
addhook("say", "positions")
function positions(id,txt)
	if (txt == "positions") then
		msg2(id, "X: "..player(id, "x").." Y: "..player(id,"y").." TileX: "..player(id, "tilex").." TileY: "..player(id, "tiley").." !")
	end
end

alt Re: Lua Scripts/Questions/Help

KimKat
GAME BANNED Off Offline

Zitieren
TheKilledDeath hat geschrieben
1
2
3
4
5
6
addhook("say", "positions")
function positions(id,txt)
	if (txt == "positions") then
		msg2(id, "X: "..player(id, "x").." Y: "..player(id,"y").." TileX: "..player(id, "tilex").." TileY: "..player(id, "tiley").." !")
	end
end
How can I add text color to that without ruining everything?

alt Re: Lua Scripts/Questions/Help

sonnenschein
User Off Offline

Zitieren
KimKat hat geschrieben
How can I add text color to that without ruining everything?

1
2
3
4
5
6
addhook("say", "positions")
function positions(id,txt)
	if (txt == "positions") then
		msg2(id, "©000000000X: "..player(id, "x").." Y: "..player(id,"y").." TileX: "..player(id, "tilex").." TileY: "..player(id, "tiley").." !")
	end
end

put your number in 000000000 (delete 0's)

alt Re: Lua Scripts/Questions/Help

wups
User Off Offline

Zitieren
Zitat
© before the numbers.

R     G     B
000 000 000

000000000 = Black
134134134 = Grey
255255255 = White

255000000 = Red
000255000 = Green
000000255 = Blue

255255000 = Yellow
255000255 = purple
000255255 = Lightblue


leeago created a good script to only use rgb(0,0,0) instead of ©000000000. But don't know where it is now :p

alt Re: Lua Scripts/Questions/Help

KimKat
GAME BANNED Off Offline

Zitieren
I know how to add colors already, that's like the easy part in lua. And still no one has replied on how to make a HEV suit recharger in lua.

The one who makes that will be officially the master of lua in the whole unrealsoftware forum.

Anyone up for the challenge? read my post one page back!
Zum Anfang Vorherige 1 219 20 21338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht