![](img/smiles/bigsmile.gif)
Forum
![>](img/i_next.png)
![>](img/icons/cs2d.png)
![>](img/i_next.png)
![>](img/i_next.png)
How do i change the character with custom one?
19 replies![To the start](img/i_first.png)
![Previous](img/i_prev.png)
![Next](img/i_next.png)
![To the start](img/i_last.png)
![](img/smiles/bigsmile.gif)
You can use mods to hide the player sprites so everyone is invisible, and then use
![cs2d lua cmd](img/i_codehelp.png)
This would also be affected by lag, as you'd need to change the sprite using the
![cs2d lua hook](img/i_codehelp.png)
Instead, a better approach would be to use mods to simply change the skin, though then you're still limited to 4 characters per team.
Also, you can't set a skin through Lua, not yet at least, so it would be fairly messy to force a skin, if you wish.
This is assuming that your definition of a character is the skin, if not, do elaborate on what it is.
Quote
I think this one is a good idea, but the problem is that the texture only affects on clientside, not server one. Is there any ways to make the mod downloaded on the other players' device? Instead, a better approach would be to use mods to simply change the skin, though then you're still limited to 4 characters per team.
![user](img/i_friend.png)
Quote
I think this one is a good idea, but the problem is that the texture only affects on clientside, not server one. Is there any ways to make the mod downloaded on the other players' device?Instead, a better approach would be to use mods to simply change the skin, though then you're still limited to 4 characters per team.
One of the mods that come to my mind with custom skins is a classes mod where every class will possess different characteristics and a custom sprite. You can't do this with that.
![user](img/i_friend.png)
![](img/smiles/confused.gif)
You'd have to use
![cs2d cmd](img/i_codehelp.png)
![cs2d cmd](img/i_codehelp.png)
An example code:
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
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
local setTeam = { [0] = 'makespec', [1] = 'maket', [2] = 'makect' } setTeam[3] = setTeam[2] -- V.I.P. support. function setSkin(p, skin) 	if skin < 0 or skin > 3 then 		-- No such skin id. 		return 	end 	local team = player(p, 'team') 	if team == 0 then 		-- Player is a spectator 		return 	end 	-- Optimise this as much as possible 	local exec	= parse 	local get	= player 	local cmd	= setTeam[team] 	while get(p, 'look') ~= skin do 		-- Keep setting the team 		-- for as long as the randomiser 		-- didn't choose the skin that we want. 		exec(cmd .. ' ' .. p) 	end end
edited 1×, last 29.01.22 11:44:43 pm
![user](img/i_friend.png)
![](img/smiles/tongue.gif)
![user](img/i_friend.png)
If they're alive, they'll only die once.
You can also remove the death if they are alive, I omitted that part just because this is a proof of concept.
A more practical solution maybe would be if the server can check which mods are available and can set one of them.
If sb joins who has not the right mod you can kick him
The player will 100% have that mod loaded once joining the server.
Is this not what you want?
Use server mods.
![user](img/i_friend.png)
(...) This would also be affected by lag, as you'd need to change the sprite using the
switch hook, which is ping dependent and won't look good visually....
![cs2d lua hook](img/i_codehelp.png)
What's switch hook?
![user](img/i_friend.png)
Executed every time a player switches their held item.
In this context used to change the player sprite accordingly.
![user](img/i_friend.png)
@
Gaios: Read the documentation.
Executed every time a player switches their held item.
In this context used to change the player sprite accordingly.
![user](img/i_friend.png)
Executed every time a player switches their held item.
In this context used to change the player sprite accordingly.
Quote
The Lua hook "switch" has not been found. It either does not exist or it is not documented here.
![user](img/i_friend.png)
![cs2d lua hook](img/i_codehelp.png)
![To the start](img/i_first.png)
![Previous](img/i_prev.png)
![Next](img/i_next.png)
![To the start](img/i_last.png)