PAWNO crashing..
#1

My PAWNO is crashing when I add this:

pawn Код:
CMD:stats (playerid, params[])
{
    new str[300], giveid, AdminRank[20];
    if (sscanf(params, "u", giveid)) return SendClientMessage(playerid, 0x6FFF00FF, "{F07F1D}USAGE: {BBFF00}/stats <ID>" );
    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 = "Moderator";
        case 2: AdminRank = "Administrator";
        case 3: AdminRank = "Head Administrator";
        case 4: AdminRank = "Server Owner";
    }
    format(str, sizeof(str), "{%06x}%s(%d) Statistics:\n\n"STEELBLUE"> Registration Date: "GREY"%s\n"STEELBLUE"> Status: "GREY"Level %d\n"STEELBLUE"> Online Time: "GREY"%d hours and %d minutes"STEELBLUE"> EXP: "GREY"%d\n"STEELBLUE"> Cash: "GREY"$%d\n"STEELBLUE"> Kills: "GREY"%d\n"STEELBLUE"> Deaths: "GREY"%d\n"STEELBLUE"> Weapon Set: "GREY"%s", (GetPlayerColor(giveid) >>> 8), GetName(giveid), giveid, PlayerInfo[giveid][RegOn], AdminRank, PlayerInfo[giveid][Hours], PlayerInfo[giveid][Minutes], GetPlayerScore(giveid), GetPlayerMoney(giveid), PlayerInfo[giveid][Kills], PlayerInfo[giveid][Deaths], WeaponSet);
    ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, ""RED"Statistics", str, "OK", "");
    return 1;
}
Reply
#2

Try:
pawn Код:
CMD:stats (playerid, params[])
{
    new str[300], giveid, AdminRank[20];
    if (sscanf(params, "u", giveid)) return SendClientMessage(playerid, 0x6FFF00FF, "{F07F1D}USAGE: {BBFF00}/stats <ID>" );
    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 = "Moderator";
        case 2: AdminRank = "Administrator";
        case 3: AdminRank = "Head Administrator";
        case 4: AdminRank = "Server Owner";
    }
    format(str, sizeof(str), "{%06x}%s(%d) Statistics:\n\n\"STEELBLUE\"> Registration Date: "GREY"%s\n\"STEELBLUE\"> Status: \"GREY\"Level %d\n\"STEELBLUE\"> Online Time: \"GREY\"%d hours and %d minutes\"STEELBLUE\"> EXP: \"GREY\"%d\n\"STEELBLUE\"> Cash: \"GREY\"$%d\n\"STEELBLUE\"> Kills: "GREY"%d\n\"STEELBLUE\">
     Deaths: \"GREY\"%d\n\"STEELBLUE\"> Weapon Set: \"GREY\"%s"
, (GetPlayerColor(giveid) >>> 8), GetName(giveid), giveid, PlayerInfo[giveid][RegOn], AdminRank, PlayerInfo[giveid][Hours], PlayerInfo[giveid][Minutes], GetPlayerScore(giveid), GetPlayerMoney(giveid), PlayerInfo[giveid][Kills], PlayerInfo[giveid][Deaths], WeaponSet);
    ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, ""RED"Statistics", str, "OK", "");
    return 1;
}
Reply
#3

4 errors:
pawn Код:
(3194) : error 037: invalid string (possibly non-terminated string)
(3194) : error 017: undefined symbol "d"
(3194) : error 029: invalid expression, assumed zero
(3194) : fatal error 107: too many error messages on one line
Reply
#4

there is no problem with ur script
pawn is crashing because spelling if parmas is wron
You have written "params[]" change it to "parmas[]"
and also change its spelling in sscaf line
Reply
#5

Comment all the lines in the command and start uncommenting until you find the exact line causing the crash on the editor.
Reply
#6

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
there is no problem with ur script
pawn is crashing because spelling if parmas is wron
You have written "params[]" change it to "parmas[]"
and also change its spelling in sscaf line
Lol are you serious?
Reply
#7

@matess yes i am its because of wrong spelling this has happned to me to u can try ur self
Reply
#8

params[] isn't giving him an error in any way.
Silly question : Are you sure that this crash is causing because of this command?
Reply
#9

Quote:
Originally Posted by biker122
Посмотреть сообщение
params[] isn't giving him an error in any way.
Silly question : Are you sure that this crash is causing because of this command?
Yes.
I think its because of the very long line (format...)?
Reply
#10

comment every thing you added before pawno startet crashing and then uncomment until you find the error.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)