Error! +REP IF YOU HELP!
#1

I have these errors:I have these errors:
Quote:

C:\Users\Callum.Acer\Desktop\Scripting extra\gamemodes\Millenium.pwn(700) : error 029: invalid expression, assumed zero

Код:
new HouseInfo[MAX_PLAYERS+1][MAX_HOUSES][hInfo];
Quote:

C:\Users\Callum.Acer\Desktop\Scripting extra\gamemodes\Millenium.pwn(2019) : error 054: unmatched closing brace ("}")

Код:
		    format(coordsstring, sizeof(coordsstring), "House: %d | House 2: %d | Renting: %d | Int: %d | VW: %d | Real VW: %d | Jail: %d sec | WJail: %d sec | AFK: %i\n", housekey,housekey2,rentkey,intir,vw,realvw,jailt,wjailt, playerAFKTime[targetid]);
		    strcat(str, coordsstring);
			}
		}
		ShowPlayerDialog(playerid, DIALOG_SHOW_INFO, DIALOG_STYLE_MSGBOX, "{33AA33}General Player Information", "Ok", "Close");
  		}
	} ----- LINE 2019
}
Reply
#2

Remove [MAX_PLAYERS+1] from the HouseInfo var, you don't need it.

About the second error, post your full command script.
Reply
#3

Does not work and the second bit shows line 2019.
The second bit is bottom of a joining public!
Reply
#4

pawn Код:
format(coordsstring, sizeof(coordsstring), "House: %d | House 2: %d | Renting: %d | Int: %d | VW: %d | Real VW: %d | Jail: %d sec | WJail: %d sec | AFK: %i\n", housekey,housekey2,rentkey,intir,vw,realvw,jailt,wjailt, playerAFKTime[targetid]);
            strcat(str, coordsstring);
            }
        }
        ShowPlayerDialog(playerid, DIALOG_SHOW_INFO, DIALOG_STYLE_MSGBOX, "{33AA33}General Player Information", "Ok", "Close");
    }
}
After looking at this, it seemed like you put an extra bracket. I removed it, although it might not work because you have not shown us all of the part of the script (up from line 2019).

Also show us a little code which is around/near that new variable you made (House info) and show us the hinfo variable too.
Reply
#5

