error 008: must be a constant expression; assumed zero -
kaiks - 15.07.2012
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 ];
Re: error 008: must be a constant expression; assumed zero -
Andi_Evandy - 15.07.2012
delete the "[20]" from "new load[20] = PlayerInfo[playerid][ pLoad ];"
Re: error 008: must be a constant expression; assumed zero -
kaiks - 15.07.2012
deleted the
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"; }
Re: error 008: must be a constant expression; assumed zero -
Andi_Evandy - 15.07.2012
sorry, my fault.
change this:
pawn Код:
new load[20] = PlayerInfo[playerid][ pLoad ];
to this:
--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;
}
Re: error 008: must be a constant expression; assumed zero -
kaiks - 15.07.2012
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.."
Re: error 008: must be a constant expression; assumed zero -
Andi_Evandy - 15.07.2012
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);
Re: error 008: must be a constant expression; assumed zero -
kaiks - 15.07.2012
GOD I'M STUPID, thank you.