Expression [REP]
#1

(6382 -- 6384) : error 012: invalid function call, not a valid address
(6384) : warning 215: expression has no effect
(6384) : error 001: expected token: ";", but found ")"
(6384) : error 029: invalid expression, assumed zero
(6384) : fatal error 107: too many error messages on one line



format(str, sizeof str, str, PlayerInfo[giveid][AccID], GetPlayerScore(giveid), GetPlayerMoney(giveid), PlayerInfo[giveid][Admin], AdminRank, PlayerInfo[giveid][VIP],
PlayerInfo[giveid][RegOn], weaponset, GetPlayerSkin(giveid), PlayerInfo[giveid][Kills], PlayerInfo[giveid][Deaths], PlayerInfo[giveid][MBsFound],
PlayerInfo[giveid][ReactionsWon], LMSWins(giveid), PlayerInfo[giveid]FalloutsWon], FalloutsWon[giveid]);
Reply
#2

You're not using the function "format" properly.
Here's an example of using "format":
Код:
new string[128];
new value = 10, Float:floatValue = 12.0, text[3];
format(text, sizeof(text), "Hi");
format(string, sizeof(string), "%s, int value = %d, float value = %f", text, value, floatValue);
SendClientMessage(playerid, 0xFFFFFFFF, string);
This code will print:
Код:
Hi, int value = 10, float value = 12.00000
Maybe you tried to do something like this:
Код:
format(str, sizeof(str), str, PlayerInfo[giveid][AccID], GetPlayerScore(giveid), GetPlayerMoney(giveid), PlayerInfo[giveid][Admin], AdminRank, PlayerInfo[giveid][VIP],
PlayerInfo[giveid][RegOn], weaponset, GetPlayerSkin(giveid), PlayerInfo[giveid][Kills], PlayerInfo[giveid][Deaths], PlayerInfo[giveid][MBsFound],
PlayerInfo[giveid][ReactionsWon], LMSWins(giveid), PlayerInfo[giveid]FalloutsWon], FalloutsWon[giveid]);
You forgot () for
Код:
sizeof(str)
Reply
#3

Код:
CMD:stats (playerid, params[])
{
    new str[900], str2[70], giveid, AdminRank[30], weaponset[30];
    if (sscanf(params, "u", giveid)) return SendClientMessage(playerid, 0x6FFF00FF, "{F07F1D}USAGE: {BBFF00}/stats ");
    if (giveid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"Invalid player ID!");
    switch (PlayerInfo[giveid][Admin])
    {
        case 0: AdminRank = "Regular Player";
        case 1: AdminRank = "{15C257}Moderator";
        case 2: AdminRank = "{EDD628}Administrator";
        case 3: AdminRank = "{3D77F5}Head Administrator";
        case 4: AdminRank = "{F55F3D}Server Owner";
    }
    switch (PlayerInfo[giveid][WeaponSet])
    {
        case 0: weaponset = "Standard";
        case 1: weaponset = "Advanced";
        case 2: weaponset = "Expert";
        case 3: weaponset = "Custom";
    }
    new str3[40];
    strcat(str3, ""ORANGE"IP Address: \t\t"WHITE"["STEELBLUE"%s"WHITE"]\n");
    strcat(str, ""ORANGE"Account ID: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Score:	\t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Money:	\t\t"WHITE"["STEELBLUE"$%i"WHITE"]\n");
    strcat(str, ""ORANGE"Bank Cash: \t\t"WHITE"["STEELBLUE"$%i"WHITE"]\n");
    strcat(str, ""ORANGE"Admin Level: \t\t"WHITE"["STEELBLUE"%i"WHITE"] - "WHITE"[%s"WHITE"]\n");
    strcat(str, ""ORANGE"V.I.P. Level: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Member since: \t\t"WHITE"["STEELBLUE"%s"WHITE"]\n");
    strcat(str, ""ORANGE"Weaponset: \t\t"WHITE"["STEELBLUE"%s"WHITE"]\n");
    strcat(str, ""ORANGE"Skin ID: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Kills: \t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Deaths: \t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Money bags found: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Reaction test won:\t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"LMS events won: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Fallouts Won: \t\t"WHITE"["STEELBLUE"%d"WHITE"]\n");
    if(PlayerInfo[playerid][Admin] == 0)
    {
        format(str, sizeof str, str, PlayerInfo[giveid][AccID], GetPlayerScore(giveid), GetPlayerMoney(giveid), PlayerInfo[giveid][Admin], AdminRank, PlayerInfo[giveid][VIP],
        PlayerInfo[giveid][RegOn], weaponset, GetPlayerSkin(giveid), PlayerInfo[giveid][Kills], PlayerInfo[giveid][Deaths], PlayerInfo[giveid][MBsFound],
        PlayerInfo[giveid][ReactionsWon], LMSWins(giveid), PlayerInfo[giveid]FalloutsWon], FalloutsWon[giveid]);
    }
    else if(PlayerInfo[playerid][Admin] >= 1)
    {
        format(str, sizeof str, str, PlayerInfo[giveid][AccID], GetPlayerScore(giveid), GetPlayerMoney(giveid), Bank_Balance[playerid], PlayerInfo[giveid][Admin], AdminRank, PlayerInfo[giveid][VIP],
        PlayerInfo[giveid][RegOn], weaponset, GetPlayerSkin(giveid), PlayerInfo[giveid][Kills], PlayerInfo[giveid][Deaths], PlayerInfo[giveid][MBsFound],
        PlayerInfo[giveid][ReactionsWon], LMSWins[giveid], PlayerInfo[giveid]FalloutsWon], FalloutsWon(giveid), str3, GetIP(giveid));
    }
    format(str2, sizeof str2, " {%06x}%s(%i)'s account statistics", (GetPlayerColor(giveid) >>> 8), GetName(giveid), giveid);
    ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, str2, str, "OK", "");
    return 1;
}
Reply
#4

My code
Reply
#5

Код:
CMD:stats(playerid, params[])
{
    new str[900], str2[70], giveid, AdminRank[30], weaponset[30];
    if (sscanf(params, "u", giveid)) return SendClientMessage(playerid, 0x6FFF00FF, "{F07F1D}USAGE: {BBFF00}/stats ");
    if (giveid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"Invalid player ID!");
    switch (PlayerInfo[giveid][Admin])
    {
        case 0: AdminRank = "Regular Player";
        case 1: AdminRank = "{15C257}Moderator";
        case 2: AdminRank = "{EDD628}Administrator";
        case 3: AdminRank = "{3D77F5}Head Administrator";
        case 4: AdminRank = "{F55F3D}Server Owner";
    }
    switch (PlayerInfo[giveid][WeaponSet])
    {
        case 0: weaponset = "Standard";
        case 1: weaponset = "Advanced";
        case 2: weaponset = "Expert";
        case 3: weaponset = "Custom";
    }
    new str3[40];
    strcat(str3, ""ORANGE"IP Address: \t\t"WHITE"["STEELBLUE"%s"WHITE"]\n");
    strcat(str, ""ORANGE"Account ID: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Score:	\t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Money:	\t\t"WHITE"["STEELBLUE"$%i"WHITE"]\n");
    strcat(str, ""ORANGE"Bank Cash: \t\t"WHITE"["STEELBLUE"$%i"WHITE"]\n");
    strcat(str, ""ORANGE"Admin Level: \t\t"WHITE"["STEELBLUE"%i"WHITE"] - "WHITE"[%s"WHITE"]\n");
    strcat(str, ""ORANGE"V.I.P. Level: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Member since: \t\t"WHITE"["STEELBLUE"%s"WHITE"]\n");
    strcat(str, ""ORANGE"Weaponset: \t\t"WHITE"["STEELBLUE"%s"WHITE"]\n");
    strcat(str, ""ORANGE"Skin ID: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Kills: \t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Deaths: \t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Money bags found: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Reaction test won:\t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"LMS events won: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Fallouts Won: \t\t"WHITE"["STEELBLUE"%d"WHITE"]\n");
    if(PlayerInfo[playerid][Admin] == 0)
    {
        format(str, sizeof(str), str, PlayerInfo[giveid][AccID], GetPlayerScore(giveid), GetPlayerMoney(giveid), PlayerInfo[giveid][Admin], AdminRank, PlayerInfo[giveid][VIP],
        PlayerInfo[giveid][RegOn], weaponset, GetPlayerSkin(giveid), PlayerInfo[giveid][Kills], PlayerInfo[giveid][Deaths], PlayerInfo[giveid][MBsFound],
        PlayerInfo[giveid][ReactionsWon], LMSWins(giveid), PlayerInfo[giveid]FalloutsWon], FalloutsWon[giveid]);
    }
    else if(PlayerInfo[playerid][Admin] >= 1)
    {
        format(str, sizeof(str), str, PlayerInfo[giveid][AccID], GetPlayerScore(giveid), GetPlayerMoney(giveid), Bank_Balance[playerid], PlayerInfo[giveid][Admin], AdminRank, PlayerInfo[giveid][VIP],
        PlayerInfo[giveid][RegOn], weaponset, GetPlayerSkin(giveid), PlayerInfo[giveid][Kills], PlayerInfo[giveid][Deaths], PlayerInfo[giveid][MBsFound],
        PlayerInfo[giveid][ReactionsWon], LMSWins[giveid], PlayerInfo[giveid]FalloutsWon], FalloutsWon(giveid), str3, GetIP(giveid));
    }
    format(str2, sizeof(str2), " {%06x}%s(%i)'s account statistics", (GetPlayerColor(giveid) >>> 8), GetName(giveid), giveid);
    ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, str2, str, "OK", "");
    return 1;
}
Reply
#6

Same errors
Reply
#7

Can you show me the lines where the error occurs?
Reply
#8

PHP код:
CMD:stats(playeridparams[])
{
    new 
str[900], str2[70], giveidAdminRank[30], weaponset[30];
    if (
sscanf(params"u"giveid)) return SendClientMessage(playerid0x6FFF00FF"{F07F1D}USAGE: {BBFF00}/stats ");
    if (
giveid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1""RED"ERROR: "GREY"Invalid player ID!");
    switch (
PlayerInfo[giveid][Admin])
    {
        case 
0AdminRank "Regular Player";
        case 
1AdminRank "{15C257}Moderator";
        case 
2AdminRank "{EDD628}Administrator";
        case 
3AdminRank "{3D77F5}Head Administrator";
        case 
4AdminRank "{F55F3D}Server Owner";
    }
    switch (
PlayerInfo[giveid][WeaponSet])
    {
        case 
0weaponset "Standard";
        case 
1weaponset "Advanced";
        case 
2weaponset "Expert";
        case 
3weaponset "Custom";
    }
    if(
PlayerInfo[playerid][Admin] >= 1)
    {
        
format(str,sizeof(str),""ORANGE"IP Address: \t\t"WHITE"["STEELBLUE"%s"WHITE"]\n",GetIP(giveid));
        
format(str,sizeof(str),""ORANGE"Account ID: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n",PlayerInfo[giveid][AccID]);
        
format(str,sizeof(str),""ORANGE"Score:    \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n",GetPlayerScore(giveid));
        
format(str,sizeof(str),""ORANGE"Money:    \t\t"WHITE"["STEELBLUE"$%i"WHITE"]\n",GetPlayerMoney(giveid));
        
format(str,sizeof(str),""ORANGE"Bank Cash: \t\t"WHITE"["STEELBLUE"$%i"WHITE"]\n",Bank_Balance[playerid]);
        
format(str,sizeof(str),""ORANGE"Admin Level: \t\t"WHITE"["STEELBLUE"%i"WHITE"] - "WHITE"[%s"WHITE"]\n",PlayerInfo[giveid][Admin]);
        
format(str,sizeof(str),""ORANGE"V.I.P. Level: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n",PlayerInfo[giveid][VIP]);
        
format(str,sizeof(str),""ORANGE"Member since: \t\t"WHITE"["STEELBLUE"%s"WHITE"]\n",PlayerInfo[giveid][RegOn]);
        
format(str,sizeof(str),""ORANGE"Weaponset: \t\t"WHITE"["STEELBLUE"%s"WHITE"]\n",weaponset);
        
format(str,sizeof(str),""ORANGE"Skin ID: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n",GetPlayerSkin(giveid));
        
format(str,sizeof(str),""ORANGE"Kills: \t"WHITE"["STEELBLUE"%i"WHITE"]\n",PlayerInfo[giveid][Kills]);
        
format(str,sizeof(str),""ORANGE"Deaths: \t"WHITE"["STEELBLUE"%i"WHITE"]\n",PlayerInfo[giveid][Deaths]);
        
format(str,sizeof(str),""ORANGE"Money bags found: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n",PlayerInfo[giveid][MBsFound]);
        
format(str,sizeof(str),""ORANGE"Reaction test won:\t\t"WHITE"["STEELBLUE"%i"WHITE"]\n",PlayerInfo[giveid][ReactionsWon]);
        
format(str,sizeof(str),""ORANGE"LMS events won: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n",LMSWins(giveid));
        
format(str,sizeof(str),""ORANGE"Fallouts Won: \t\t"WHITE"["STEELBLUE"%d"WHITE"]\n",PlayerInfo[giveid]FalloutsWon]);
    }
    else
    {
        
format(str,sizeof(str),""ORANGE"Account ID: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n",PlayerInfo[giveid][AccID]);
        
format(str,sizeof(str),""ORANGE"Score:    \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n",GetPlayerScore(giveid));
        
format(str,sizeof(str),""ORANGE"Money:    \t\t"WHITE"["STEELBLUE"$%i"WHITE"]\n",GetPlayerMoney(giveid));
        
format(str,sizeof(str),""ORANGE"Admin Level: \t\t"WHITE"["STEELBLUE"%i"WHITE"] - "WHITE"[%s"WHITE"]\n",PlayerInfo[giveid][Admin]);
        
format(str,sizeof(str),""ORANGE"V.I.P. Level: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n",PlayerInfo[giveid][VIP]);
        
format(str,sizeof(str),""ORANGE"Member since: \t\t"WHITE"["STEELBLUE"%s"WHITE"]\n",PlayerInfo[giveid][RegOn]);
        
format(str,sizeof(str),""ORANGE"Weaponset: \t\t"WHITE"["STEELBLUE"%s"WHITE"]\n",weaponset);
        
format(str,sizeof(str),""ORANGE"Skin ID: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n",GetPlayerSkin(giveid));
        
format(str,sizeof(str),""ORANGE"Kills: \t"WHITE"["STEELBLUE"%i"WHITE"]\n",PlayerInfo[giveid][Kills]);
        
format(str,sizeof(str),""ORANGE"Deaths: \t"WHITE"["STEELBLUE"%i"WHITE"]\n",PlayerInfo[giveid][Deaths]);
        
format(str,sizeof(str),""ORANGE"Money bags found: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n",PlayerInfo[giveid][MBsFound]);
        
format(str,sizeof(str),""ORANGE"Reaction test won:\t\t"WHITE"["STEELBLUE"%i"WHITE"]\n",PlayerInfo[giveid][ReactionsWon]);
        
format(str,sizeof(str),""ORANGE"LMS events won: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n",LMSWins(giveid));
        
format(str,sizeof(str),""ORANGE"Fallouts Won: \t\t"WHITE"["STEELBLUE"%d"WHITE"]\n",PlayerInfo[giveid]FalloutsWon]);
    }
    
