SA-MP Forums Archive
Help (Spawn button) - 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: Help (Spawn button) (/showthread.php?tid=544371)



Help (Spawn button) - Edw - 01.11.2014

I have a small problem, when I write the password does not automatically spawn gives me ...


PHP код:
        case DIALOG_LOGIN:
        {
            if ( !
response ) return Kick playerid );
            if( 
response )
            {
                
InterpolateCameraPos(playerid1820.5413, -1896.367725.52451820.5776, -1584.853425.52455000CAMERA_MOVE);
                if(
udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
                    
GivePlayerMoney(playeridPlayerInfo[playerid][pMoney]);
                    
TogglePlayerSpectating(playerid0);
                    
SpawnPlayer(playerid);
                }
                else
                {
                    
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD,""COL_WHITE"{BECBFC}Login:",""COL_WHITE"Parola pe care ai scris-o este incorecta.\n\n"COL_WHITE"{BECBFC}Introdu parola.\n","Login","Quit");
                }
                return 
1;
            }
        }
public 
OnPlayerRequestClass(playeridclassid)
{
    
TogglePlayerSpectating(playeridtrue);
    return 
1;




Re: Help (Spawn button) - gurmani11 - 01.11.2014

If you want to skip the class selection then do this
pawn Код:
case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                InterpolateCameraPos(playerid, 1820.5413, -1896.3677, 25.5245, 1820.5776, -1584.8534, 25.5245, 5000, CAMERA_MOVE);
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_WHITE"{BECBFC}Login:",""COL_WHITE"Parola pe care ai scris-o este incorecta.\n\n"COL_WHITE"{BECBFC}Introdu parola.\n","Login","Quit");
                }
                return 1;
            }
        }


public OnPlayerRequestClass(playerid, classid)
{
    SpawnPlayer(playerid); // spawn player and skip that class selection
    return 1;
}



Re: Help (Spawn button) - Edw - 01.11.2014

I did not spawn!

http://imgur.com/3eR6fCC



Re: Help (Spawn button) - gurmani11 - 01.11.2014

try it
pawn Код:
case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                InterpolateCameraPos(playerid, 1820.5413, -1896.3677, 25.5245, 1820.5776, -1584.8534, 25.5245, 5000, CAMERA_MOVE);
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
                    SpawnPlayer(playerid);
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_WHITE"{BECBFC}Login:",""COL_WHITE"Parola pe care ai scris-o este incorecta.\n\n"COL_WHITE"{BECBFC}Introdu parola.\n","Login","Quit");
                }
                return 1;
            }
        }


public OnPlayerRequestClass(playerid, classid)
{
    SpawnPlayer(playerid); // spawn player and skip that class selection
    return 1;
}



Re: Help (Spawn button) - Edw - 01.11.2014

Likewise, no spawn


Re: Help (Spawn button) - ZaBraNjeNi - 01.11.2014

Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetTimer("AutoSpawn",2000,false);// 2 seconds it will spawn u
    return 1;
}
forward AutoSpawn(playerid);
public AutoSpawn(playerid)
{
    SpawnPlayer(playerid);
    SetPlayerPos(playerid, X, Y, Z); //Change coordinates
    SetPlayerSkin(playerid, ID); // change "ID"
    return 1;
}



Re: Help (Spawn button) - Edw - 01.11.2014

Quote:
Originally Posted by ZaBraNjeNi
Посмотреть сообщение
Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetTimer("AutoSpawn",2000,false);// 2 seconds it will spawn u
    return 1;
}
forward AutoSpawn(playerid);
public AutoSpawn(playerid)
{
    SpawnPlayer(playerid);
    SetPlayerPos(playerid, X, Y, Z); //Change coordinates
    SetPlayerSkin(playerid, ID); // change "ID"
    return 1;
}
Thank you!
+repp.


Re: Help (Spawn button) - ZaBraNjeNi - 01.11.2014

Nice. I'm glad to could help.