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 2200 201 202338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Szkieletor
User Off Offline

Quote
0ito has written
I need help to change the limit of setmaxhealth to make a zombie mod(similar to the blazzingxx zombie plague classes)

There is no way to change setmaxhealth limit. It's 250 and nothing will change it. Blazingxx mod uses another container for health, asking him if you can cut this part of script from his mod will be easiest way.

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
How to make a script that when typed !moneylist shows the money of all players?

Also does anyone have an idea on how to make: !setspawnpos and then teleport the player with !teleportme.
Any help is appreciated.
Thank you.

old Re: Lua Scripts/Questions/Help

Heartless Soldier
User Off Offline

Quote
redefinder has written
How to make a script that when typed !moneylist shows the money of all players?

Also does anyone have an idea on how to make: !setspawnpos and then teleport the player with !teleportme.
Any help is appreciated.
Thank you.


1
2
3
4
5
6
7
8
9
10
11
12
addhook("say","onsay")
function onsay(id,message)
	if message=="!moneylist" then
		for i = 1,32 do
			if player(i,"exists") then
				local iname = player(i,"name")
				local imoney = player(i,"money")
				parse('sv_msg2 '..id..' '..iname..' has: '..imoney)
			end
		end
	end
end

Here you are

Explain a bit "!setspawnpos"

EDIT: If I understand what you are thinking to do, don't you think would be better do this:

1
2
3
4
5
6
7
8
9
10
11
12
addhook("say","onsay")
function onsay(id,message)
	for i = 1,32 do
		if message==("!teleportme "..i) then
			local ix = player(i,"x")
			local iy = player(i,"y")
			parse('setpos '..id..' '..ix..' '..iy)
		end
	end
end

--Command:: !teleportme IDofPlayer
edited 4×, last 14.05.10 12:03:19 am

old Re: Lua Scripts/Questions/Help

goweiwen
User Off Offline

Quote
For your teleport thing,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
local spawnpos = {}

addhook("say","onSay")
function onSay(id,message)
	if message == "!setspawnpos" then
		spawnpos[id] = {player(id, 'x'), player(id, 'y')}
	--[[
	elseif message == "!resetspawn" then
		onLeave(id)
	]]
	elseif message == "!teleportme" then
		if spawnpos[id] then
			parse("setpos " .. id .. " " .. spawnpos[id][1] .. " " .. spawnpos[id][2])
		else
			msg2(id, "You have not set a spawn position, use !setspawnpos to set one.")
		end
	end
end

addhook("leave", "onLeave")
function onLeave(id)
	spawnpos[id] = nil
end

old Re: Lua Scripts/Questions/Help

Szkieletor
User Off Offline

Quote
weiwen has written
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
local spawnpos = {}

addhook("say","onSay")
function onSay(id,message)
	if message == "!setspawnpos" then
		spawnpos[id] = {player(id, 'x'), player(id, 'y')}
	--[[
	elseif message == "!resetspawn" then
		onLeave(id)
	]]
	elseif message == "!teleportme" then
		if spawnpos[id] then
			parse("setpos " .. id .. " " .. spawnpos[id][1] .. " " .. spawnpos[id][2])
		else
			msg2(id, "You have not set a spawn position, use !setspawnpos to set one.")
		end
	end
end

addhook("leave", "onLeave")
function onLeave(id)
	spawnpos[id] = nil
end


Is there a way to make this an RCON only console command? Or just make this command available only when certain value is true(ex. Cansetspawn = 1)

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
N-B-K has written
Explain a bit "!setspawnpos"

I mean a player types !setspawnpos and then the script remembers his saved position until he disconnects,then he can use !teleportme and if he has atleast 4000$ money he will be teleported.

Anyways,thanks for the moneylist script

old Re: Lua Scripts/Questions/Help

Sudden Death
User Off Offline

Quote
I don't know how to change here
Spoiler >
Please change this to work
edited 1×, last 16.05.10 09:32:05 am

old Re: Lua Scripts/Questions/Help

Precel97
User Off Offline

Quote
Hi, im new scripter
I wanna create worms mode.
Who can help me in this script :

Ufo - If you throw gas granade and if you hurt other player then he change to ufo .

Who can create example menu for me??

Help plz


old Script

Kostyan1996
User Off Offline

Quote
Who knew such a script, where if a player joins a CT, it becomes a T, but if the player entered RCON password, or he ADMIN, it can become CT?

old Re: Lua Scripts/Questions/Help

Dig-Dog-HotDog
User Off Offline

Quote
im making an Rpg script and there are cars and boats in them so I have 2 questions :
1.Could some1 write me a code so that when I write "!leave" the player would get out of the car (the same with boat)
2.could some1 write me a code that a certain vehicle could only be in water

old How to add more spawn of monster to the map?

KenVo
User Off Offline

Quote
I downloaded script CS2DTibia - RPG in: http://www.unrealsoftware.de/forum_posts.php?post=176932&start=0 and don't know how to add more monster to the map

Example:

1
2
3
4
5
{
		name = 'Caterpie', health = 100, image = 'gfx/weiwen/pokemon/10.png', scalex = 1.5, scaley = 1.5, r = 104, g = 152, b = 40, 
		atk = 1.1, def = 1.2, spd = 7, atkspd = 10, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 100, runat = 20, spawn1 = {62, 70}, spawn2 = {150, 150}, 
		exp = 5, money = 80, loot = {{chance = 8000, id = 1}}, 
	},

I want to add more spawn for this monster and make it spawn faster so what i have to change?

old Re: Lua Scripts/Questions/Help

DRoNe
User Off Offline

Quote
Kostyan1996 has written
Who knew such a script, where if a player joins a CT, it becomes a T, but if the player entered RCON password, or he ADMIN, it can become CT?


you mean this ? :
1
2
3
4
5
6
7
8
9
10
11
addhook("team","adminteam")
function adminteam(id)
local usgn = player(id,"usgn")
	if usgn == HERE YOUR,FRIEND USGN then
		if team == 2 then
			parse("makect "..id)
		else
			parse("maket "..id)
		end
	end
end

i don't know with rcon_pw, sorry

old Re: Lua Scripts/Questions/Help

Soja1997
User Off Offline

Quote
i got big problem

Spoiler >
To the start Previous 1 2200 201 202338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview