Why get this errors ?
#1

PHP код:
error 033: array must be indexed (variable "EngineStatus")
 
error 033: array must be indexed (variable "EngineStatus") 
Script:
PHP код:
        format(str, sizeof(str), "Engine: ~%s~%d \%", EngineColor[playerid], EngineEngine[playerid]);
        
speedo4[playerid] = TextDrawCreate(470.0, 420.0, " ");
        
TextDrawSetString(speedo4[playerid], str);
        
TextDrawSetShadow(speedo4[playerid], false);
        
TextDrawSetOutline(speedo4[playerid], 1);
        
TextDrawLetterSize(speedo4[playerid], TEXT_DRAW_X_FACTOR, TEXT_DRAW_Y_FACTOR);
        
TextDrawSetProportional(speedo4[playerid], 1);
        
TextDrawFont(speedo4[playerid], TEXT_DRAW_FONT);
        
TextDrawShowForPlayer(playerid, speedo4[playerid]); 
PHP код:
stock EngineColor(playerid) {
    new 
str[5];
    if (
EngineStatus[playerid] == 1)
        
format(str, sizeof(str), "g");
    else if (
EngineStatus == 0)
        
format(str, sizeof(str), "r");
    return 
str;
}
stock EngineEngine(playerid) {
    new 
str[5];
    if (
EngineStatus[playerid] == 1)
        
format(str, sizeof(str), "ON");
    else if (
EngineStatus == 0)
        
format(str, sizeof(str), "OFF");
    return 
str;
} 
EROR LINES:
else (EngineStatus == 0)
else (EngineStatus == 0)
Reply
#2

use EngineColor( playerid ) and EngineEngine( playerid ).

you're using [ and ], which can not be used in this case.
Reply
#3

SAME :@
Reply
#4

Will someone help ?
Reply
#5

Do you have a variable called "EngineColor"?
Reply
#6

Yes , but i have errors on this 2 lines
Reply
#7

The problem is that you're not using "[playerid] on two of the variables,
pawn Код:
else if (EngineStatus == 0)
This should be,
pawn Код:
else if (EngineStatus[playerid] == 0)
Reply
#8

You can't have a variable and function named the same thing afaik
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)