Expression [REP] -
fireranger11 - 20.05.2017
(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]);
Re: Expression [REP] -
Aly - 20.05.2017
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
Re: Expression [REP] -
fireranger11 - 20.05.2017
Код:
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;
}
Re: Expression [REP] -
fireranger11 - 20.05.2017
My code
Re: Expression [REP] -
Aly - 20.05.2017
Код:
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;
}
Re: Expression [REP] -
fireranger11 - 20.05.2017
Same errors
Re: Expression [REP] -
Aly - 20.05.2017
Can you show me the lines where the error occurs?
Re: Expression [REP] -
StrikerZ - 20.05.2017
PHP код:
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";
}
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(str2, sizeof(str2), " {%06x}%s(%i)'s account statistics\n\n%s", (GetPlayerColor(giveid) >>> 8), GetName(giveid), giveid,str);
ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, str2, str, "OK", "");
return 1;
}
Re: Expression [REP] -
fireranger11 - 20.05.2017
Same lines
Re: Expression [REP] -
Aly - 20.05.2017
Код:
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.