Help (Spawn button)
#1

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;

Reply
#2

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;
}
Reply
#3

I did not spawn!

http://imgur.com/3eR6fCC
Reply
#4

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;
}
Reply
#5

Likewise, no spawn
Reply
#6

Код:
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;
}
Reply
#7

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.
Reply
#8

Nice. I'm glad to could help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)