Forum

> > CS2D > Scripts > how to make lua left game and join
Forums overviewCS2D overview Scripts overviewLog in to reply

English how to make lua left game and join

4 replies
To the start Previous 1 Next To the start

old how to make lua left game and join

maninja
User Off Offline

Quote
Hello guys !

I need someone to help me for make a lua I will explain to you how to know what I mean For Example 'When one joins the server, you have a writing meant to have player join in server when to the server ' and etc too left game
1
parse('hudtxt 32 "©000255255'..player(id, "name")..' ©000255255has join in game" 5 412')
and left game
1
parse('hudtxt 32 "©000255255'..player(id, "name")..' ©000255255has left the game" 5 412')

old Re: how to make lua left game and join

Cebra
User Off Offline

Quote
if I understand you right, this should help you:

1
2
3
4
5
addhook("join","_join")
function _join(id)
	parse('hudtxt 32 "\169000255255'..player(id, "name")..' ©000255255has join in game" 5 412')
	timer(2500,"parse",'hudtxt 32 "" 0 0')
end

1
2
3
4
5
addhook("leave","_leave")
function _leave(id,reason)
	parse('hudtxt 32 "\169000255255'..player(id, "name")..' ©000255255has left the game" 5 412')
	timer(2500,"parse",'hudtxt 32 "" 0 0')
end
edited 1×, last 29.09.18 07:55:23 pm

old Re: how to make lua left game and join

GeoB99
Moderator Off Offline

Quote
You do not have to use cs2d cmd hudtxt just to display a simple "join/left" message in the screen. cs2d lua cmd msg can do the job for you and the message will also fade automatically after a short period of time.

@user Cebra: Please use
\169
for character colour output.

old Re: how to make lua left game and join

script favor
User Off Offline

Quote
Try this :

1
2
3
4
5
6
7
8
9
10
11
12
13
if not easy == {} then easy = {} end

easy = {}


function easy.PlayerJoin(ParamPlayer)
	easy.name = player(ParamPlayer,"name")
		msg(easy.name.." Has joined the fucking server")
		end
	
	
	
addhook("join","easy.PlayerJoin")
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview