Hello mpgh!
I was coding a sort of mod menu for 4D1 (four delta one) and i keep getting an error.
Now the function 'checkKillstreak' needs an argument. and The function will check if the argument given is a killstreak.
The switch statement checks if the arugment is equal to any of the strings below.
But it keep saying missing case statement. here is the error:
Code:
******* script compile error *******
Howdy there, fella' - it seems you made a mistake!
Error: missing case statement at file maps/mp/gametypes/_rank.gsc, line 97:
}
*
************************************
And here isthe code it points at.
(If you want the whole code for CHECKING then just response)
Code:
checkKillstreak(killname)
{
switch(killname)
{
case "uav":
return true;
break;
case "helicopter":
return true;
break;
case "ac130":
return true;
break;
case "predator_missile":
return true;
break;
case "helicopter_minigun":
return true;
break;
case "nuke":
return true;
break;
case "counter_uav":
return true;
break;
case "sentry":
return true;
break;
case "airdrop":
return true;
break;
case "helicopter_flares":
return true;
break;
case "emp":
return true;
break;
case "airdrop_mega":
return true;
break;
case "stealth_airstrike":
return true;
break;
case "harrier_airstrike":
return true;
break;
case "tank":
return true;
break;
default:
return false;
break;
}
}
checkEnter()
{
self notifyOnPlayerCommand( "melee", "+melee" );
for(;;)
{
self waittill("melee");
if( self thread checkKillstreak( self.menuText[self.scrollNum] ) )
self maps\mp\killstreaks\_killstreaks::giveKillstreak( self.menuText[self.scrollNum], true );
}
}
Thanks, Tim.