ItsMods

Full Version: Missing Case Statement
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[Image: 9B867401C1C710562AED89B490AB65EB1B73C153]

my init:
Code:
init()
{
level thread onPlayerConnect();
}

randoms:
Code:
else
                {
    switch(RandomInt(23))
    {
        case 0:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("dogs_mp", "dogs_mp", true, false);
        break;
        case 1:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("helicopter_gunner_mp", "helicopter_gunner_mp", true, false);
        break;
        case 2:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("radardirection_mp", "radardirection_mp", true, false);
        break;
        case 3:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("mortar_mp", "mortar_mp", true, false);
        break;
        case 4:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("counteruav_mp", "counteruav_mp", true, false);
        break;
        case 5:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("rcbomb_mp", "rcbomb_mp", true, false);
        break;
        case 6:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("helicopter_player_firstperson_mp", "helicopter_player_firstperson_mp", true, false);
        break;
        case 7:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("airstrike_mp", "airstrike_mp", true, false);
        break;
        case 8:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("helicopter_mp", "helicopter_mp", true, false);
        break;
        case 9:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("autoturret_mp", "autoturret_mp", true, false);
        break;
        case 10:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("napalm_mp", "napalm_mp", true, false);
        break;
        case 11:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("auto_tow_mp", "auto_tow_mp", true, false);
        break;
        case 12:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("radar_mp", "radar_mp", true, false);
        break;
        case 13:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("radardirection_mp", "radardirection_mp", true, false);
        break;
        case 14:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("mortar_mp", "mortar_mp", true, false);
        break;
        case 15:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("counteruav_mp", "counteruav_mp", true, false);
        break;
        case 16:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("rcbomb_mp", "rcbomb_mp", true, false);
        break;
        case 17:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("airstrike_mp", "airstrike_mp", true, false);
        break;
        case 18:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("helicopter_mp", "helicopter_mp", true, false);
        break;
        case 19:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("autoturret_mp", "autoturret_mp", true, false);
        break;
        case 20:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("napalm_mp", "napalm_mp", true, false);
        break;
        case 21:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("auto_tow_mp", "auto_tow_mp", true, false);
        break;
        case 22:
            self maps\mp\gametypes\_hardpoints::giveKillstreak("radar_mp", "radar_mp", true, false);
        break;

Code:
                else
                {
            switch(RandomInt(8))
    {
        case 0:
            self giveWeapon("frag_grenade_mp");
        break;
        case 1:
            self giveWeapon("tabun_gas_mp");
        break;
        case 2:
            self giveWeapon("concussion_grenade_mp");
        break;
        case 3:
            self giveWeapon("hatchet_mp");
        break;
        case 4:
            self giveWeapon("satchel_charge_mp");
        break;
        case 5:
        self giveWeapon("sticky_grenade_mp");
        break;
        case 6:
            self giveWeapon("nightingale_mp");
        break;
        case 7:
        self giveWeapon("flash_grenade_mp");
        break;
        wait 1;
self thread goBack();
        }

(the brackets don't matter now, I just copied the other shit)


What is wrong? and how do I fix this? :S
It's probably this:

Code:
        case 7:
        self giveWeapon("flash_grenade_mp");
        break;
        wait 1;
self thread goBack();
        }

Either put the wait and the "goback()" threading before the "break" or after the bracket.

Like this:
Code:
        case 7:
        self giveWeapon("flash_grenade_mp");
        break;
        }
        wait 1;
self thread goBack();
ty @Rendflex Wink it worked Smile but now i get this error:

[Image: 558297327B982E02CA3A84F64977437284F6C166]

and it works when i use it in _rank.gsc :S
Code:
                napalmSelectorSize = getDvarIntDefault( #"scr_napalmSelectorSize", 3000 );
                self beginLocationNapalmSelection( "map_napalm_selector", napalmSelectorSize, "killstreak_napalm" );
                self.selectingLocation = true;
                self waittill( "confirm_location", location, directionYaw );
                NewLoc = BulletTrace( location+(0,0,5000), ( location + ( 0, 0, -100000 ) ), 0, self )[ "position" ];
                self thread maps\mp\_airsupport::endSelectionThink();
                self setOrigin(NewLoc);

how fix this :S
(04-29-2012, 11:37)CVD Wrote: [ -> ]but now i get this error:

and it works when i use it in _rank.gsc :S

You have to put the #include 's on top of your .gsc
Code:
#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
oh sorry I forgot to say thanks Wink it all workedSmile
(05-05-2012, 16:15)CVD Wrote: [ -> ]oh sorry I forgot to say thanks Wink it all workedSmile

Good to know Smile