strcat
#1

Ok, so I have two long lines in player stat showing, and I'm using strcat. But, I see only 1/2 dialog :SS

pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    new
        Teises[ 7 ]
    ;
    if( GetPVarInt( playerid, "VairavimoTeises" ) == 1 ) Teises = "Turi";
    else Teises = "Neturi";
    new
        Telefonas[ 7 ]
    ;
    if( GetPVarInt( playerid, "tNumeris" ) != 0 ) Telefonas = "Turi";
    else Telefonas = "Neturi";
    new
        Masina[ 7 ]
    ;
    if( GetPVarInt( playerid, "Masina" ) != 0 ) Masina = "Turi";
    else Masina = "Neturi";
    new
        Darbas[ 27 ]
    ;
    if( GetPVarInt( playerid, "Specialybe" ) == 1 ) Darbas = "Policijos Departamentas";
    else if( GetPVarInt( playerid, "Specialybe" ) == 2 ) Darbas = "Medicinos Departamentas";
    else if( GetPVarInt( playerid, "Specialybe" ) == 3 ) Darbas = "Taksistas";
    else if( GetPVarInt( playerid, "Specialybe" ) == 4 ) Darbas = "Dizaineris";
    else if( GetPVarInt( playerid, "Specialybe" ) == 5 ) Darbas = "Maisto prekiш iрveюiotojas";
    else if( GetPVarInt( playerid, "Specialybe" ) == 2 ) Darbas = "Picш iрveюiotjoas";
    else if( GetPVarInt( playerid, "Specialybe" ) == 2 ) Darbas = "Keliш valytojas";
    new
        Direktorius[ 23 ]
    ;
    if( GetPVarInt( playerid, "Direktorius" ) == 1 ) Direktorius = "Policijos Departamento";
    else if( GetPVarInt( playerid, "Direktorius" ) == 2 ) Direktorius = "Medicinos Departamento";
    else if( GetPVarInt( playerid, "Direktorius" ) == 3 ) Direktorius = "Taksi firmos";
    else if( GetPVarInt( playerid, "Direktorius" ) == 4 ) Direktorius = "Dizaineriш";
    new
        Stringas[ 422 ][ 2 ]
    ;
    format( Stringas[ 0 ], 422, ""#h_Zalia"Vardas: "#h_Raudona"%s\n"#h_Zalia"Юaidлjo ID: "#h_Raudona"%d\n"#h_Zalia"Pinigai: %d\n"#h_Zalia"Pinigai banke: "#h_Raudona"%d\n"#h_Zalia"Ieрkomumo lygis: "#h_Raudona"%d\n"#h_Zalia"Laikas kalлjime: "#h_Raudona"%d minuиiш\n"#h_Zalia"Laikas iki atitildymo: "#h_Raudona"%d minuиiш\n"#h_Zalia"Vairavimo teisлs: "#h_Raudona"%s\n", ZaidejoVardas( clickedplayerid ),
    clickedplayerid, GetPlayerMoneyEx( playerid ), GetPVarInt( playerid, "Pinigai.Banke" ), GetPlayerWantedLevel( playerid ),
    GetPVarInt( playerid, "Kalejimo.Laikas" ), GetPVarInt( playerid, "Uztildytas" ), Teises );
    strcat( Stringas[ 1 ], Stringas[ 0 ], 422 );
    format( Stringas[ 0 ], 314, ""#h_Zalia"Mobilusis telefonas: "#h_Raudona"%s\n"#h_Zalia"Administratoriaus lygis: "#h_Raudona"%d\n"#h_Zalia"Darbo бspлjimш: "#h_Raudona"%d\n"#h_Zalia"Maрina: "#h_Raudona"%s\n"#h_Zalia"Darbas: "#h_Raudona"%s\n"#h_Zalia"Direktorius: "#h_Raudona"%s", Telefonas, GetPVarInt( playerid, "Administratorius" ), GetPVarInt( playerid, "DarboIspejimai" ), Masina, Darbas, Direktorius );
    ShowPlayerDialog( playerid, 48, DIALOG_STYLE_MSGBOX, ""#h_Balta"Юaidлjo informacija.", Stringas[ 0 ], "Uюdaryti", "" );
    return 1;
}
And I see only this:

pawn Код:
format( Stringas[ 0 ], 314, ""#h_Zalia"Mobilusis telefonas: "#h_Raudona"%s\n"#h_Zalia"Administratoriaus lygis: "#h_Raudona"%d\n"#h_Zalia"Darbo бspлjimш: "#h_Raudona"%d\n"#h_Zalia"Maрina: "#h_Raudona"%s\n"#h_Zalia"Darbas: "#h_Raudona"%s\n"#h_Zalia"Direktorius: "#h_Raudona"%s", Telefonas, GetPVarInt( playerid, "Administratorius" ), GetPVarInt( playerid, "DarboIspejimai" ), Masina, Darbas, Direktorius );
But not with

pawn Код:
format( Stringas[ 0 ], 422, ""#h_Zalia"Vardas: "#h_Raudona"%s\n"#h_Zalia"Юaidлjo ID: "#h_Raudona"%d\n"#h_Zalia"Pinigai: %d\n"#h_Zalia"Pinigai banke: "#h_Raudona"%d\n"#h_Zalia"Ieрkomumo lygis: "#h_Raudona"%d\n"#h_Zalia"Laikas kalлjime: "#h_Raudona"%d minuиiш\n"#h_Zalia"Laikas iki atitildymo: "#h_Raudona"%d minuиiш\n"#h_Zalia"Vairavimo teisлs: "#h_Raudona"%s\n", ZaidejoVardas( clickedplayerid ),
    clickedplayerid, GetPlayerMoneyEx( playerid ), GetPVarInt( playerid, "Pinigai.Banke" ), GetPlayerWantedLevel( playerid ),
    GetPVarInt( playerid, "Kalejimo.Laikas" ), GetPVarInt( playerid, "Uztildytas" ), Teises );
help :/
Reply
#2

Try
pawn Код:
new
        Stringas[ 844 ]
    ;
    format( Stringas, 844, ""#h_Zalia"Vardas: "#h_Raudona"%s\n"#h_Zalia"?aidлjo ID: "#h_Raudona"%d\n"#h_Zalia"Pinigai: %d\n"#h_Zalia"Pinigai banke: "#h_Raudona"%d\n"#h_Zalia"Ie?komumo lygis: "#h_Raudona"%d\n"#h_Zalia"Laikas kalлjime: "#h_Raudona"%d minue`i?\n"#h_Zalia"Laikas iki atitildymo: "#h_Raudona"%d minue`i?\n"#h_Zalia"Vairavimo teisлs: "#h_Raudona"%s\n", ZaidejoVardas( clickedplayerid ),
    clickedplayerid, GetPlayerMoneyEx( playerid ), GetPVarInt( playerid, "Pinigai.Banke" ), GetPlayerWantedLevel( playerid ), GetPVarInt( playerid, "Kalejimo.Laikas" ), GetPVarInt( playerid, "Uztildytas" ), Teises );
    format( Stringas, 844, "%s"#h_Zalia"Mobilusis telefonas: "#h_Raudona"%s\n"#h_Zalia"Administratoriaus lygis: "#h_Raudona"%d\n"#h_Zalia"Darbo бspлjim?: "#h_Raudona"%d\n"#h_Zalia"Ma?ina: "#h_Raudona"%s\n"#h_Zalia"Darbas: "#h_Raudona"%s\n"#h_Zalia"Direktorius: "#h_Raudona"%s",Stringas, Telefonas, GetPVarInt( playerid, "Administratorius" ), GetPVarInt( playerid, "DarboIspejimai" ), Masina, Darbas, Direktorius );
    ShowPlayerDialog( playerid, 48, DIALOG_STYLE_MSGBOX, ""#h_Balta"?aidлjo informacija.", Stringas, "U?daryti", "" );
    return 1;
}
Reply
#3

Nop. If someone can't understand look at ss:



red place near mini map - just hided website td
Reply
#4

Did you try Jefff's code?
Reply
#5

yes. (Charrzz)
Reply
#6

It works for me

Reply
#7

hmm maybe strings was bad, goin to test again


works, thanks
Reply
#8

srry for 2ble post, but another problem with speedometer..

pawn Код:
if( IsPlayerInAnyVehicle( ID ) && GetPlayerState( ID ) == PLAYER_STATE_DRIVER )
            {
                new
                    Automobilis = GetPlayerVehicleID( ID ),
                    Modelis = GetVehicleModel( Automobilis )
                ;
                if( Modelis != 481 || Modelis != 510 || Modelis != 509 )
                {
                    if( ZaidejoGreitis( ID ) < 100 )
                    {
                        format( Stringas, 60, "~g~Greitis: ~y~%d~n~~g~Degalai: ~y~%d", ZaidejoGreitis( ID ), MasinuDB[ Masina ][ Degalai ] );
                        TextDrawSetString( Spidometras[ ID ], Stringas );
                        TextDrawShowForPlayer( ID, Spidometras[ ID ] );
                    }
                    else
                    {
                        format( Stringas, 70, "~g~Greitis: ~r~%d~n~~g~Degalai: ~y~%d", ZaidejoGreitis( ID ), MasinuDB[ Masina ][ Degalai ] );
                        TextDrawSetString( Spidometras[ ID ], Stringas );
                        TextDrawShowForPlayer( ID, Spidometras[ ID ] );
                    }
                }
                else
                {
                    format( Stringas, 27, "~g~Greitis: ~y~%d", ZaidejoGreitis( ID ) );
                    TextDrawSetString( Spidometras[ ID ], Stringas );
                    TextDrawShowForPlayer( ID, Spidometras[ ID ] );
                }
            }
        }
        else
        {
            TextDrawHideForPlayer( ID, Spidometras[ ID ] );
        }
    }
And if I enter any bike server shows fuel for me, but Im checking vehicle model id, so maybe anyone know whats wrong?
Reply
#9

pawn Код:
if( Modelis != 481 || Modelis != 510 || Modelis != 509 )
change || to &&

pawn Код:
if( Modelis != 481 && Modelis != 510 && Modelis != 509 )
Reply
#10

thanks you very much.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)