Код:
ShowStats(playerid,targetid)
{
	if(IsPlayerConnected(targetid)) {
		new cash =  GetPlayerCash(targetid);
		new sext[16], std[20], employer[64], rank[64], division[64], jtext2[20], jtext[20], pnumber[20], facfam[64];
		if(PlayerInfo[targetid][pPnumber] == 0) pnumber = "None"; else format(pnumber, sizeof(pnumber), "%d", PlayerInfo[targetid][pPnumber]);
		if(PlayerInfo[targetid][pSex] == 1) { sext = "Male"; } else { sext = "Female"; }
		switch(STDPlayer[targetid])
		{
//		strmid(married, PlayerInfo[targetid][pMarriedTo], 0, strlen(PlayerInfo[targetid][pMarriedTo]), 255);
		}
		new upgradep = PlayerInfo[targetid][gPupgrade];
		new age = PlayerInfo[targetid][pAge];
		new ptime = PlayerInfo[targetid][pConnectTime];
		new bigfish = PlayerInfo[targetid][pBiggestFish];
		new crimes = PlayerInfo[targetid][pCrimes];
		new arrests = PlayerInfo[targetid][pArrested];
		new pot = PlayerInfo[targetid][pPot];
		new crack = PlayerInfo[targetid][pCrack];
		new heroin = PlayerInfo[targetid][pHeroin];
		new mats = PlayerInfo[targetid][pMats];
		new wanted = PlayerInfo[targetid][pWantedLevel];
		new level = PlayerInfo[targetid][pLevel];
		new exp = PlayerInfo[targetid][pExp];
		new account = PlayerInfo[targetid][pAccount];
		new nxtlevel = PlayerInfo[targetid][pLevel]+1;
		new expamount = nxtlevel*levelexp;
		new costlevel = nxtlevel*levelcost;//10k for testing purposes
		new housekey = PlayerInfo[targetid][pPhousekey];
		new housekey2 = PlayerInfo[targetid][pPhousekey2];
		new rentkey = PlayerInfo[targetid][pRenting];
		new radiofreq = PlayerInfo[targetid][pRadioFreq];
		new intir = GetPlayerInterior(targetid);
		new tokens = PlayerInfo[targetid][pTokens];
		new ptokens = PlayerInfo[targetid][pPaintTokens];
		new checks = PlayerInfo[targetid][pChecks];
		new Float:shealth = PlayerInfo[targetid][pSHealth];
		//new Float:sarmor = PlayerInfo[targetid][pSArmor];
		new Float:health, Float:armor;
		new packages = GetPVarInt(targetid, "Packages");
		new crates = PlayerInfo[targetid][pCrates];
		new rope = PlayerInfo[targetid][pRope],
			rag = PlayerInfo[targetid][pRag],
			cigars = PlayerInfo[targetid][pCigar],
			sprunk = PlayerInfo[targetid][pSprunk],
			spray = PlayerInfo[targetid][pSpraycan],
			opium = PlayerInfo[targetid][pRawOpium],
			realvw = GetPlayerVirtualWorld(targetid),
			vw = PlayerInfo[targetid][pVW],
			warns = PlayerInfo[targetid][pWarns],
			jailt = PlayerInfo[targetid][pJailTime],
			wjailt = PlayerInfo[targetid][pBeingSentenced];
		GetPlayerHealth(targetid,health);
		GetPlayerArmour(targetid,armor);
		new Float:px,Float:py,Float:pz;
		GetPlayerPos(targetid, px, py, pz);
		new totalwealth;
		new name[MAX_PLAYER_NAME];
		GetPlayerName(targetid, name, sizeof(name));
		new nmutes = PlayerInfo[targetid][pNMuteTotal];
		new admutes = PlayerInfo[targetid][pADMuteTotal];
		new oocmutes = PlayerInfo[targetid][pOOCMuteTotal];
		new rpskill = PlayerInfo[targetid][pRPSkill];
		totalwealth = account + cash;
//		if(PlayerInfo[targetid][pPhousekey] != INVALID_HOUSE_ID && strcmp(name, HouseInfo[PlayerInfo[targetid][pPhousekey]][hOwner], true) == 0) totalwealth += HouseInfo[PlayerInfo[targetid][pPhousekey]][hSafeMoney];
//		if(PlayerInfo[targetid][pPhousekey2] != INVALID_HOUSE_ID && strcmp(name, HouseInfo[PlayerInfo[targetid][pPhousekey2]][hOwner], true) == 0) totalwealth += HouseInfo[PlayerInfo[targetid][pPhousekey2]][hSafeMoney];
		new coordsstring[268], str[3000];
		format(coordsstring, sizeof(coordsstring),"%s - Level %d | %s | Age: %d | Total wealth: $%d | Playing hours: %d | Phone number: %s | RP Skill: %d\n", GetPlayerNameEx(targetid), level, sext, age, totalwealth, ptime, pnumber, rpskill);
		strcat(str, coordsstring);
		format(coordsstring, sizeof(coordsstring), "Cash: $%d | Bank balance: $%d | Upgrade points: %d | Spawn armor: %.0f | Next level: %d/%d hours ($%d)\n", cash, account, upgradep, shealth, exp, expamount, costlevel);
		strcat(str, coordsstring);
		format(coordsstring, sizeof(coordsstring), "%s: %s | Rank: %s (%d) | Division: %s | Job: %s (level: %d) | Job 2: %s (level: %d)\n", facfam, employer, rank, PlayerInfo[targetid][pRank], division, jtext,jlevel,jtext2, jlevel2);
		strcat(str, coordsstring);
		format(coordsstring, sizeof(coordsstring), "Crimes: %d | Arrests: %d | Insurance: %s | Wanted level: %d | Health: %.1f | Armor: %.1f | Paintball Tokens: %d | Married to: %s\n",crimes,arrests,insur, wanted, health, armor, ptokens, married);
		strcat(str, coordsstring);
		format(coordsstring, sizeof(coordsstring), "Biggest fish: %d | Pot: %d | Crack: %d | Heroin: %d | Opium: %d | Packages: %d | Crates: %d | Radio frequency: %d mhz\n",bigfish,pot,crack,heroin,opium,packages,crates, radiofreq);
		strcat(str, coordsstring);
		format(coordsstring, sizeof(coordsstring), "Materials: %d | Rope: %d | Rag: %d | Cigars: %d | Sprunk: %d | Spray: %d | Screwdrivers: %d | VIP tokens: %d | Checks: %d | VIP: %s\n",mats,rope,rag,cigars,sprunk,spray, PlayerInfo[targetid][pScrewdriver],tokens,checks,drank);
		strcat(str, coordsstring);
		format(coordsstring, sizeof(coordsstring), "Meth: %d | Acid: %d L | Cold Meds: %d | Baking Soda: %d | CDL Trucking Level: %d | CDL Trucking XP: %d\n", PlayerInfo[targetid][pMeth], PlayerInfo[targetid][pBatteryAcid], PlayerInfo[targetid][pColdMeds], PlayerInfo[targetid][pCrackStuff], PlayerInfo[targetid][pTruckingLevel],PlayerInfo[targetid][pTruckingXP]);
		strcat(str, coordsstring);
		format(coordsstring, sizeof(coordsstring), "OOCMutes: %d | ADMutes: %d | NMutes: %d | RMutes: %d | Weapons Restricted: %d | Gang Warns: %d | Warnings: %d\n", oocmutes, admutes, nmutes, PlayerInfo[targetid][pRMutedTotal],PlayerInfo[targetid][pWRestricted], PlayerInfo[targetid][pGangWarn], warns);
		strcat(str, coordsstring);
		if (PlayerInfo[playerid][pAdmin] >= 2)
		{
			format(coordsstring, sizeof(coordsstring), "House: %d | House 2: %d | Renting: %d | Int: %d | VW: %d | Real VW: %d | Jail: %d sec | WJail: %d sec | AFK: %i\n", housekey,housekey2,rentkey,intir,vw,realvw,jailt,wjailt, playerAFKTime[targetid]);
            strcat(str, coordsstring);
            }
        }
        ShowPlayerDialog(playerid, DIALOG_SHOW_INFO, DIALOG_STYLE_MSGBOX, "{33AA33}General Player Information", "Ok", "Close");
    }
}
Reply
#6

