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 286 87 88338 339 Next To the start

old Re: Lua Scripts/Questions/Help

BetaM
User Off Offline

Quote
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.

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

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

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

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
Blazzingxx has written
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
edited 1×, last 11.11.09 06:15:59 pm

old Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Quote
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

old Re: Lua Scripts/Questions/Help

wups
User Off Offline

Quote
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 >

old Re: Lua Scripts/Questions/Help

DC
Admin Off Offline

Quote
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])

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
playa slaya has written
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

old Re: Lua Scripts/Questions/Help

NozliW
User Off Offline

Quote
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

old Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Quote
-WiLSoN- has written
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.

old Re: Lua Scripts/Questions/Help

playa slaya
COMMUNITY BANNED Off Offline

Quote
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

old Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Quote
-WiLSoN- has written
@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.
To the start Previous 1 286 87 88338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview