SA-MP Forums Archive
To long format any solution for this? - 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: To long format any solution for this? (/showthread.php?tid=560488)



To long format any solution for this? - Razturach - 28.01.2015

Hello!

I've made format, it was working great untill I over extended it, and if it's to long it's not working, is there any solution to make it work? rep+ for helpers.

code:
pawn Код:
format(string, sizeof(string), "{FFFFFF}Welcome back {00FF00}%s{FFFFFF}! \n\nThis account is registered. \nInsert your password to {00FF00}login {FFFFFF}to your account.\n\n{FFFFFF}Current time:{FF8000} %02d:%02d\t\t\t{FFFFFF}Times Logged:{FF8000} %d\n{FFFFFF}Date:{FF8000} %02d/%02d/%d\t\t\t{FFFFFF}Failed Attempts:{FF0000} 0/3\n{FFFFFF}Players in city: {FF8000}%d\t\t\t{FFFFFF}Last Login:{FF8000} %02d/%02d/%d",name,hour,minute,pInfo[playerid][Logins],day,month,year,Iter_Count(Player),pInfo[playerid][LastLoginD],pInfo[playerid][LastLoginM],pInfo[playerid][LastLoginY]);
ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT,"{FF8000}TEST",string,"Login","Quit");
Thanks for answers in advance!


Re: To long format any solution for this? - arlindi - 28.01.2015

U must use new string[1000];
And it work Try this


Re: To long format any solution for this? - Razturach - 28.01.2015

Yeah I used bigger number the problem is my pawno actually crashes when I try to compile


Re: To long format any solution for this? - arlindi - 28.01.2015

Show the command here or anywheere you are using it


Re: To long format any solution for this? - Razturach - 28.01.2015

Format for dialog.. check it how long is it, this fucks up the compiler

pawn Код:
public OnPlayerConnect(playerid)
{
    new hour, minute, second, string[500], year, month, day;
    getdate(year, month, day);
    gettime(hour, minute, second);
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    //format(string,sizeof(string),"Last Login: %02d/%02d/%d",pInfo[playerid][LastLoginD],pInfo[playerid][LastLoginM],pInfo[playerid][LastLoginY]);
    //SendClientMessage(playerid, -1, string);
    if(fexist(Path(playerid)))
    {
        INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid);
        format(string, sizeof(string), "{FFFFFF}Welcome back {00FF00}%s{FFFFFF}! \n\nThis account is registered. \nInsert your password to {00FF00}login {FFFFFF}to your account.\n\n{FFFFFF}Current time:{FF8000} %02d:%02d\t\t\t{FFFFFF}Times Logged:{FF8000} %d\n{FFFFFF}Date:{FF8000} %02d/%02d/%d\t\t\t{FFFFFF}Failed Attempts:{FF0000} 0/3\n{FFFFFF}Players in city: {FF8000}%d\t\t\t{FFFFFF}Last Login:{FF8000} %02d/%02d/%d",name,hour,minute,pInfo[playerid][Logins],day,month,year,Iter_Count(Player),pInfo[playerid][LastLoginD],pInfo[playerid][LastLoginM],pInfo[playerid][LastLoginY]);
        ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT,"{FF8000}         TEST",string,"Login","Quit"); // 23 spaces
    }
    else
    {
        format(string, sizeof(string), "{FFFFFF}Welcome to {FF8000}TEST {00FF00}%s{FFFFFF}! \n\nIf you want to join us, go and make your first step into\n{FF8000}TEST{FFFFFF} and {00FF00}register{FFFFFF} your account\nwith typing the password into box below.",name);
        ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_INPUT,"{FF8000} TEST ",string,"Register","Quit"); // 22 spaces
        return 1;
    }
    return 1;
}



Re: To long format any solution for this? - vassilis - 28.01.2015

Quote:
Originally Posted by ******
Посмотреть сообщение
There are many solutions:

1) Make it shorter.
2) Use multiple lines.
3) Use a different compiler.
4) Use multiple formats.
i wonder if strcat could help him in this case.. could it help him?


Re: To long format any solution for this? - Ironboy - 28.01.2015

You could better use strcat.


Re: To long format any solution for this? - Razturach - 29.01.2015

May someone tell me how to use strcat in this case, or actually what do you suggest ?