AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   How to request username to a player? (https://forums.alliedmods.net/showthread.php?t=298245)

Santi. 06-05-2017 22:16

How to request username to a player?
 
Hello there, I'm doing an account system and I want each player to use a unique username without using the console. I'd like to know how to ask them for the username they want for their account. For instance typing it on the chat.

sdz 06-06-2017 07:24

Re: How to request username to a player?
 
hook chat or use OnClientSayCommand, use a boolean to determine whether or not the text typed in chat was a reply to the question or input

KissLick 06-07-2017 12:50

Re: How to request username to a player?
 
Quote:

Originally Posted by EasSidezz (Post 2526530)
hook chat

:shock:... :nono:

Arkarr 06-07-2017 14:56

Re: How to request username to a player?
 
Quote:

Originally Posted by KissLick (Post 2526867)
:shock:... :nono:

Why not ?

KissLick 06-07-2017 16:06

Re: How to request username to a player?
 
Quote:

Originally Posted by Arkarr (Post 2526895)
Why not ?

Because we have OnClientSayCommand ;-)

Arkarr 06-08-2017 07:56

Re: How to request username to a player?
 
Quote:

Originally Posted by KissLick (Post 2526910)
Because we have OnClientSayCommand ;-)

This won't listen only to commands? I mean, what if I want to do something like :
Code:

+--------- chat ----------+
+ Enter a username :      +
+ Mike                    + --> player input
+ User "Mike" Found !    +
+ ...                    +
+-------------------------+

I can't test now...

KissLick 06-08-2017 12:11

Re: How to request username to a player?
 
Quote:

Originally Posted by Arkarr (Post 2527039)
This won't listen only to commands

Did you read the docs? Have you ever used this forward?

Let me quote from the docs...
Quote:

Global listener for the chat commands.
It is a forward provided by the core that fires whenever a client uses a chat command such as say, say2, say_team, say_team2, print, echo, ...

Coding the example you gave us would be easier and more elegant with the OnClientSayCommand forward.

Arkarr 06-08-2017 13:13

Re: How to request username to a player?
 
Quote:

Originally Posted by KissLick (Post 2527080)
Did you read the docs? Have you ever used this forward?

Let me quote from the docs...


It is a forward provided by the core that fires whenever a client uses a chat command such as say, say2, say_team, say_team2, print, echo, ...

Coding the example you gave us would be easier and more elegant with the OnClientSayCommand forward.

My apologies, my english wasn't good enough. I misunderstood it.
Thanks for clarification.


All times are GMT -4. The time now is 05:40.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.