pawn Код:
ShowStats(playerid,targetid)
{
    if(IsPlayerConnected(targetid))
    {
        new cash =  GetPlayerCash(targetid);
        new sext[16], std[20], employer[64], rank[64], division[64], jtext2[20], jtext[20], pnumber[20], facfam[64];
        if(PlayerInfo[targetid][pPnumber] == 0) pnumber = "None"; else format(pnumber, sizeof(pnumber), "%d", PlayerInfo[targetid][pPnumber]);
        if(PlayerInfo[targetid][pSex] == 1) { sext = "Male"; } else { sext = "Female"; }
        switch(STDPlayer[targetid])
        {
//          strmid(married, PlayerInfo[targetid][pMarriedTo], 0, strlen(PlayerInfo[targetid][pMarriedTo]), 255);
        }
        new upgradep = PlayerInfo[targetid][gPupgrade];
        new age = PlayerInfo[targetid][pAge];
        new ptime = PlayerInfo[targetid][pConnectTime];
        new bigfish = PlayerInfo[targetid][pBiggestFish];
        new crimes = PlayerInfo[targetid][pCrimes];
        new arrests = PlayerInfo[targetid][pArrested];
        new pot = PlayerInfo[targetid][pPot];
        new crack = PlayerInfo[targetid][pCrack];
        new heroin = PlayerInfo[targetid][pHeroin];
        new mats = PlayerInfo[targetid][pMats];
        new wanted = PlayerInfo[targetid][pWantedLevel];
        new level = PlayerInfo[targetid][pLevel];
        new exp = PlayerInfo[targetid][pExp];
        new account = PlayerInfo[targetid][pAccount];
        new nxtlevel = PlayerInfo[targetid][pLevel]+1;
        new expamount = nxtlevel*levelexp;
        new costlevel = nxtlevel*levelcost;//10k for testing purposes
        new housekey = PlayerInfo[targetid][pPhousekey];
        new housekey2 = PlayerInfo[targetid][pPhousekey2];
        new rentkey = PlayerInfo[targetid][pRenting];
        new radiofreq = PlayerInfo[targetid][pRadioFreq];
        new intir = GetPlayerInterior(targetid);
        new tokens = PlayerInfo[targetid][pTokens];
        new ptokens = PlayerInfo[targetid][pPaintTokens];
        new checks = PlayerInfo[targetid][pChecks];
        new Float:shealth = PlayerInfo[targetid][pSHealth];
        //new Float:sarmor = PlayerInfo[targetid][pSArmor];
        new Float:health, Float:armor;
        new packages = GetPVarInt(targetid, "Packages");
        new crates = PlayerInfo[targetid][pCrates];
        new rope = PlayerInfo[targetid][pRope],
            rag = PlayerInfo[targetid][pRag],
            cigars = PlayerInfo[targetid][pCigar],
            sprunk = PlayerInfo[targetid][pSprunk],
            spray = PlayerInfo[targetid][pSpraycan],
            opium = PlayerInfo[targetid][pRawOpium],
            realvw = GetPlayerVirtualWorld(targetid),
            vw = PlayerInfo[targetid][pVW],
            warns = PlayerInfo[targetid][pWarns],
            jailt = PlayerInfo[targetid][pJailTime],
            wjailt = PlayerInfo[targetid][pBeingSentenced];
        GetPlayerHealth(targetid,health);
        GetPlayerArmour(targetid,armor);
        new Float:px,Float:py,Float:pz;
        GetPlayerPos(targetid, px, py, pz);
        new totalwealth;
        new name[MAX_PLAYER_NAME];
        GetPlayerName(targetid, name, sizeof(name));
        new nmutes = PlayerInfo[targetid][pNMuteTotal];
        new admutes = PlayerInfo[targetid][pADMuteTotal];
        new oocmutes = PlayerInfo[targetid][pOOCMuteTotal];
        new rpskill = PlayerInfo[targetid][pRPSkill];
        totalwealth = account + cash;
//      if(PlayerInfo[targetid][pPhousekey] != INVALID_HOUSE_ID && strcmp(name, HouseInfo[PlayerInfo[targetid][pPhousekey]][hOwner], true) == 0) totalwealth += HouseInfo[PlayerInfo[targetid][pPhousekey]][hSafeMoney];
//      if(PlayerInfo[targetid][pPhousekey2] != INVALID_HOUSE_ID && strcmp(name, HouseInfo[PlayerInfo[targetid][pPhousekey2]][hOwner], true) == 0) totalwealth += HouseInfo[PlayerInfo[targetid][pPhousekey2]][hSafeMoney];
        new coordsstring[268], str[3000];
        format(coordsstring, sizeof(coordsstring),"%s - Level %d | %s | Age: %d | Total wealth: $%d | Playing hours: %d | Phone number: %s | RP Skill: %d\n", GetPlayerNameEx(targetid), level, sext, age, totalwealth, ptime, pnumber, rpskill);
        strcat(str, coordsstring);
        format(coordsstring, sizeof(coordsstring), "Cash: $%d | Bank balance: $%d | Upgrade points: %d | Spawn armor: %.0f | Next level: %d/%d hours ($%d)\n", cash, account, upgradep, shealth, exp, expamount, costlevel);
        strcat(str, coordsstring);
        format(coordsstring, sizeof(coordsstring), "%s: %s | Rank: %s (%d) | Division: %s | Job: %s (level: %d) | Job 2: %s (level: %d)\n", facfam, employer, rank, PlayerInfo[targetid][pRank], division, jtext,jlevel,jtext2, jlevel2);
        strcat(str, coordsstring);
        format(coordsstring, sizeof(coordsstring), "Crimes: %d | Arrests: %d | Insurance: %s | Wanted level: %d | Health: %.1f | Armor: %.1f | Paintball Tokens: %d | Married to: %s\n",crimes,arrests,insur, wanted, health, armor, ptokens, married);
        strcat(str, coordsstring);
        format(coordsstring, sizeof(coordsstring), "Biggest fish: %d | Pot: %d | Crack: %d | Heroin: %d | Opium: %d | Packages: %d | Crates: %d | Radio frequency: %d mhz\n",bigfish,pot,crack,heroin,opium,packages,crates, radiofreq);
        strcat(str, coordsstring);
        format(coordsstring, sizeof(coordsstring), "Materials: %d | Rope: %d | Rag: %d | Cigars: %d | Sprunk: %d | Spray: %d | Screwdrivers: %d | VIP tokens: %d | Checks: %d | VIP: %s\n",mats,rope,rag,cigars,sprunk,spray, PlayerInfo[targetid][pScrewdriver],tokens,checks,drank);
        strcat(str, coordsstring);
        format(coordsstring, sizeof(coordsstring), "Meth: %d | Acid: %d L | Cold Meds: %d | Baking Soda: %d | CDL Trucking Level: %d | CDL Trucking XP: %d\n", PlayerInfo[targetid][pMeth], PlayerInfo[targetid][pBatteryAcid], PlayerInfo[targetid][pColdMeds], PlayerInfo[targetid][pCrackStuff], PlayerInfo[targetid][pTruckingLevel],PlayerInfo[targetid][pTruckingXP]);
        strcat(str, coordsstring);
        format(coordsstring, sizeof(coordsstring), "OOCMutes: %d | ADMutes: %d | NMutes: %d | RMutes: %d | Weapons Restricted: %d | Gang Warns: %d | Warnings: %d\n", oocmutes, admutes, nmutes, PlayerInfo[targetid][pRMutedTotal],PlayerInfo[targetid][pWRestricted], PlayerInfo[targetid][pGangWarn], warns);
        strcat(str, coordsstring);
        if (PlayerInfo[playerid][pAdmin] >= 2)
        {
            format(coordsstring, sizeof(coordsstring), "House: %d | House 2: %d | Renting: %d | Int: %d | VW: %d | Real VW: %d | Jail: %d sec | WJail: %d sec | AFK: %i\n", housekey,housekey2,rentkey,intir,vw,realvw,jailt,wjailt, playerAFKTime[targetid]);
            strcat(str, coordsstring);
        }
        ShowPlayerDialog(playerid, DIALOG_SHOW_INFO, DIALOG_STYLE_MSGBOX, "{33AA33}General Player Information", "Ok", "Close");
    }
}
This shall work.
Reply
#7

