To stcrat
#1

Can someone please help me convert this to strcat?

Код:
	    SCM(playerid, -1, ""COL_GREY"You can also use /Stats (Playerid)");
		format(String,sizeof(String), 	""COL_CYAN"%s (ID: %d)\n\n\
										"COL_CYAN"General: \n\
										"COL_CYAN"Team: %s\n\
										"COL_CYAN"Class: %s\n\
										"COL_CYAN"Rank: %s (%d / 15)\n\n\
										"COL_CYAN"Score: \n\
										"COL_CYAN"PT Score: %d\n\n\
										"COL_CYAN"DM Score: %d\n\n\
										"COL_CYAN"KD Ratio: %0.2f\n\n\
										"COL_CYAN"Game:\n\
										"COL_CYAN"Admin Level: %d %s\n\
										"COL_CYAN"V.I.P Level: %d %s\n\
										"COL_CYAN"Skin: %d\n\n\
										"COL_CYAN"Interior: %d\n\
										"COL_CYAN"Virtual World: %d\n\
										"COL_WHITE"Ping: %d\n\
										"COL_CYAN"Admin Level: %d %s\n\n\
										"COL_WHITE"Time: (%d) Hours (%d) Minutes (%d) Seconds",
										PlayerName(playerid),playerid,GetPlayerPing(playerid),GetPlayerScore(playerid),
										s_1,Rank[playerid],pInfo[playerid][Hours],pInfo[playerid][Minutes],
										pInfo[playerid][Seconds],pInfo[playerid][Kills],pInfo[playerid][Deaths],
										ratio,s_5,s_2,pInfo[playerid][Adminlevel],s_3,pInfo[playerid][VIPlevel],s_4);
		ShowPlayerDialog(playerid, 3564, DIALOG_STYLE_MSGBOX, "Player Stats:", String, "CLOSE", "");
Because everytime I compile it says not responding. If you every know why it says not responding can you also please tell me whats the problem?
Reply
#2

it could be anything : too much errors , unclosed braces or else...
Reply
#3

Just use format twice.
pawn Код:
// edit the text and the arguments.
format(String,sizeof(String), "...", ...);
format(String,sizeof(String), "%s ...", String, ...); // inserts the previous text into this one
The line is too long that's why the compiler is not responding. By the way, you don't need to use COL_CYAN everytime. It will use that color on the next line so doing that is just a waste of characters.
Reply
#4

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Just use format twice.
pawn Код:
// edit the text and the arguments.
format(String,sizeof(String), "...", ...);
format(String,sizeof(String), "%s ...", String, ...); // inserts the previous text into this one
The line is too long that's why the compiler is not responding. By the way, you don't need to use COL_CYAN everytime. It will use that color on the next line so doing that is just a waste of characters.
Why not strcat? is there any different and much better? Also can you please give me sample how it would be? then i'll continue the rest.
Reply
#5

Like Konstantinos said, remove all unnecessary COL_CYAN and put the string in a seperate line and you are under 500 chars
pawn Код:
// that will compile if you aren't changing any line
format(String,sizeof(String),
    COL_CYAN "\
    %s (ID: %d)\n\n\
    General: \n\
    Team: %s\n\
    Class: %s\n\
    Rank: %s (%d / 15)\n\n\
    Score: \n\
    PT Score: %d\n\n\
    DM Score: %d\n\n\
    KD Ratio: %0.2f\n\n\
    Game:\n\
    Admin Level: %d %s\n\
    V.I.P Level: %d %s\n\
    Skin: %d\n\n\
    Interior: %d\n\
    Virtual World: %d\n"
COL_WHITE "\
    Ping: %d\n"
COL_CYAN "\
    Admin Level: %d %s\n\n"
COL_WHITE "\
    Time: (%d) Hours (%d) Minutes (%d) Seconds"

    , PlayerName(playerid), playerid, GetPlayerPing(playerid), GetPlayerScore(playerid), s_1
    , Rank[playerid], pInfo[playerid][Hours], pInfo[playerid][Minutes], pInfo[playerid][Seconds]
    , pInfo[playerid][Kills], pInfo[playerid][Deaths], ratio, s_5, s_2, pInfo[playerid][Adminlevel]
    , s_3, pInfo[playerid][VIPlevel], s_4
);
Reply
#6

Why would you like to call strcat 2 times when it's not necessary since you can insert the string into the 2d format?

I would but your arguments are messed up.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)