SA-MP Forums Archive
Erroristic problem :) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Erroristic problem :) (/showthread.php?tid=247329)



Erroristic problem :) - LZLo - 08.04.2011

list (not that all)
PHP код:
new
    
FalseNitroVeh[][MAX_VEHICLES] =
{
"417",
"425",
"430",
"611"
}; 
under ongamemodeinit
PHP код:
    for(new 0MAX_VEHICLESi++){
        
SetVehicleNumberPlate(i"CFHS");
        if(!
strcmp(FalseNitroVeh[i], GetPlayerVehicleID(i), true))//Error line
        
{
              
//Nothing
        
}
        else
        {
            
AddVehicleComponent(GetPlayerVehicleID(i),1010);
                 
//return 1;
        
}
        
SetVehicleToRespawn(i);
    } 
error:
Quote:

(error line) : error 035: argument type mismatch (argument 2)




Re: Erroristic problem :) - gamer931215 - 09.04.2011

You are comparing a string with an vehicleid, this is not possible.
Also i guess you want to compare the model ID instead of vehicleid ?

This is much better:
pawn Код:
for(new i = 0; i < MAX_VEHICLES; i++){
        SetVehicleNumberPlate(i, "CFHS");
        switch(GetVehicleModel(i))
        {
            case 417,425,430,611: //if its one of these model id's
            default: //if this is not the case
            {
                AddVehicleComponent(GetPlayerVehicleID(i),1010);
            }
        }
        SetVehicleToRespawn(i);
    }



Re: Erroristic problem :) - LZLo - 09.04.2011

thanks