error 008: must be a constant expression; assumed zero
#1

Here's the script:
pawn Код:
CMD:andmed(playerid,params[])
{
    if(gPlayerLoggedIn[playerid] == 0) return 1;

    {
    new load[20] = PlayerInfo[playerid][ pLoad ];
    new raha =  GetPlayerMoney(playerid);
    new nimi[MAX_PLAYER_NAME], string[128];
    new vanus = PlayerInfo[playerid][ Age ];
   

    GetPlayerName(playerid, nimi, sizeof(nimi));
    SendClientMessage(playerid, COLOR_WHITE,"____________");
    format(string, sizeof(string),"*** %s ***",nimi);
    SendClientMessage(playerid, COLOR_WHITE,string);
    format(string, sizeof(string), "Raha: %d SAK'i Vanus: %d Autojuhiload: %d", raha, vanus, load);
    SendClientMessage(playerid, COLOR_WHITE,string);
    //format(string, sizeof(string), "Hoiatusi:[%d/5]", warns);
    //SendClientMessage(playerid, COLOR_WHITE,string);
    SendClientMessage(playerid, COLOR_WHITE,"____________");
    if(PlayerInfo[playerid][pLoad] == 0)
    { load = "Puuduvad"; }
    else if(PlayerInfo[playerid][pLoad] == 1)
    { load = "Olemas"; }
    }
    return 1;
}
And here's the error:
Код:
error 008: must be a constant expression; assumed zero
And the error is for this line:
pawn Код:
new load[20] = PlayerInfo[playerid][ pLoad ];
Reply
#2

delete the "[20]" from "new load[20] = PlayerInfo[playerid][ pLoad ];"
Reply
#3

deleted the
pawn Код:
[20]
and now it give 2 errors
Код:
error 006: must be assigned to an array
error 006: must be assigned to an array
to:
pawn Код:
{ load = "Puuduvad"; }
{ load = "Olemas"; }
Reply
#4

sorry, my fault.
change this:
pawn Код:
new load[20] = PlayerInfo[playerid][ pLoad ];
to this:
pawn Код:
new load[20];
--edit--

pawn Код:
CMD:andmed(playerid,params[])
{
    if(gPlayerLoggedIn[playerid] == 0) return 1;
    {
        new load[20];
        new raha =  GetPlayerMoney(playerid);
        new nimi[MAX_PLAYER_NAME], string[128];
        new vanus = PlayerInfo[playerid][ Age ];
        if(PlayerInfo[playerid][pLoad] == 0)
        { load = "Puuduvad"; }
        else if(PlayerInfo[playerid][pLoad] == 1)
        { load = "Olemas"; }
        GetPlayerName(playerid, nimi, sizeof(nimi));
        SendClientMessage(playerid, COLOR_WHITE,"____________");
        format(string, sizeof(string),"*** %s ***",nimi);
        SendClientMessage(playerid, COLOR_WHITE,string);
        format(string, sizeof(string), "Raha: %d SAK'i Vanus: %d Autojuhiload: %d", raha, vanus, load);
        SendClientMessage(playerid, COLOR_WHITE,string);
        //format(string, sizeof(string), "Hoiatusi:[%d/5]", warns);
        //SendClientMessage(playerid, COLOR_WHITE,string);
        SendClientMessage(playerid, COLOR_WHITE,"____________");
    }
    return 1;
}
Reply
#5

Thanks for help, but it's messed up.
I have vehicle licenses, but it's showing me in game "Licenses: 79", not "Licenses: Olemas" which means "Owning licenses orsmth.."
Reply
#6

Change this:
pawn Код:
format(string, sizeof(string), "Raha: %d SAK'i Vanus: %d Autojuhiload: %d", raha, vanus, load);
to this:
pawn Код:
format(string, sizeof(string), "Raha: %d SAK'i Vanus: %d Autojuhiload: %s", raha, vanus, load);
Reply
#7

GOD I'M STUPID, thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)