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 286 87 88338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

BetaM
User Off Offline

Zitieren
Of course. By the way, haven't you noticed that if you put the image function in the always hook the game becomes slow, and after ~30 seconds it crashes... or is it your fixed script.

alt Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Zitieren
I'm not using always hook.
I can't say why your game shutdown.

@Flacko,
Damm, DC said tile() wont work on this version.

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
Blazzingxx hat geschrieben
I'm not using always hook.
I can't say why your game shutdown.


If mat5b is calling the drawhealth() function his game will obviously crash because of this
1
2
3
4
5
if (player(id,"team")==1) then
                    [b]image("gfx/tf2/status_red1.png",70,440,2)[/b]
               elseif (player(id,"team")==2) then
                    [b]image("gfx/tf2/status_blu1.png",70,440,2)[/b]
               end
He's loading an image INTO MEMORY ON EACH FRAME.
Epic crash

Lol, I had the same problem when writing my own game in C++
Then I realized my error
1× editiert, zuletzt 11.11.09 18:15:59

alt Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Zitieren
Off topic: 0.1.1.6 is online woohoo

@flacko mortyr wants to use random function when you spawn for the classes

so you would just need

spawnhook and random function with classes

alt Re: Lua Scripts/Questions/Help

wups
User Off Offline

Zitieren
Hmm, tested the new "images" and recoded the sample code. But something is wrong, and i haven't coded for a long time.

Team 1 = t?
team 2 = ct?

I got blue under all players.

Spoiler >

alt Re: Lua Scripts/Questions/Help

DC
Admin Off Offline

Zitieren
have a look at the new sample code which is included.

the folder is relative to the cs2d folder.
so you have to use something like gfx/myimage.bmp or gfx/somefolder/somefolder/.../myimage.png or something.
always use the gfx folder (or subfolders of this folder) for images.

a server will automatically send missing images to clients (if the clients accept those [see new download option in the net settings])

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
playa slaya hat geschrieben
i have looked but i mean what is this in this string with numbers
1
("gfx/sprites/flare2.bmp",0,0,100+i)


First parameter = Image to load
Second parameter = some random parameter
Third Parameter = See "Second Parameter"
Fourth Parameter = Mode, draw sprite under player

alt Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Zitieren
with the new gfx thing you can add temporal skins ?
i mean skins that you only have when you're on that server.
and how to use the new timers ?
please answer me

alt Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Zitieren
-WiLSoN- hat geschrieben
with the new gfx thing you can add temporal skins ?
i mean skins that you only have when you're on that server.
and how to use the new timers ?
please answer me



Ofr course, super skins new weapons skins suuuper cool xD.

alt Re: Lua Scripts/Questions/Help

playa slaya
COMMUNITY BANNED Off Offline

Zitieren
why this shall never work
1
2
3
4
5
6
7
8
9
10
11
12
13
14
os.draw = image
function playa.slaya.startround(id)
	if (player(id,"team")==1) then
		pl_t = os.draw("gfx/sprites/flare4.bmp",0,0,100)
		imagecolor(pl_t,255,0,0)
		imageblend(pl_t,1)
		imagealpha(pl_t,0.4)
	else
		pl_ct = os.draw("gfx/sprites/flare4.bmp",0,0,100)
		imagecolor(pl_ct,0,0,255)
		imageblend(pl_ct,1)
		imagealpha(pl_ct,0.4)
	end
end
i have also tried without os.draw still did not work

alt Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Zitieren
-WiLSoN- hat geschrieben
@N-B-K
but coult you tell me how ?
or give me an example
also what about the timers ?


You have examples here in the forum, and you have one more in the samples folder.
Zum Anfang Vorherige 1 286 87 88338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht