One error!
#1

Hi friends, I'm getting this error: error 008: must be a constant expression; assumed zero

Код:
case DIALOG_AVP_KREDITUV3:
{
if(!response) return box(playerid, DIALOG_AVP_KREDITUV, DIALOG_STYLE_LIST, "Kreditų valdymas", "Duoti kreditų visiems\nDuoti kreditų ћaidėjui\nAtimti kreditus iљ ћaidėjo\nAtimti dalį kreditų", "Pasirinkti", "Grįћti");
if(response)
{
if(strval(inputtext) != INVALID_PLAYER_ID)
{
box(playerid, DIALOG_AVP_KREDITUV4, DIALOG_STYLE_INPUT, "Duoti kreditų ћaidėjui", "Įveskite sumą kurią norite duoti ћaidėjui", "Duoti", "Atgal");
new LaikinasID[MAX_PLAYERS] = strval(inputtext); // THIS LINE HAS ERROR!
} else {
box(playerid, DIALOG_AVP_KREDITUV3, DIALOG_STYLE_INPUT, "Duoti kreditų ћaidėjui", "Toks ћaidėjas nėra prisijungęs! Įraљykite teisingą ћaidėjo ID", "Toliau", "Grįћti");
}
}
}
EDIT: I just found solution,
Код:
new LaikinasID[MAX_PLAYERS] = "strval(inputtext)";
Is it good code?
Reply
#2

try:

Код:
new LaikinasID[MAX_PLAYERS] = inputtext;
Reply
#3

Just a common mistake. You've used MAX_PLAYERS instead of the playerid.

pawn Код:
new
    LaikinasID[ playerid ] = strval( inputtext )
;
Reply
#4

Quote:
Originally Posted by LarzI
Посмотреть сообщение
Just a common mistake. You've used MAX_PLAYERS instead of the playerid.

pawn Код:
new
    LaikinasID[ playerid ] = strval( inputtext )
;
Then he doesn't need
pawn Код:
new
Reply
#5

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
Then he doesn't need
pawn Код:
new
Obviously not - my bad. I'm really really tired. The declaration should be globally, else just remove the entire array cell making it a normal integer variable.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)