format(str2sizeof(str2), " {%06x}%s(%i)'s account statistics\n\n%s", (GetPlayerColor(giveid) >>> 8), GetName(giveid), giveid,str);
    
ShowPlayerDialog(playeridDIALOG_STATSDIALOG_STYLE_MSGBOXstr2str"OK""");
    return 
1;

Reply
#9

Same lines
Reply
#10

Код:
CMD:stats(playerid, params[])
{
    new str[900], str2[70], giveid, AdminRank[30], weaponset[30];
    if (sscanf(params, "u", giveid)) return SendClientMessage(playerid, 0x6FFF00FF, "{F07F1D}USAGE: {BBFF00}/stats ");
    if (giveid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"Invalid player ID!");
    switch (PlayerInfo[giveid][Admin])
    {
        case 0: AdminRank = "Regular Player";
        case 1: AdminRank = "{15C257}Moderator";
        case 2: AdminRank = "{EDD628}Administrator";
        case 3: AdminRank = "{3D77F5}Head Administrator";
        case 4: AdminRank = "{F55F3D}Server Owner";
    }
    switch (PlayerInfo[giveid][WeaponSet])
    {
        case 0: weaponset = "Standard";
        case 1: weaponset = "Advanced";
        case 2: weaponset = "Expert";
        case 3: weaponset = "Custom";
    }
    new str3[40];
    strcat(str3, ""ORANGE"IP Address: \t\t"WHITE"["STEELBLUE"%s"WHITE"]\n");
    strcat(str, ""ORANGE"Account ID: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Score:	\t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Money:	\t\t"WHITE"["STEELBLUE"$%i"WHITE"]\n");
    strcat(str, ""ORANGE"Bank Cash: \t\t"WHITE"["STEELBLUE"$%i"WHITE"]\n");
    strcat(str, ""ORANGE"Admin Level: \t\t"WHITE"["STEELBLUE"%i"WHITE"] - "WHITE"[%s"WHITE"]\n");
    strcat(str, ""ORANGE"V.I.P. Level: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Member since: \t\t"WHITE"["STEELBLUE"%s"WHITE"]\n");
    strcat(str, ""ORANGE"Weaponset: \t\t"WHITE"["STEELBLUE"%s"WHITE"]\n");
    strcat(str, ""ORANGE"Skin ID: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Kills: \t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Deaths: \t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Money bags found: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Reaction test won:\t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"LMS events won: \t\t"WHITE"["STEELBLUE"%i"WHITE"]\n");
    strcat(str, ""ORANGE"Fallouts Won: \t\t"WHITE"["STEELBLUE"%d"WHITE"]\n");
    if(PlayerInfo[playerid][Admin] == 0)
    {
        format(str, sizeof(str), str, PlayerInfo[giveid][AccID], GetPlayerScore(giveid), GetPlayerMoney(giveid), PlayerInfo[giveid][Admin], AdminRank, PlayerInfo[giveid][VIP],
        PlayerInfo[giveid][RegOn], weaponset, GetPlayerSkin(giveid), PlayerInfo[giveid][Kills], PlayerInfo[giveid][Deaths], PlayerInfo[giveid][MBsFound],
        PlayerInfo[giveid][ReactionsWon], LMSWins(giveid), PlayerInfo[giveid][FalloutsWon], FalloutsWon[giveid]);
    }
    else if(PlayerInfo[playerid][Admin] >= 1)
    {
        format(str, sizeof(str), str, PlayerInfo[giveid][AccID], GetPlayerScore(giveid), GetPlayerMoney(giveid), Bank_Balance[playerid], PlayerInfo[giveid][Admin], AdminRank, PlayerInfo[giveid][VIP],
        PlayerInfo[giveid][RegOn], weaponset, GetPlayerSkin(giveid), PlayerInfo[giveid][Kills], PlayerInfo[giveid][Deaths], PlayerInfo[giveid][MBsFound],
        PlayerInfo[giveid][ReactionsWon], LMSWins[giveid], PlayerInfo[giveid][FalloutsWon], FalloutsWon(giveid), str3, GetIP(giveid));
    }
    format(str2, sizeof(str2), " {%06x}%s(%i)'s account statistics", (GetPlayerColor(giveid) >>> 8), GetName(giveid), giveid);
    ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, str2, str, "OK", "");
    return 1;
}
Be careful with the parentheses.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)