Dosent spawn when i select my class
#1

Hello guys and happy new year

When i click on the class i want, im dosent spawning?
Anyone help

Pawn code:
Код:
public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
{
    switch( dialogid )
    {
        case DIALOG_CLASS:
        {
            switch( listitem )
            {
                case 0:
                {
                    AddPlayerClass(61,1321.6466,1266.3080,10.8203,1.5767,0,0,0,0,0,0); // spawn
                }
                case 1:
                {
                    if( GetPlayerScore( playerid ) >= 20 )
                    {
                        //comming soon
                    }
                    else return ShowPlayerFractionDialog( playerid, false, 20 );
                }
                case 2:
                {
                    if( GetPlayerScore( playerid ) >= 50 )
                    {
                        //comming soon
                    }
                    else return ShowPlayerFractionDialog( playerid, false, 50 );
                }
                case 3:
                {
                    if( GetPlayerScore( playerid ) >= 130 )
                    {
                        //comming soon
                    }
                    else return ShowPlayerFractionDialog( playerid, false, 130 );
                }
                case 4:
                {
                    if( GetPlayerScore( playerid ) >= 260 )
                    {
                        //comming soon
                    }
                    else return ShowPlayerFractionDialog( playerid, false, 260 );
                }
            }
        }
    }
    return ( 1 );
}

Class_String( )
{
    gsString[ 0 ] = EOS;

    strcat( gsString, ""G"Pilot\t\t 0\n" );
    strcat( gsString, ""G"Taxi\t\t 20\n" );
    strcat( gsString, ""G"Helicopter\t 50\n" );
    strcat( gsString, ""G"Army\t\t 130\n" );
    strcat( gsString, ""G"Police\t\t 260" );

    return gsString;
}

stock ShowPlayerFractionDialog( playerid, type, score = 0 )
{
    switch( type )
    {
        case false:
        {
            format( gsString, sizeof( gsString ), ""R"ERROR: "W"You need "YE"%d "W"score to be able to select this Class.", score );
            SendClientMessage( playerid, ~1, gsString );
        }
        case true: SendClientMessage( playerid, ~1, ""S"INFO: "W"Please select your "YE"Class "W"from the dialog." );
    }
    return ShowPlayerDialog( playerid, DIALOG_CLASS, DIALOG_STYLE_LIST, "Class Menu          \tScore Required", Class_String( ), "Select", "" );
}
And:
Код:
public OnPlayerRequestClass(playerid, classid)
{
    TogglePlayerSpectating(playerid, true);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
}
If anyone can help i will be great
Reply
#2

Anyone want to help?..
Reply
#3

I am not sure but try this:

pawn Код:
case 0:
{
    SetSpawnInfo(playerid, 0, 61, 1321.6466, 1266.3080, 10.8203, 1.5767, 0, 0, 0, 0, 0, 0);
    SpawnPlayer(playerid);
}
To know what to put to the command for other cases:

https://sampwiki.blast.hk/wiki/SetSpawnInfo
Reply
#4

I will try now
Reply
#5

Work
Reply
#6

Glad to hear that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)