Works

Thanks man but I have this error:
Quote:

C:\Users\Callum.Acer\Desktop\Scripting extra\gamemodes\Millenium.pwn(700) : error 029: invalid expression, assumed zero

Код:
enum hInfo
{
	hOwned,
	hLevel,
	hHInteriorWorld,
	hCustomInterior,
	hDescription[128],
	hOwner[ MAX_PLAYER_NAME ],
	Float: hExteriorX,
	Float: hExteriorY,
	Float: hExteriorZ,
	Float: hExteriorR,
	Float: hExteriorA,
	Float: hInteriorX,
	Float: hInteriorY,
	Float: hInteriorZ,
	Float: hInteriorR,
	Float: hInteriorA,
	hLock,
	hRentable,
	hRentFee,
	hValue,
	hSafeMoney,
	hPot,
	hSeeds,
	hBatteryAcid,
	hCrackStuff,
	hSyringes,
	hCrack,
	hHeroin,
	hMeth,
	hMaterials,
	hWeapons[ 5 ],
	hGLUpgrade,
	hPickupID,
	Text3D: hTextID,
	hCustomExterior,
	hFlag,
	hWepAmmo[ 5 ],
	hMapIcon,
}
new HouseInfo[MAX_PLAYERS][MAX_HOUSES][hInfo]; LINE 700
Reply
#8

