[Ajuda] Erros Foreach
#1

Код:
C:\Users\Cliente\Desktop\...(23847) : error 017: undefined symbol "wheelmodels@YSII_Ag"
C:\Users\Cliente\Desktop\...(23847) : error 017: undefined symbol "wheelmodels@YSII_Ag"
C:\Users\Cliente\Desktop\...(23847) : error 029: invalid expression, assumed zero
C:\Users\Cliente\Desktop\...(23847) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Cуdigo:

pawn Код:
iswheelmodel(modelid) {

    new wheelmodels[17] = {1025,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1096,1097,1098};

    foreach(wheelmodels, I) {

        if (modelid == wheelmodels[I])
            return true;

    }

    return false;
}
Linha do erro:

PHP код:
    foreach(wheelmodelsI) { 
Reply
#2

tenta assim

pawn Код:
stock iswheelmodel(modelid)
{
    new wheelmodels[17] = {1025,1073,1074,1075,1076,1077,1078,1079,1080,1081 ,1082,1083,1084,1085,1096,1097,1098};

    for(new i = 0; i < sizeof(wheelmodels); ++i)
    {
        if (modelid == wheelmodels[i]) return true;
    }
    return false;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)