SA-MP Forums Archive
SpawnPlayer(playerid) bug? - 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: SpawnPlayer(playerid) bug? (/showthread.php?tid=598591)



SpawnPlayer(playerid) bug? - radiobizza - 14.01.2016

When I connect to my server it appears an dialog to register,then another one to login. And then when I type the password to login, it doesn't respawn me. Please help me

What can i do? Where I can edit ? Some suggestions?


Re: SpawnPlayer(playerid) bug? - Eth - 14.01.2016

Show me the codes


Re: SpawnPlayer(playerid) bug? - radiobizza - 14.01.2016

this is when you do not have an account and you are forced to register and login
PHP код:
    format(nstringsizeof(nstring), "Jucători/%s.ini"plname);
    if(
fexist(nstring))
    {
        
gPlayerAccount[playerid] = 1;
        
GetPlayerIp(playeridipjucatorsizeof(ipjucator));
        
GetPlayerName(playeridsendernamesizeof(sendername));
        
format(stringsizeof(string), "{FFFFFF}Bine ai revenit pe Play Arena {7FFFD4}%s {FFFFFF}!\n{FFFFFF}IP: {7FFFD4}%s\n{FFFFFF}Acest nume este deja оnregistrat !\n{FFFFFF}Te rog scrie parola оn căsuta de mai jos pentru a putea intra оn joc:"sendernameipjucator);
        
ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"{FFFFFF}Conectare"string,"{FFFFFF}Conectare""{FFFFFF}Quit"); //login
    
}
    else
    {
        
gPlayerAccount[playerid] = 0;
        
GetPlayerIp(playeridipjucatorsizeof(ipjucator));
        
GetPlayerName(playeridsendernamesizeof(sendername));
        
SetPlayerHealth(playerid100);
        
format(stringsizeof(string), "{FFFFFF}Bine ai venit pe Play Arena {7FFFD4}%s {FFFFFF}!.\n{FFFFFF}IP: {7FFFD4}%s\n{FFFFFF}Pentru a te putea inregistra,scrie o parolă оn căsuta de mai jos pentru a putea continua:"sendernameipjucator);
        
ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"{FFFFFF}Оnregistrare"string"{FFFFFF}Inregistrare","{FFFFFF}Quit");
    } 
this is public OnDialogResponse callback
PHP код:
        if(dialogid == || dialogid == 3)
        {
            if(
response)
            {
                if(
strlen(inputtext))
                {
                    new 
tmppass[64];
                    
strmid(tmppassinputtext0strlen(inputtext), 255);
                    
OnPlayerLogin(playerid,tmppass);
                    new 
playersip[24];
                    
GetPlayerIp(playeridplayersipsizeof(playersip));
                    new 
playername2[MAX_PLAYER_NAME];
                    
GetPlayerName(playeridplayername2sizeof(playername2));
                    
SetPlayerPos(playerid1964.8954, -1305.2051 ,53.4559);
                }
                else
                {
                    
ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Login""{FFFFFF}Aceasta parola nu este corecta. Mai оncearcă o dată:","Login","Exit");
                    
gPlayerLogTries[playerid] += 1;
                    if(
gPlayerLogTries[playerid] == 3)
                    {
                        
SendClientMessage(playeridCOLOR_WHITE "{FA8072}ConsolaJucator: {FFFFFF}Ai luat kick pentru ca ai bagat parola de 3 ori gresita !" );
                        
Kick(playerid);
                    }
                }
            }
            else
            {
                
SendClientMessage(playerid,COLOR_WHITE,"{FA8072}ConsolaJucator: {FFFFFF} Ai primit kick pentru ca ai dat exit !");
                
Kick(playerid);
                return 
1;
            }
        }
        if(
dialogid == 1)
        {
            if(
response)
            {
                if(
strlen(inputtext))
                {
                    
format(stringsizeof(string), "Jucători/%s.ini"sendername);
                    new 
FilehFile fopen(stringio_read);
                    if(
hFile)
                    {
                        
SendClientMessage(playeridCOLOR_YELLOW"Acest nume este luat,alege altul.");
                        
fclose(hFile);
                        return 
1;
                    }
                    if(
strlen(inputtext) < )
                    {
                        new 
regstring[128];
                        new 
regname[64];
                        
GetPlayerName(playerid,regname,sizeof(regname));
                        
format(regstring,sizeof(regstring),"{FFFFFF}Ne pare rău {006400}%s {FFFFFF}!\n{FFFFFF}Parola ta trebuie sa contina minim 4 caractere:",regname);
                        
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"{FFFFFF}Register"regstring"{FFFFFF}Register""{FFFFFF}Exit");
                        return 
1;
                    }
                    new 
tmppass[64];
                    
strmid(tmppassinputtext0strlen(inputtext), 255);
                    
OnPlayerRegister(playerid,tmppass);
                }
                else
                {
                    new 
regname[64];
                    new 
regstring[128];
                    
GetPlayerIp(playeridipjucatorsizeof(ipjucator));
                    
GetPlayerName(playeridregnamesizeof(regname));
                    
format(regstringsizeof(regstring), "{FFFFFF}Bine ai venit pe Play Arena {7FFFD4}%s {FFFFFF}!.\n{FFFFFF}IP: {7FFFD4}%s\n{FFFFFF}Pentru a te putea inregistra,scrie o parolă оn căsuta de mai jos pentru a putea continua:"regnameipjucator);
                    
ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"{FFFFFF}Оnregistrare"regstring"{FFFFFF}Inregistrare","{FFFFFF}Quit");
                }
            }
            else
            {
                
SendClientMessage(playerid,COLOR_WHITE,"Ai primit kick pentru ca ai dat exit !");
                
Kick(playerid);
                return 
1;
            }
        } 



Re: SpawnPlayer(playerid) bug? - Golimad - 14.01.2016

"..dialog to register,then another one to login"
tell me the cases, you are not registered and it shows register dialog then login dialog or what?
and why you don't check if password is correct or not, and what does OnPlayerLogin(playerid,tmppass); do


Re: SpawnPlayer(playerid) bug? - radiobizza - 14.01.2016

can you make an example to check if password is correct or not please ?
and yes. When you entered on the server and if you don't have an account,it appears an dialog to register that account and when you press enter,it appears another dialog to login to your account. And after that,I want to spawn the player


Re: SpawnPlayer(playerid) bug? - radiobizza - 14.01.2016

bump


Re: SpawnPlayer(playerid) bug? - Joron - 14.01.2016

Quote:
Originally Posted by radiobizza
Посмотреть сообщение
bump
no hablo espaсol :[


Re: SpawnPlayer(playerid) bug? - radiobizza - 14.01.2016

Quote:
Originally Posted by Joron
Посмотреть сообщение
no hablo espaсol :[
please help me in that case


Re: SpawnPlayer(playerid) bug? - jamesbond007 - 14.01.2016

I dont even see SpawnPlayer(playerid) in the code


Re: SpawnPlayer(playerid) bug? - Eth - 14.01.2016

Quote:
Originally Posted by jamesbond007
Посмотреть сообщение
I dont even see SpawnPlayer(playerid) in the code
Same thing that got into my head.

OFF TOPIC: WTF IS THIS PROFILE PICTURE