pawn Код:
enum hInfo
{
    hOwned,
    hLevel,
    hHInteriorWorld,
    hCustomInterior,
    hDescription[128],
    hOwner[ MAX_PLAYER_NAME ],
    Float: hExteriorX,
    Float: hExteriorY,
    Float: hExteriorZ,
    Float: hExteriorR,
    Float: hExteriorA,
    Float: hInteriorX,
    Float: hInteriorY,
    Float: hInteriorZ,
    Float: hInteriorR,
    Float: hInteriorA,
    hLock,
    hRentable,
    hRentFee,
    hValue,
    hSafeMoney,
    hPot,
    hSeeds,
    hBatteryAcid,
    hCrackStuff,
    hSyringes,
    hCrack,
    hHeroin,
    hMeth,
    hMaterials,
    hWeapons[ 5 ],
    hGLUpgrade,
    hPickupID,
    Text3D: hTextID,
    hCustomExterior,
    hFlag,
    hWepAmmo[ 5 ],
    hMapIcon,
};
new HouseInfo[MAX_PLAYERS][MAX_HOUSES][hInfo];
Here you go.
Reply
#9

have u defined MAX_HOUSES?
pawn Код:
#define MAX_HOUSES 500
Reply
#10

@Eth,
If MAX_HOUSES wasn't defined, PAWNO should have returned the undefined symbol error, if I'm not mistaken.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)