01.03.2018, 15:45
I tried this but I just get errors
But I get these errors
The line is on isnull
Код:
CMD:stats(playerid, params[])
{
new id;
if(connected[playerid] == true) return GameTextForPlayer(playerid, "~r~Spawn First", 5000, 5);
if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) /stats [id]");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) That player is not connected!");
if(isnull(id))
{
new iString[2000];
format (iString, sizeof(iString), "{ffff99}(INFO) Current session stats of: %s", PlayerName[playerid]);
SendClientMessage(playerid, -1, iString);
format(iString,sizeof(iString),"{ffff99}Score: %i ~ Level: %i ~ Duels Win: %i ~ Duels Lost: %i", pInfo[playerid][Score], pInfo[playerid][Level], pInfo[playerid][DuelsWin], pInfo[playerid][DuelsLost]);
SendClientMessage(playerid, -1, iString);
format(iString,sizeof(iString),"{ffff99}Points: %i ~ Respect: %i ~ Kills: %i ~ Deaths: %i ~ Ratio: %.2f", pInfo[playerid][Points], pInfo[playerid][Respect], pInfo[playerid][Kills], pInfo[playerid][Deaths], floatdiv(pInfo[playerid][Kills], pInfo[playerid][Deaths]));
SendClientMessage(playerid, -1, iString);
format(iString,sizeof(iString),"{ffff99}Session Kills: %i ~ Session Deaths: %i ~ Session Ratio: %.2f", PlayerKills[playerid], PlayerDeaths[playerid], floatdiv(PlayerKills[playerid], PlayerDeaths[playerid]), pInfo[playerid][Headshots]);
SendClientMessage(playerid, -1, iString);
format(iString,sizeof(iString),"{ffff99}Headshots given: %i/45", pInfo[playerid][Headshots]);
SendClientMessage(playerid, -1, iString);
}
else
{
new iString[2000];
format (iString, sizeof(iString), "{ffff99}(INFO) Current session stats of: %s", PlayerName[id]);
SendClientMessage(playerid, -1, iString);
format(iString,sizeof(iString),"{ffff99}Score: %i ~ Level: %i ~ Duels Win: %i ~ Duels Lost: %i", pInfo[id][Score], pInfo[id][Level], pInfo[id][DuelsWin], pInfo[id][DuelsLost]);
SendClientMessage(playerid, -1, iString);
format(iString,sizeof(iString),"{ffff99}Points: %i ~ Respect: %i ~ Kills: %i ~ Deaths: %i ~ Ratio: %.2f", pInfo[id][Points], pInfo[id][Respect], pInfo[id][Kills], pInfo[id][Deaths], floatdiv(pInfo[id][Kills], pInfo[id][Deaths]));
SendClientMessage(playerid, -1, iString);
format(iString,sizeof(iString),"{ffff99}Session Kills: %i ~ Session Deaths: %i ~ Session Ratio: %.2f", PlayerKills[id], PlayerDeaths[id], floatdiv(PlayerKills[id], PlayerDeaths[id]), pInfo[id][Headshots]);
SendClientMessage(playerid, -1, iString);
format(iString,sizeof(iString),"{ffff99}Headshots given: %i/45", pInfo[id][Headshots]);
SendClientMessage(playerid, -1, iString);
}
return 1;
}
Код:
C:\Users\yan\Desktop\LS DM\gamemodes\DBv1.pwn(3943) : error 028: invalid subscript (not an array or too many subscripts): "id" C:\Users\yan\Desktop\LS DM\gamemodes\DBv1.pwn(3943) : error 029: invalid expression, assumed zero C:\Users\yan\Desktop\LS DM\gamemodes\DBv1.pwn(3943) : error 028: invalid subscript (not an array or too many subscripts): "id" C:\Users\yan\Desktop\LS DM\gamemodes\DBv1.pwn(3943) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.

