SA-MP Forums Archive
You cant chat until u login. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: You cant chat until u login. (/showthread.php?tid=193220)



You cant chat until u login. - Face9000 - 25.11.2010

Hai there,i need little help with the chat.

I use dini as saving system,and i need to do a thing:

The player cant chat until he /register,and if is already registered,until he /login.

Thanks.


Re: You cant chat until u login. - Haydz - 25.11.2010

You will need to set a variable when a player connects then when he loggers in undo the variable to allow him to talk.


Re: You cant chat until u login. - Face9000 - 25.11.2010

mmm any help about settings this variable?


Re: You cant chat until u login. - Cameltoe - 25.11.2010

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
mmm any help about settings this variable?
pawn Код:
Under the Onplayertext callback:

if(IsPlayerLogged[payerid] == 0) return 0; // put this line at the top of that callback.

After login success:
IsPlayerLogged[payerid] = 1;

Onplayerdc:

IsPlayerLogged[payerid] = 0;



Re: You cant chat until u login. - Face9000 - 25.11.2010

And to add the messages like:

"U need to be registered to chat,use /register"

and if not logged in:

"Please login to chat."

Thanks.


Re: You cant chat until u login. - Cameltoe - 25.11.2010

pawn Код:
Under the Onplayertext callback:

if(IsPlayerLogged[payerid] == 0)
{
     SCM // write the scm here
     return 0; // put this line at the top of that callback.
}

After login success:
IsPlayerLogged[payerid] = 1;

Onplayerdc:

IsPlayerLogged[payerid] = 0;