new pInfo[MAX_PLAYERS][PlayerInfo];
enum PlayerInfo
{
Pass[129], //User's password
Adminlevel, //User's admin level
VIPlevel, //User's vip level
Money, //User's money
Scores, //User's scores
Kills, //User's kills
Skin, //User's Skin
Deaths //User's deaths
}
CMD:stats(playerid, params[]);
new id;
sscanf(params, "u", id);
if (isnull(params))
{
ShowPlayerDialog(playerid,dstats,DIALOG_STYLE_MSGBOX, "%s", "Account: %s\nMoney: $%d\nKills: %d\nDeaths: %d",GetPlayerName(playerid),GetPlayerMoney(playerid),pInfo[playerid][Kills],pInfo[playerid][Deaths] "Close", "");
else if(IsPlayerConnected(id))
{
ShowPlayerDialog(playerid,dstats,DIALOG_STYLE_MSGBOX, "%s", "Account: %s\nMoney: $%d\nKills: %d\nDeaths: %d",GetPlayerName(id),GetPlayerMoney(id),pInfo[id][Kills],pInfo[id][Deaths] "Close", "");
}
else return SendClientMessage(playerid,0xFF000080,"Player has not logged in the server!");
}
if (isnull(params))
{
ShowPlayerDialog(playerid,dstats,DIALOG_STYLE_MSGBOX, "%s", "Account: %s\nMoney: $%d\nKills: %d\nDeaths: %d",GetPlayerName(playerid),GetPlayerMoney(playerid),pInfo[playerid][Kills],pInfo[playerid][Deaths] "Close", "");
if(IsPlayerConnected(id))
{
ShowPlayerDialog(playerid,dstats,DIALOG_STYLE_MSGBOX, "%s", "Account: %s\nMoney: $%d\nKills: %d\nDeaths: %d",GetPlayerName(id),GetPlayerMoney(id),pInfo[id][Kills],pInfo[id][Deaths] "Close", "");
}
else return SendClientMessage(playerid,0xFF000080,"Player has not logged in the server!");
}
sscanf(params, "u", id);
if (isnull(params))
{
ShowPlayerDialog(playerid,dstats,DIALOG_STYLE_MSGBOX, "%s", "Account: %s\nMoney: $%d\nKills: %d\nDeaths: %d",GetPlayerName(playerid),GetPlayerMoney(playerid),pInfo[playerid][Kills],pInfo[playerid][Deaths] "Close", "");
if(IsPlayerConnected(id))
{
ShowPlayerDialog(playerid,dstats,DIALOG_STYLE_MSGBOX, "%s", "Account: %s\nMoney: $%d\nKills: %d\nDeaths: %d",GetPlayerName(id),GetPlayerMoney(id),pInfo[id][Kills],pInfo[id][Deaths] "Close", "");
}
else return SendClientMessage(playerid,0xFF000080,"Player has not logged in the server!");
}
error 010: invalid function or declaration
You are using an else-if statement which is nested inside an IF statement.
pawn Код:
pawn Код:
|
CMD:stats(playerid, params[]);
Oh, I got that from another script to check if the player typed the correct usage. I removed it anyway and still got the same error
|
CMD:stats(playerid, params[])
{
new id, pName[MAX_PLAYER_NAME], Dialog[500];
if(sscanf(params, "u", id))
{
GetPlayerName(playerid, pName, sizeof(pName));
format(Dialog, sizeof(Dialog), "Account: %s\nMoney: $%d\nKills: %d\nDeaths: %d", pName, GetPlayerMoney(playerid),pInfo[playerid][Kills],pInfo[playerid][Deaths]);
ShowPlayerDialog(playerid,dstats,DIALOG_STYLE_MSGBOX, pName, Dialog, "Close", "");
return 1;
}
if(!IsPlayerConnected(id)) return GameTextForPlayer(playerid, "~g~Player disconnected", 3000, 3);
GetPlayerName(id, pName, sizeof(pName));
format(Dialog, sizeof(Dialog), "Account: %s\nMoney: $%d\nKills: %d\nDeaths: %d", pName, GetPlayerMoney(id), pInfo[id][Kills], pInfo[id][Deaths]);
ShowPlayerDialog(playerid,dstats,DIALOG_STYLE_MSGBOX, pName, Dialog, "Close", "");
return 1;
}
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(185) : error 029: invalid expression, assumed zero
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(185) : warning 215: expression has no effect
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(185) : warning 215: expression has no effect
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(185) : warning 215: expression has no effect
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(185) : warning 202: number of arguments does not match definition
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(185) : warning 202: number of arguments does not match definition
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(185) : warning 215: expression has no effect
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(185) : warning 215: expression has no effect
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(185) : error 001: expected token: ";", but found "-string-"
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(185) : warning 215: expression has no effect
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(185) : warning 215: expression has no effect
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(185) : error 001: expected token: ";", but found ")"
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(185) : fatal error 107: too many error messages on one line
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(182) : error 055: start of function body without function header
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(185) : error 010: invalid function or declaration
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(190) : error 010: invalid function or declaration
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(192) : error 010: invalid function or declaration
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(194) : error 021: symbol already defined: "GetPlayerName"
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(197) : error 010: invalid function or declaration
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(199) : warning 203: symbol is never used: "Dialog"
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(199) : warning 203: symbol is never used: "id"
C:\Users\Ziad\Desktop\SA-MP\pawno\SAMP.pwn(199) : warning 203: symbol is never used: "pName"
@Boot, Your code gave me these:
pawn Код:
|
ShowPlayerDialog(playerid,dstats,DIALOG_STYLE_MSGBOX, "%s", "Account: %s\nMoney: $%d\nKills: %d\nDeaths: %d",GetPlayerName(playerid),GetPlayerMoney(playerid),pInfo[playerid][Kills],pInfo[playerid][Deaths] "Close", "");