warning 219: local variable
#1

PHP код:
.pwn(573) : warning 219local variable "b" shadows a variable at a preceding level
pwn
(586) : warning 219local variable "b" shadows a variable at a preceding level
.pwn(621) : warning 219local variable "b" shadows a variable at a preceding level 

PHP код:
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 
0sizeof(wheelmodels); != b; ++I) {
        if (
modelid == wheelmodels[I])
            return 
true;
    }
    return 
false;
}
stock IllegalCarNitroIde(carmodel) {
    new 
illegalvehs[29] = { 581523462521463522461448468586509481510472473493595484430453452446454590569537538570449 };
    for(new 
0sizeof(illegalvehs); != b; ++I) {
        if (
carmodel == illegalvehs[I])
            return 
true;
    }
    return 
false;
}
// assumes player is in a car - make sure it is.
stock illegal_nos_vehicle(PlayerID) {
    new 
carid GetPlayerVehicleID(PlayerID);
    new 
playercarmodel GetVehicleModel(carid);
    return 
IllegalCarNitroIde(playercarmodel);
}
stock islegalcarmod(vehicleidecomponentid) {
    new 
modok false;
    
// stereo, hydraulics & nos (1x 2x 3x) are special.
    
if ( (iswheelmodel(componentid)) || (componentid == 1086) || (componentid == 1087) || ((componentid >= 1008) && (componentid <= 1010))) {
        new 
nosblocker IllegalCarNitroIde(vehicleide);
        if (!
nosblocker)
            
modok true;
    } else {
        
// check if the specified model CAN use this particular mod.
        
for(new 0sizeof(legalmods); != b; ++I) {
            if (
legalmods[I][0] == vehicleide) { // first is car IDE
                
for(new 122J++) { // start with 1
                    
if (legalmods[I][J] == componentid)
                        
modok true;
                }
            }
        }
    }
    return 
modok;

line WArnings:
Код:
for(new I = 0, b = sizeof(wheelmodels); I != b; ++I) {
for(new I = 0, b = sizeof(illegalvehs); I != b; ++I) {
for(new I = 0, b = sizeof(legalmods); I != b; ++I) {
Reply
#2

Hello!

Write it like this:
PHP код:
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,b_2 sizeof wheelmodels!= b_2; ++I)
    {
        if(
modelid == wheelmodels[I])return true;
    }
    return 
false;
}
stock IllegalCarNitroIde(carmodel)
{
    new 
illegalvehs[29] = { 581523462521463522461448468586509481510472473493595484430453452446454590569537538570449 };
    for(new 
I,b_2 sizeof illegalvehs!= b_2; ++I)
    {
        if(
carmodel == illegalvehs[I])return true;
    }
    return 
false;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)