Problem.
#1

Hello guys, I have a problem with this.

Errors
Код:
(791) : warning 219: local variable "FormatNumber" shadows a variable at a preceding level
(797) : error 012: invalid function call, not a valid address
(797) : warning 215: expression has no effect
(797) : error 001: expected token: ";", but found ")"
(797) : error 029: invalid expression, assumed zero
(797) : fatal error 107: too many error messages on one line
Script and lines

Код:
CMD:stats(playerid, params[])
{
	if(PlayerInfo[playerid][pStats] == 1)
	{
		new year, month, day, name, level, age, FormatNumber, cash, account;        LINE 791
		getdate(year, month, day);
		new coordsstring[256];
		SCM(playerid, COLOR_GREEN, "------------------------------------------------------------------------------------");
		format(coordsstring, sizeof(coordsstring), "» STATISTICI CONT: %s - %d.%d.%d «", name, day, month, year);
		SCM(playerid, COLOR_WHITE, coordsstring);
		format(coordsstring, sizeof(coordsstring), "Level: %d | RespectPoints: %d/%d | Sex: %s | Varsta: %d | Money: $%s | Bank: $%s", level, /*atext*/ age, FormatNumber(cash),FormatNumber(account), jtext);  LINE 797
		SCM(playerid, COLOR_WHITE, coordsstring);
		format(coordsstring, sizeof, coordsstring, "Cont Premium: %s | OreJucate: %d | PretLeve: $%s | Job: %s | Warns: %d/3",drank, ptime, FormatNumber(costlevel), warns);
		SCM(playerid, COLOR_WHITE, coordsstring);
		format(coordsstring, sizeof(coordsstring), "Cellphone: %d | Credit: %d | Rank: %s | Faction: %s | FWarns: %d/3", pnumber, call, rtext, expamount, fwarn);
		SCM(playerid, COLOR_WHITE, coordsstring);
		format(coordsstring, sizeof(coordsstring), "Drugs: %d | Materials: %d | Job: %s | RobPoints: %d/100 | ", drugs, mats, jtext, PRob);
		SCM(playerid, COLOR_WHITE, coordsstring);
		if(PlayerInfo[playerid][pAdmin] >= 1)
		{
			format(coordsstring, sizeof(coordsstring), "Admin: %d | HP: %.1f | House: %d | Business: %d | HireKey: %d | Interior: %d | Local: %D | IP: %s", PlayerInfo[playerid][pAdmin],health,housekey,bizkey,HireCar[playerid],intir,local,plrip);
			SCM(playerid, COLOR_RED, coordsstring);
			format(coordsstring, sizeof(coordsstring), "Vehicle [slot #1]: %d | Vehicle [slot #2]: %d | Vehicle [slot #3]: %d | Skin: %d", PlayerInfo[playerid][pPcarkey], PlayerInfo[playerid][pPcarkey2], PlayerInfo[playerid][pPcarkey3],skin);
			SCM(playerid, COLOR_RED, coordsstring);
		}
		SCM(playerid, COLOR_GREEN, "------------------------------------------------------------------------------------");
	}
	if(PlayerInfo[playerid][pStats] == 2)
	{
		new string2[1152];
            new coordsstring[1152];
            new year, month, day;
            getdate(year,month,day);
            format(string2, sizeof(string2),"{FFFFFF}» STATISTICI CONT: {87CEFA}%s {FFFFFF}- %d.%d.%d « \n", name, day, month, year);
            format(coordsstring, sizeof(coordsstring), "{FFFFFF}Level: {87CEFA}%d {FFFFFF}| Sex: {87CEFA}%s {FFFFFF}| Varsta: {87CEFA}%d {FFFFFF}| Cash: {87CEFA}$%s {FFFFFF}| Banca: {87CEFA}$%s \n", level,atext,age,FormatNumber(cash),FormatNumber(account));
            strcat(string2,coordsstring);
            format(coordsstring, sizeof(coordsstring), "{FFFFFF}Cont Premium: {87CEFA}%s {FFFFFF}| Casatorit: {87CEFA}%s {FFFFFF}| OreJucate: {87CEFA}%d {FFFFFF}| Job: {87CEFA}%s \n", drank,married,ptime,jtext);
            strcat(string2,coordsstring);
            format(coordsstring, sizeof(coordsstring), "{FFFFFF}Imprumut: {87CEFA}%s${FFFFFF}/{87CEFA}%s$ {FFFFFF}| {87CEFA}FPunish: %d/40 {FFFFFF}| PuncteWanted: {87CEFA}%d{FFFFFF}/6 | Tel: {87CEFA}%d \n",FormatNumber(imprumutscazut),FormatNumber(imprumut),wanted, fpunish, pnumber);
            strcat(string2,coordsstring);
            format(coordsstring, sizeof(coordsstring), "{FFFFFF}Droguri: {87CEFA}%d {FFFFFF}| Materiale: %d {FFFFFF}| Respect: {87CEFA}%d{FFFFFF}/{87CEFA}%d {FFFFFF}| Factiune: {87CEFA}%s {FFFFFF}| Rang: {87CEFA}%s \n",drugs,mats,exp, expamount,ttext,rtext,fwarn, warns);
            strcat(string2,coordsstring);
            format(coordsstring, sizeof(coordsstring), "{FFFFFF}Credit: {87CEFA}%d mesaje/%d apeluri {FFFFFF}| PuncteRob: {87CEFA}%d/10 {FFFFFF}| FWarns: {87CEFA}%d/3 {FFFFFF}| Warns: {87CEFA}%d/3 \n\n",sms, call, PRob, fwarn, warns);
            strcat(string2,coordsstring);
            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
                format(coordsstring, sizeof(coordsstring), "{FF0000}Administrator: %d | HP: %.1f | Casa: %d | Afacere: %d | HireKey: %d | Interior: %d | Local: %d | IP: %s \n", PlayerInfo[targetid][pAdmin],health,housekey,bizkey,HireCar[targetid],intir,local,plrip);
                strcat(string2, coordsstring);
                format(coordsstring, sizeof(coordsstring), "{FF0000}Vehicul [slot #1]: %d | Vehicul [slot #2]: %d | Vehicul [slot #3]: %d | Skin: %d", PlayerInfo[targetid][pPcarkey], PlayerInfo[targetid][pPcarkey2],PlayerInfo[playerid][pPcarkey3],skin);
                strcat(string2, coordsstring);
            }
            ShowPlayerDialog(playerid,97,DIALOG_STYLE_MSGBOX,"Statistici cont",string2,"Iesire","");
    }
    new sendername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    printf("[DEBUG]: #ShowStats - %s", sendername);
	return 1;
}
Reply
#2

First Warning probably have that one already defined somewhere.

The error look at the line above it
Reply
#3

Line 797 has 7 variables to format, of which only 5 of them are used...

And please tell me you don't have the /*atext*/ in there...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)