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 2329 330 331338 339 Next To the start

old Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Quote
How to add special say for vips, moderators, admins, mappers, skiners and scripters?
colors:
vip - 195195195
moderator - 105255000
admin - 255090000
mapper, skinner, scripter - 190000190
like:
1
2
3
vip={12345,54321}
moderator={98765}
admin={15101}
help plz!

old Re: Lua Scripts/Questions/Help

Infinite Rain
Reviewer Off Offline

Quote
Guys i need help with script
When spawn in console got error
Attempt to call a nil value
Dont say where
plllz help!
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
30
31
32
33
34
35
function btp(id,sx,sy,ex,ey,mode)
   local prp
   if mode==1 then prp="" elseif mode==2 then prp="tile" end
   return (player(id,"exists") and player(id,prp.."x")>sx and player(id,prp.."x")<ex and player(id,prp.."y")>sy and player(id,prp.."y")<ey)
end

function initArray(m)
	local array = {}
		for i = 1, m do
	array[i] = 0
	end
return array
end

terrorist=initArray(32)

addhook("spawn","terroristvar")
function terroristvar(id)
	if player(id,"team")==1 then
		terrorist[id]=1
	elseif player(id,"team")==2 then
		terrorist[id]=0
	end
end

addhook("movetile","house")
function house(id)
	if btp(id,29,26,33,30,2) then
		for i=1,32 do
			if player(i,"exists") and terrorist[i]==1 then
				parse("setpos "..i.." 896 608")
			end
		end
	end
end

old Re: Lua Scripts/Questions/Help

archmage
User Off Offline

Quote
DannyDeth has written
Hi all, I just wantd to ask a small question:
What is the appropriate command to draw an image to the screen at certain coordinates?
Thanks ~DannyDeth.

image(path,x,y,mode,pl)
info.txt has written
- image("path",x,y,mode,[pl])     Creates an image (dynamic object) on the map and returns the ID.
                    Mode 0: floor image (covered by players etc)
                    Mode 1: top image (covering players)
                    Mode 2: HUD image (covering everything, part of the interface)
                    Mode 3: super top image (covering everything on the map)
                    Mode 101-132: draw under this player (id+100)
                    Mode 201-232: draw over this player (id+200)
                    Mode 133-164: draw over this player and over entities (id+132)
                    When drawing at player, x and y are used this way:
                    x<=0: do not rotate with player, x>0: rotate img with player
                    y<=0: only draw if not covered by fog of war, y>0: draw always
                    [pl] is an optional parameter. 0 (default value) means that
                    all players see this image. If you set it to a player ID then
                    only this player will see this image!
                    The command returns the ID of the dynamic object image![/code]

old Re: Lua Scripts/Questions/Help

JONY
User Off Offline

Quote
factis699 has written
Guys i need help with script
When spawn in console got error
Attempt to call a nil value
Dont say where
plllz help!
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
30
31
32
33
34
35
function btp(id,sx,sy,ex,ey,mode)
   local prp
   if mode==1 then prp="" elseif mode==2 then prp="tile" end
   return (player(id,"exists") and player(id,prp.."x")>sx and player(id,prp.."x")<ex and player(id,prp.."y")>sy and player(id,prp.."y")<ey)
end

function initArray(m)
	local array = {}
		for i = 1, m do
	array[i] = 0
	end
return array
end

terrorist=initArray(32)

addhook("spawn","terroristvar")
function terroristvar(id)
	if player(id,"team")==1 then
		terrorist[id]=1
	elseif player(id,"team")==2 then
		terrorist[id]=0
	end
end

addhook("movetile","house")
function house(id)
	if btp(id,29,26,33,30,2) then
		for i=1,32 do
			if player(i,"exists") and terrorist[i]==1 then
				parse("setpos "..i.." 896 608")
			end
		end
	end
end


I tested this code and didn't get any errors on respawn. Is that all the code you have? Because the error is most probably there
J.

old Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Quote
RyceR has written
How to add special say for vips, moderators, admins, mappers, skiners and scripters?
colors:
vip - 195195195
moderator - 105255000
admin - 255090000
mapper, skinner, scripter - 190000190
like:
1
2
3
vip={12345,54321}
moderator={98765}
admin={15101}


Make for me script like that please

old Re: Lua Scripts/Questions/Help

Jynxxx
User Off Offline

Quote
RyceR has written
RyceR has written
How to add special say for vips, moderators, admins, mappers, skiners and scripters?
colors:
vip - 195195195
moderator - 105255000
admin - 255090000
mapper, skinner, scripter - 190000190
like:
1
2
3
vip={12345,54321}
moderator={98765}
admin={15101}


Make for me script like that please


do you mean something like this

1
2
3
4
5
6
7
8
if rp_ct[id] == true then
		rp_msg([[196196196]],player(id,[[name]])..[[(ADMIN): ]]..txt)
		return 1
	elseif rp_vip2[id] == true then
		rp_msg([[000255000]],player(id,[[name]])..[[(VIP): ]]..txt)
		return 1
	end
end

old Re: Lua Scripts/Questions/Help

J4x
User Off Offline

Quote
can someone help me with this?
1
2
3
4
5
6
7
8
addhook("die","death")
function death(id)
freeimage(id)
id1=image("gfx/bodyparts.bmp",player(id"tilex"),player(id"tiley"),0)
imagescale(id1,1,1)
imageblend(id1,0)
imagealpha(id1,1.0)
end

it sends me this error: temp to cal local "id" (a number value).

old Re: Lua Scripts/Questions/Help

Chex
User Off Offline

Quote
I will boldify things I point out.

addhook("die","death")
function death(id)
freeimage(id)
img=image("gfx/bodyparts.bmp",player(id,"x"),player(id,"y"),0)
imagescale(img,1,1)
imageblend(img,0)
imagealpha(img,1.0)
end

1-Die has many parameters. Check info.txt for them.

2-Put a number, not just id.

AND, if the player is dead, it does not have an x and y. BUT the hook "die" has an x and y which will let you do this. Here, have a corrected version.

1
2
3
4
5
6
7
8
9
10
deathimg = {}

addhook("die","death")
function death(v,id,w,x,y)
	d = d+1
	deathimg[d]=image("gfx/bodyparts.bmp",x,y,0)
	imagescale(deathimg[d],1,1)
	imageblend(deathimg[d],0)
	imagealpha(deathimg[d],1.0)
end

Can't guarantee that it will work.

old please help Lua!

pk1450
User Off Offline

Quote
USGN CT when the player number 12345 and the rest of the
T is the law there?
Please tell me if
(KOR)ohWill give relief and hate haha

old ABOUT NPC

robed
User Off Offline

Quote
when killing npc give money?


thanks for reply

old Re: Lua Scripts/Questions/Help

Crash13
User Off Offline

Quote
how to make a vip script include MODS, VIPS and ADMINS. And special say for this, LIKE RYCER, Dantes Inferno i put that u say, it's error! WHO make it from me? pls. (In this script me need to include:[Vips, Mods with attributes(HATS)], vote map pressing "F4" and 3 rounds for all maps, and when a guy takes the flag say it to him:"Go win now!")

old Re: Lua Scripts/Questions/Help

JONY
User Off Offline

Quote
FN_Nemesis has written
can someone help me with this?
1
2
3
4
5
6
7
8
addhook("die","death")
function death(id)
freeimage(id)
id1=image("gfx/bodyparts.bmp",player(id"tilex"),player(id"tiley"),0)
imagescale(id1,1,1)
imageblend(id1,0)
imagealpha(id1,1.0)
end

it sends me this error: temp to cal local "id" (a number value).


may be put commas like this:
1
2
3
4
id1=image("gfx/bodyparts.bmp",player(id,"tilex"),player(id,"tiley"),0)
imagescale(id,1,1,1)
imageblend(id,1,0)
imagealpha(id,1,1.0)

old Re: Lua Scripts/Questions/Help

Yasday
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
for i =1,32 do
	img[i] = 0
end

addhook("die","death")
function death(id)
	freeimage(img[id])
	img[id]=image("gfx/bodyparts.bmp",player(id"x"),player(id"y"),0)
	imagescale(img[id],1,1)
	imageblend(img[id],0)
	imagealpha(img[id],1.0)
end
this should work,too.
and it will free the old die img if you die again ...

old Re: Lua Scripts/Questions/Help

J4x
User Off Offline

Quote
thx everyone

EDIT: the solution was this :
1
2
3
4
5
6
7
addhook("die","death")
function death(id)
freeimage(id)id1=image("gfx/bodyparts.bmp",player(id,"x"),player(id,"y"),0)
imagescale(id,1,1,1)
imageblend(id,1,0)
imagealpha(id,1,1.0)
end

@Robed2 try this

1
parse("mp_building_limit:NAME OF THE BUILDING:1000)
edited 1×, last 21.12.10 05:58:15 pm

old Re: Lua Scripts/Questions/Help

Blacko
User Off Offline

Quote
iDios has written
Hello, I search a little script, a player with USGN can talk in red when : !say ... Please help ! Thanks !

Please help !
To the start Previous 1 2329 330 331338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview