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 2292 293 294338 339 Next To the start

old Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Quote
Its possible to make position saves in sys/lua/position.txt file like this?:
1
2
3
15101 25 100
23205 814 43
34201 973 115

old Re: Lua Scripts/Questions/Help

Tajifun
User Off Offline

Quote
Hey guys.
I got a small problem, concerning the tibia script.
It's a good script of course, but there is a big problem as well.

The most player doesn't pick up their loot anymore.
So the server crashes, because there are to many images
displayed on the ground.

Please could anybody help me to make a kind of "items-removing-script".

It should be something like:
Every 5 minutes all items should be removed..

Thanks in advance! (:

old Re: Lua Scripts/Questions/Help

Horazont
User Off Offline

Quote
i have a script to ask for u peepz.
this one i need is one that can make ONLY the admins of the server see what dead ppl says(if possible)
if anyone can make it,send me a pm please

old Re: Lua Scripts/Questions/Help

Jaller94
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
admins = { 1, 1234 } -- USGNs der Admins

addhook("say", "adminheardead")

function adminheardead(id, text)
	if (player(id,"health")==0) then
		for i=1,32,0 do
			if (player(id,"usgn")==admins[]) then
				msg2(i,player(id,"name")..": "..text)
			end
		end
	end
end

old Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Quote
Correction to FlooD,
The whole script should be this:
1
2
3
4
5
6
7
8
9
10
11
12
admins={1,1234}--usgns

function admindh(i,t)
	if player(i,"health")<1 then
		for x=1,#admins do
			if player(i,"usgn")==admins[x] then
				msg2(i,player(i,"name")..': '..t)
			end
		end
	end
end
addhook('say','adminh')

old Re: Lua Scripts/Questions/Help

TDShuft
User Off Offline

Quote
CmDark has written
Correction to FlooD,
The whole script should be this:
1
2
3
4
5
6
7
8
9
10
11
12
admins={1,1234}--usgns

function admindh(i,t)
	if player(i,"health")<1 then
		for x=1,#admins do
			if player(i,"usgn")==admins[x] then
				msg2(i,player(i,"name")..': '..t)
			end
		end
	end
end
addhook('say','adminh')

...
another correction :
1
2
3
4
5
6
7
8
9
10
11
12
13
admins={1,1234}--usgns
addhook('say','adminh')
function admindh(i,t)
	if player(i,"health")<1 then
		for id=1,32 do
		for x=1,#admins do
			if player(id,"usgn")==admins[x] then
				msg2(id,player(i,"name")..'(DEAD): '..t)
			end
end
		end
	end
end

old Re: Lua Scripts/Questions/Help

TDShuft
User Off Offline

Quote
CmDark has written
@TDShuft, that is not a correction

he want like if a player talks while dead all admins that are alive hear
look you giving the msg2() I not to ID then the player who speakin dead is giving msg to his self

old Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Quote
That's a weird script he wants o-o...
Even if the admin is dead, he will get the message
spam for the admins ftw?
not to mention that the admin talking will also result in him getting a message of his own text

old Re: Lua Scripts/Questions/Help

TDShuft
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
admins={1,1234}--usgns
addhook('say','adminh')
function admindh(i,t)
     if player(i,"health")<1 then
          for id=1,32 do
          if id~=i then
          if player(id,"health")~=0 then
          for x=1,#admins do
               if player(id,"usgn")==admins[x] then
                    msg2(id,player(i,"name")..'(DEAD): '..t)
               end
end
end
end
          end
     end
end
done ..
edited 1×, last 28.10.10 01:28:58 am

old Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Quote
Nope not done yet
you haven't added a check for if admin's health is not below 1.
So.. he will still get a message if he is also dead

Edit: Alright now that you fixed it, need help with anything?
I've got some free time and my scite is open for corrections~

old Re: Lua Scripts/Questions/Help

The Camo
User Off Offline

Quote
admins={1,1234}--usgns
addhook('say','adminh')
function adminh(id,txt)
if player(id,"health") <= 1 then
if player(id,"usgn") == admins then
msg2(id,..player(id,'name')..'(DEAD): '..txt)
end
end
end

Try this, haven't tested it.

old Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Quote
@The Camo
You are soooo late..

btw that script tells that if the person saying something's health is equal to or less than 1 then it will check if the usgn of the player is equal to a table(a nil operation) and then afterward make it so that it messages himself as a dead person with his own message

old Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Quote
There's nothing I know that can do that other than using hudtxt to do that since hudtxt is the only thing that uses screen x and y instead of tiles (x,y)

old Re: Lua Scripts/Questions/Help

FlooD
GAME BANNED Off Offline

Quote
Gloke has written
i have a script to ask for u peepz.
this one i need is one that can make ONLY the admins of the server see what dead ppl says(if possible)
if anyone can make it,send me a pm please

omg....
ok
1. if admin is alive, then msg2 to him all messages made by dead people.
2. if admin is dead, do nothing.

@cmdark: you don't need to run a for loop over the admin table. just do this:
1
2
3
4
5
6
7
8
9
10
11
admins={[1234]=1,[345]=1,[456]=1}
addhook("say","asdf")
function asdf(p,t)
	if player(p,"health")=0 then --only dead players
		for i=1,32 do
			if admins[player(i,"usgn")] and player(i,"health")~=0 then --only to alive admins
				msg2(i,player(p,"name").." *DEAD*: "..t)
			end
		end
	end
end

@cmdark's post above: you didn't understand... he wants the absolute position of the player's pointer (which afaik is impossible with the documented lua in info.txt at least).

old Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Quote
@Flood yeah I used to use that but eh.. gotta add extra stuff into table and if you wanted to do that in game..eh better to use loop.

and the second thing, I did understand, the mouse pointer uses the screen x and y, which would be something that you could try to "emulate" with hudtxt
To the start Previous 1 2292 293 294338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview