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 2170 171 172338 339 Next To the start

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
Vectar666, Soory, I'm too late because of time zone :I

@Kaka024,
1
parse('hudtxt2 '..id..' [b]100[/b] "©255000000Failed to Login!" 40 415')
Slots are only from 0 to 49.
That's all with your "error"
Quote
i modified smb's script

What's smb script?
I think that's really old my script. (Seems like that because of variables names and texts)

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
@Kaka:
Try this shit:
Spoiler >


Also, I think you should test this from the dedicated server, or instead you can just start the server from the New Game option and in console you should write lua load(1)

old Re: Lua Scripts/Questions/Help

Kaka024
User Off Offline

Quote
@blazzingxx
that was hero mod with lvls, exp and credits including your save&load system. I hope i may use it.


------------------------
working on another (my own this time) script. What's wrong here?:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function skin(id)
  usgn = player(id,"usgn")
if
(usgn==64641 or usgn==28380 or usgn==29870)
then
msg2(id,"Welcome vip!")
image("players/k_vip",1,0,201)
end
end

addhook("join","skinvip")
function skinvip()
skin(id)
end
line 2, error with argument #1 (number expected, got nil).
Any1 can help?
---------------------

Ok. Now another thing with that credit script. Yea i know, but now i've noticed the number of credits RESET after each restart (so i couldnt test it even when it worked because i canceled server and started it again!). So players can get 10000 credits but after restart they have 0 (even if in file is 50, which changes after they disconnect).

Here's the whole code:
Spoiler >
edited 4×, last 05.03.10 07:16:39 am

old Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Quote
@Kaka You kind-of forgot to add the ID parameter to function skinvip()

change it to function skinvip(id)

BTW

TO EVERYONE IN THIS FORUM

DO NOT USE THIS CODE T_T

1
2
3
4
5
6
for armmapx=0,map("xsize") do
		for armmapy=0,map("ysize") do
	parse("explosion "..armmapx.." "..armmapy.." 1 50 0")
		end
	end
	msg("©255100100Armageddon Has Started!@C")

This shit ... lagged my computer(not normal lag(was hella fkin lag)) for like 5 minutes.... taskmanager took 2 minute to appear T_T

I feel hella dumb for using it

old Re: Lua Scripts/Questions/Help

Kaka024
User Off Offline

Quote
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
function skin(id)
  usgn = player(id,"usgn")
  ip = player(id,"ip")
if
(usgn==64641 or usgn==28380 or usgn==29870 or usgn==14751 or ip=="192.168.1.10")
then
msg2(id,"Welcome vip!")
end
end

function skin2(id)
  usgn = player(id,"usgn")
  ip = player(id,"ip")
if
(usgn==64641 or usgn==28380 or usgn==29870 or usgn==14751 or ip=="192.168.1.10")
then
image("gfx/player/k_vip.bmp",1,0,101)
end
end

addhook("join","skinvip")
function skinvip(id) 
skin(id)
end

addhook("startround","skinvip2")
function skinvip2(id) 
skin2(id)
end

Thx, but it doesn't show image (message is shown).
image source is good im sure. It's in gfx/player/k_vip.bmp.
No errors so i don't know what's wrong.

old Re: Lua Scripts/Questions/Help

DC
Admin Off Offline

Quote
it has a mode id but this is NOT a player ID. so it's not going to work. max. 1 player will get a skin this way (the one that coincidentally matches the mode id)
the spawn hook would be a better alternative probably (it has a player ID parameter).

you can read everything in sys/lua/info.txt

old Re: Lua Scripts/Questions/Help

Kaka024
User Off Offline

Quote
NVM! GOT ALL WORKING!
if i have some trouble ill ask you.
Still need help with credit script.
edited 2×, last 05.03.10 07:18:43 pm

old Re: Lua Scripts/Questions/Help

Dictatus Papae
User Off Offline

Quote
Iwould need some help with positioning a sprite.
My problem is, that I made a new turret base skin for a mod, but the supply and dispenser uses the same base, but I don't want it to look like it. So I want to know, how to set the position of the sprite above supplys and dispensers (but so it's there in every case).

old Re: Lua Scripts/Questions/Help

iCe4147
User Off Offline

Quote
Can anyone please help me! i need script that a map button will trigger it

example: when trigger map button it opens a certain menu and such like a bank!

old Re: Lua Scripts/Questions/Help

Kaka024
User Off Offline

Quote
Yamato4147 has written
Can anyone please help me! i need script that a map button will trigger it

example: when trigger map button it opens a certain menu and such like a bank!


In lua folder you have "info.txt". Open it and look for hook "ontrigger" or something like that.

@edit
I've got another problem now (you won't get rid of me!)

I want vips to be able to say in color (when they're not dead) and to hide their normal messages (when they're not dead). But when i use it, i see double messages (normal and colored one) and i can't use "!" commands (they just doesn't work)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("say","vipmsg")
function vipmsg(id,wiadom)
nick = player(id,"name")
if
(usgn==64641 or usgn==28380 or usgn==29870 or usgn==14751 or ip=="192.168.1.10")
then
if
(hp>0)
then
msg("©160160255"..nick..": "..wiadom)
return "1"
end
end
end
edited 1×, last 06.03.10 09:32:07 am

old Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Quote
@kaka
wrong return..
its
1
return 1
PLUS

you didn't use usgn = player(id,"usgn") or ip=player(id,"ip")
which messes this up..
try this
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("say","vipmsg")

function vipmsg(id,txt)
usgn=player(id,"usgn")--now usgn is the player's usgn
ip = player(id,"ip")--Player's IP
if (usgn==64641 or usgn==28380 or usgn==29870 or usgn==14751 or ip==192.168.1.10)
then 
if (player(id,"health")>0) and (string.sub(txt, 1, 1)~="!") then
msg("©160160255"..player(id,"name")..": "..txt)
return 1
else
return 0
end
end
end

old Re: Lua Scripts/Questions/Help

Sleepin
User Off Offline

Quote
he means that CC dropping money script,btw I can't get how to make a menu working,when someone presses the button on the menu it just does nothing.

old Re: Lua Scripts/Questions/Help

LV
BANNED Off Offline

Quote
No not the dropping lol.. thats easy to script but
i need credits script the thing you can have more then 16000$ :S
To the start Previous 1 2170 171 172338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview