02.01.2015, 15:51
Hello, so I've been working on my code so it looks and runs better, but before the update, I had strings everywhere, like 10 difference strings, I was told it would use a lot of space, so I changed all the strings I had into "ustr" for the normal string then "strd" for dialog formating as well as "lstr" for logging command uses, so since I update this I've been having problems with my dialogs, they put messages into the dialog rather then the dialog it's self.
This is my code:
But this is what I am getting when I use the command /stats

as you can see it's showing the in the stats command that I have leveled up, I chat it says the same thing...
heres the line of that message.
If you know anyway to help me that would be great, or if you see I have made a mistake somewhere could you point it out so I can learn and so it doesn't happen in future. Thank you
This is my code:
pawn Код:
CMD:stats(playerid, params[])
{
format(strd, sizeof(strd), "{10F441}Gaming Time:{FFFFFF} %d:%d", pInfo[playerid][Hour], pInfo[playerid][Minute]);
strcat(ustr, strd);
format(strd, sizeof(strd), "{10F441}Money:{FFFFFF} %d\n", GetPlayerMoney(playerid));
strcat(ustr, strd);
format(strd, sizeof(strd), "{10F441}Kills:{FFFFFF} %d\n", pInfo[playerid][Kills]);
strcat(ustr, strd);
format(strd, sizeof(strd), "{10F441}Deaths:{FFFFFF} %d\n", pInfo[playerid][Deaths]);
strcat(ustr, strd);
format(strd, sizeof(strd), "{10F441}GP:{FFFFFF} %d\n", pInfo[playerid][GP]);
strcat(ustr, strd);
format(strd, sizeof(strd), "{10F441}XP:{FFFFFF} %d\n", pInfo[playerid][XP]);
strcat(ustr, strd);
format(strd, sizeof(strd), "{10F441}Level:{FFFFFF} %d\n", pInfo[playerid][Level]);
strcat(ustr, strd);
SPD(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "{33CCFF}Stats", ustr , "Close","");
getdate(lyear, lmonth, lday);
gettime(lhour, lminute, lsecond);
GetPlayerName(ID, pName, sizeof(pName));
format(lstr, sizeof lstr, "[COMMAND][%02d/%02d/%04d %02d:%02d:%02d]: %s(%d): has used /stats", lyear, lmonth, lday, lhour, lminute, lsecond, pName, ID);
AllLogs(lstr);
return 1;
}

as you can see it's showing the in the stats command that I have leveled up, I chat it says the same thing...
Код:
format(ustr, sizeof(ustr),"You have leveled up too level %d!",pInfo[playerid][Level]); SCM(playerid, pink, ustr);
pawn Код:
new ustr[128];//string
new strd [700];//dialog string
new lstr[400]; // Logging string