Forum

> > CS2D > General > Help Commands and Functions
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Help Commands and Functions

6 replies
To the start Previous 1 Next To the start

old Help Commands and Functions

Holloweye
User Off Offline

Quote
1: Is there any command or lua script to force a player to change team?

2: Is there any command or lua script to remove the c4 in the game? (I have tried with "parse("strip "..p.." "..5)" it dont work)

old Re: Help Commands and Functions

Lee
Moderator Off Offline

Quote
Holloweye has written
1: Is there any command or lua script to force a player to change team?


if you're using amx2d

1
2
3
4
function adm_swap_admin(p, typ, cmd)
	cmd = args(cmd, "id_id, team")
	parse("make"..cmd.team.." "..cmd.id)
end

if not

1
2
3
4
5
6
7
8
9
10
11
12
add_hook("say", "swap")
function swap(p, t)
	if t:sub(1, 6) == "@swap " then
		local pl = t:sub(7, 8)
		local team = t:sub(9)
		for word in team:gmatch("[^%s]+") do
			team = word
			break
		end
		parse("make"..team.." "..pl)
	end
end

old Re: Help Commands and Functions

DC
Admin Off Offline

Quote
the cs2d commands are simply
cs2d cmd maket and cs2d cmd makect and cs2d cmd makespec (click for details)
you can execute cs2d commands in Lua by using the parse command.
for example parse("makect "..id) this will make the player with the id "id" (variable) a ct.
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview