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 2329 330 331338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Zitieren
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!

alt Re: Lua Scripts/Questions/Help

Infinite Rain
Reviewer Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

archmage
User Off Offline

Zitieren
DannyDeth hat geschrieben
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 hat geschrieben
- 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]

alt Re: Lua Scripts/Questions/Help

JONY
User Off Offline

Zitieren
factis699 hat geschrieben
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.

alt Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Zitieren
RyceR hat geschrieben
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

alt Re: Lua Scripts/Questions/Help

Jynxxx
User Off Offline

Zitieren
RyceR hat geschrieben
RyceR hat geschrieben
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

alt Re: Lua Scripts/Questions/Help

J4x
User Off Offline

Zitieren
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).

alt Re: Lua Scripts/Questions/Help

Chex
User Off Offline

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

alt please help Lua!

pk1450
User Off Offline

Zitieren
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

alt ABOUT NPC

robed
User Off Offline

Zitieren
when killing npc give money?


thanks for reply

alt Re: Lua Scripts/Questions/Help

Crash13
User Off Offline

Zitieren
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!")

alt Re: Lua Scripts/Questions/Help

JONY
User Off Offline

Zitieren
FN_Nemesis hat geschrieben
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)

alt Re: Lua Scripts/Questions/Help

Yasday
User Off Offline

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

alt Re: Lua Scripts/Questions/Help

J4x
User Off Offline

Zitieren
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)
1× editiert, zuletzt 21.12.10 17:58:15

alt Re: Lua Scripts/Questions/Help

Blacko
User Off Offline

Zitieren
iDios hat geschrieben
Hello, I search a little script, a player with USGN can talk in red when : !say ... Please help ! Thanks !

Please help !
Zum Anfang Vorherige 1 2329 330 331338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht