15.04.2009, 18:08
After a long time doing nothing related to the scripting scene , I decided to do some little stuff again. And a after a while something bugged me.
For example , you want to add a 10 vehicles , assigned to a team or whatever.
Код:
new teamcars[10]; // at start
Код:
teamcar[1] = AddStaticVehicleEx // at ongamemode init teamcar[2] = AddStaticVehicleEx etc etc
Код:
if(vehicleid == teamcar[1] || vehicleid == teamcar[1] ) // at public OnPlayerEnterVehicle { // check team here else { // kick wrong out }
This goes all without any problems.
Now the question is how would I be able to check teamcar[1] till teamcar[10] , without calling them separtely each time ( like vehicleid == teamcar[1] || vehicleid == teamcar[2] || etc )
Maybe the answer is simple , but I never tried something like this , I just want to simplify code.
Doing this with carids is rather simple ;
Код:
if((carid >= 61) && (carid <= 63)