SA-MP Forums Archive
/login cmd - 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)
+--- Thread: /login cmd (/showthread.php?tid=628434)



/login cmd - SaiyanZ - 10.02.2017

Hello
I wanted to ask if there is a way, like When player connects it automatically types a command for him?
like when he connects, he don't need to type /login, just when he connects the server auto types /login for the guy

PHP код:
public OnPlayerConnect(playerid)
{
    
SetPlayerColor(playerid0xA9A9A9FF);
    
OnPlayerCommandText(playerid"/login");
    return 
1;

tried doing like this



Re: /login cmd - khRamin78 - 10.02.2017

use this
CallRemoteFunction
CallLocalFunction


Re: /login cmd - ISmokezU - 10.02.2017

Код:
cmd_login(playerid,  "");



Re: /login cmd - khRamin78 - 10.02.2017

Quote:
Originally Posted by ISmokezU
Посмотреть сообщение
Код:
cmd_login(playerid,  "");
he is not using zcmd


Re: /login cmd - SaiyanZ - 10.02.2017

Nah cant understand, can you give any example please?



Re: /login cmd - Mic_H - 10.02.2017

PHP код:
public OnPlayerConnect(playerid)
{
    
SetPlayerColor(playerid0xA9A9A9FF); 
    
CallRemoteFunction("OnPlayerCommandText""is"playerid"/login");
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp(cmdtext"/login"true))
    {
        
//if(PlayerAlreadyLoggedIn(playerid)
            //return 1;
        
ShowPlayerDialog(playeriddialogidDIALOG_STYLE_PASSWORD"Login:""Enter your damn password son:, "Continue", "");
    }
    return 0;
}
//.. 



Re: /login cmd - khRamin78 - 10.02.2017

and i think its better to use a timer !


Re: /login cmd - princejeet1510 - 10.02.2017

Why you are using commands to let someone login....simply show them the login dialog box and use it....
I suggest to update your login system...


Re: /login cmd - ElMaestro123 - 12.02.2017

Try something like this

public OnPlayerConnect
{
if[playerregistered==0]
Return 1
{
(opens dialog for login...)
}
SendClientMessage(playerid,-1,"Welcome, you arent registered.");
(Dialog cases etc for register)
}