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 237 38 39338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Lee
Moderator Off Offline

Quote
-0nyX- has written
Then is there any other lua scriot like that with the abillities to have colored text, auto say, etc? Ive had no luck finding any quite like the one I saw. Or even the one thats on LaG and TGV Servers.


We're running on amx2d - http://amx2d.co.cc

old Re: Lua Scripts/Questions/Help

-0nyX-
User Off Offline

Quote
leegao has written
-0nyX- has written
Then is there any other lua scriot like that with the abillities to have colored text, auto say, etc? Ive had no luck finding any quite like the one I saw. Or even the one thats on LaG and TGV Servers.


We're running on amx2d - http://amx2d.co.cc


Cool. But when I checked it out this is what came to my head. Some jumbled bull$%&! that I couldnt understand. Any help on that? I know how to use scripts but that is a little to complicated for me. Please Help!

old Re: Lua Scripts/Questions/Help

-0nyX-
User Off Offline

Quote
Blazzingxx has written
Amx is to difficult tool for biginers thought.

So better download this Admin Color script:
http://www.unrealsoftware.de/files_show.php?file=1763


Thats not working either. The main thing is that I run the server. I made it. But I cant get it to where it says admin next to my name and my text is colored. The only things I can do are in the console with RCON. I cant have my text in center of screen, cant have colored text, and cant have admin next to my name. I need something simple that will help me get all of those things.

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
Server.lua

Type this code
1
2
3
4
5
6
7
8
9
10
11
--The hook
addhook("say","say1")
--Function of Hook
function say1(id,txt)
	--Who is Admin?You must change the numbers "12345" to your USGN.
	if (player(id,"usgn")==25345) then
		msg("©255255255 "..player( id,"name").." (ADMIN) :"..txt.."")
	--The Return
	return 1
	end
end
Actualy its working for me.
Just see that line :
if (player(id,"usgn")==Your Usgn) then

old Re: Lua Scripts/Questions/Help

-0nyX-
User Off Offline

Quote
Blazzingxx has written
Server.lua

Type this code
1
2
3
4
5
6
7
8
9
10
11
--The hook
addhook("say","say1")
--Function of Hook
function say1(id,txt)
	--Who is Admin?You must change the numbers "12345" to your USGN.
	if (player(id,"usgn")==25345) then
		msg("©255255255 "..player( id,"name").." (ADMIN) :"..txt.."")
	--The Return
	return 1
	end
end
Actualy its working for me.
Just see that line :
if (player(id,"usgn")==Your Usgn) then


So what youre saying is go to sys/lua/server.lua and paste that code in and when you get to the
if (player(id,"usgn")==Your Usgn) then
line then put my USGN where it says
(id,"usgn")
?

old Help!

BetaM
User Off Offline

Quote
I need help, how can I make that here:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
addhook("triggerentity","turbo")
function turbo(x,y)
	if x==6 then
		if y==4 then
			parse('speedmod 1 100')
		end
	end
	if x==10 then
		if y==9 then
			parse('speedmod 1 100')
		end
	end
	if x==7 then
		if y==10 then
			parse('speedmod 1 1')
		end
	end
	if x==10 then
		if y==4 then
			parse('speedmod 1 1')
		end
	end
end
instead of "1" in speedmod will be a player that triggers the entity?

old Re: Lua Scripts/Questions/Help

KimKat
GAME BANNED Off Offline

Quote
@mat5b: I think this code should so well.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
addhook("triggerentity","turbo")
function turbo(id,x,y)
	if player(id, "x")x==6 then
		if player(id,"y")y==4 then
			parse('speedmod "..player(id, "speedmod").." 100')
		end
	end
	if player(id,"x")x==10 then
		if player(id,"y")y==9 then
			parse('speedmod "..player(id, "speedmod").." 100')
		end
	end
	if player(id,"x")x==7 then
		if player(id,"y")y==10 then
			parse('speedmod "..player(id, "speedmod").." 1')
		end
	end
	if player(id,"x")x==10 then
		if player(id,"y")y==4 then
			parse('speedmod "..player(id, "speedmod").." 1')
		end
	end
end

old Re: Lua Scripts/Questions/Help

KimKat
GAME BANNED Off Offline

Quote
mat5b has written
1
...3:"then" expected near "x"
I think not.
Ok, I'm really bad at LUA scripting.

1
[url=http://www.nomorepasting.com/getpaste.php?pasteid=28287]Link to script[/url]
Try this.
edited 1×, last 11.08.09 03:34:26 pm

old Re: Lua Scripts/Questions/Help

DC
Admin Off Offline

Quote
KimKat:
why the hell is there a single x/y without any operator?
1
2
if player(id, "x")[b]x[/b]==6 then
          if player(id,"y")[b]y[/b]==4 then
what is it supposed to do there? it doesn't make any sense and of course it's horribly wrong.

moreover your whole idea is wrong. don't try to help when you can't help

mat5b: It's probably not possible with the current version of CS2D.

old Re: Lua Scripts/Questions/Help

KimKat
GAME BANNED Off Offline

Quote
I know, that's why I removed them x and y's, the script gives no errors now. Although it seems that it's not working with current version as DC said.

And yea I should stop helping people with LUA.

old Re: Lua Scripts/Questions/Help

Lee
Moderator Off Offline

Quote
@kimkat - x and y returns the absolute 'pixel' location of the player. Try the tile version of x and y instead.

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
KimKat has written
And yea I should stop helping people with LUA.


Just keep trying harder
It will come the day that you'll get good with Lua

old Re: Lua Scripts/Questions/Help

PlayerNoob
User Off Offline

Quote

AMX2D help pls:

How do you make @speedall 100?



1
2
3
4
5
6
function adm_speed_admin(p, typ, cmd)
	cmd = args(cmd, "id_id, speed")

	if not cmd.id then return end
	parse (string.format("speedmod %s %s",cmd.id, cmd.speed))
end

so... i'm trying to change it to...

1
2
3
4
function adm_speedall_admin(p, typ, cmd)
	cmd = args(cmd, "all, speed")

end

old Re: Lua Scripts/Questions/Help

Lee
Moderator Off Offline

Quote
1
2
3
4
5
function adm_speedall_admin(p, typ, cmd) 
	for i = 1, 32 do
		parse (string.format("speedmod %s %s",i, cmd)) 
	end
end

Add this into basic.lua or as a new mod

old Re: Lua Scripts/Questions/Help

KaiserWilhelm
User Off Offline

Quote
I got this code off of the forum about 2 weeks ago and i don't know whats worng with it, it won't work. Can anyone debug and test for me please?

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
36
37
infectedpl = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}

--Hooks
addhook("join","infzero")
addhook("second","isinf")
addhook("hit","infect")

--Functions
function infzero(id)
     infectedpl[id] = 0
end
function infect(id,source,weapon,hpdmg,apdmg)
     if (player(source,"team") == 1) then
          if (weapon == 78) then
               local rand = math.random(1,5)
               if (rand == 3) then
                    infectedpl[id] = 1
               end
          end
     end
end 
function isinf()
     for i=1,32 do
          if(player(i,"exists")) then
               if(infectedpl[i]==1 and player(i,"team")==2) then
                    if(player(i,"health")<=10) then --If player is about to be turned into zombie
                         local x = player(i,"x")
                         local y = player(i,"y")
                         parse("maket "..i)
                         parse("spawnplayer "..i.." "..x.." "..y)
                    else
                         parse("sethealth "..i.." "..(player(i,"health")-10))
                    end
               end
          end
     end
end

Dammit, The code box is messing with the spacings.
To the start Previous 1 237 38 39338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview