Forum

> > CS2D > Scripts > name control
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch name control

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt name control

Quattro
GAME BANNED Off Offline

Zitieren
1
2
3
4
5
6
7
8
addhook("name", "nameControl")
function nameControl(id, oldname, newname, forced)
	if forced == 1 then
		return 0
	else
		return 1
	end
end

I use this command as described in tutorial, why doesn't it work?

alt Re: name control

TrialAndError
User Off Offline

Zitieren
Works for me if you're trying to achieve so that the player cannot change his/her name in game except for the "setname" command.

Do you have more than 1 hook set for 'name'?

alt Re: name control

Quattro
GAME BANNED Off Offline

Zitieren
Come to GamersCentral dust2. If you try enough times you will change name eventually with this ruleset running. It doesn't work.

alt Re: name control

phalenkO
User Off Offline

Zitieren
@user Quattro: If u want the truth and I tell you truth, I dont understand the name control. Firstly you should tell me about the name control because off I need to understand.

alt Re: name control

DC
Admin Off Offline

Zitieren
This looks like a bug / misleading hook behavior:
If the player is dead and tries to change his name the name change won't happen immediately but as soon as the player is alive again (next roundstart for instance). The hook will be executed with forced=1 in that case!

Will fix it like the following for the next release:
• If a name change is only scheduled, the name hook will be executed normally (with force 0). You can check yourself if it's just a schedule by checking the health/team of the player (dead/spec = schedule only). It can be cancelled already at this point by returning 1.
• If the name is actually changed as soon as the player becomes alive again, the hook will be triggered a second time but with forced=2 to indicate that his happend because of a delayed name change!

I updated cs2d lua hook name accordingly but note that it will only work like this with the next update.
4× editiert, zuletzt 27.04.19 12:53:21

alt Re: name control

Quattro
GAME BANNED Off Offline

Zitieren
@user DC:
Thank you! This hook is quite useful in some situations.

@user phalenkO:
Name hook allows you to control the ability to change nicks. There's not much more to know
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht