Dialog string help. :x
#1

EDITED: Problem fixed, thank you Admantis!

Solution: Strcat
Reply
#2

https://sampwiki.blast.hk/wiki/Strcat
Reply
#3

Quote:
Originally Posted by admantis
View Post
Just tried using that, how would I go about doing something like this?

pawn Code:
strcat(string, "{0FA0D1}Name: {FFFFFF}%s (ID: %d)\n{0FA0D1}VIP Rank: {FFFFFF}%s (%d)\n{0FA0D1}Skin ID: {FFFFFF}%d\n{0FA0D1}Job:{FFFFFF} %s\n{0FA0D1}Money: {FFFFFF}$%d\n{0FA0D1}Faction: {FFFFFF}%s |", pName(playerid), playerid, VIPName, PVar[playerid][VIPLevel], PVar[playerid][pSkin], JobName, PVar[playerid][pMoney], FactionName);
    strcat(string, "{0FA0D1}Rank: {FFFFFF}%s (Rank: %d)\n{0FA0D1}Materials: {FFFFFF}%d | {0FA0D1}Drugs: {FFFFFF}%d", FactionRankName, PVar[playerid][pFRank], PVar[playerid][pMaterials], PVar[playerid][pDrugs]);
    ShowPlayerDialog(playerid, STATS, DIALOG_STYLE_MSGBOX, "{0FA0D1}Godfather Reborn: Statistics", string, "Hide", "");
Reply
#4

You need to format the string then concenate it with strcat.
pawn Code:
format(string, sizeof(string)"{0FA0D1}Rank: {FFFFFF}%s (Rank: %d)\n{0FA0D1}Materials: {FFFFFF}%d | {0FA0D1}Drugs: {FFFFFF}%d", FactionRankName, PVar[playerid][pFRank], PVar[playerid][pMaterials], PVar[playerid][pDrugs]);
strcat(holder, string, sizeof(holder)); // You need a new variable called 'holder' to hold all the data concenated with strcat
Reply
#5

Quote:
Originally Posted by admantis
View Post
You need to format the string then concenate it with strcat.
pawn Code:
format(string, sizeof(string)"{0FA0D1}Rank: {FFFFFF}%s (Rank: %d)\n{0FA0D1}Materials: {FFFFFF}%d | {0FA0D1}Drugs: {FFFFFF}%d", FactionRankName, PVar[playerid][pFRank], PVar[playerid][pMaterials], PVar[playerid][pDrugs]);
strcat(holder, string, sizeof(holder)); // You need a new variable called 'holder' to hold all the data concenated with strcat
Thank you VERY much! We really need a reputation system on these forums..
Reply
#6

Yeah, no problem, but I doubt it's going to be soon.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)