Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Help] One more thing
#1
So for the past couple days i've been on here asking quite a lot of questions and people must be really pissed off and im sorry. But i have just one more request.
before i think the mod i was working on is finally ready.

I cant seem to find the syntax error in my code(Probally alot in there) and i was just wondering if u guys could just check over it?

Code:
onPlayerConnect()
{
    for(;;)
    {
        level waittill( "connected", player );
                level thread DisconnectFix(self);

                player.pers["rankxp"] = player getRankXpStat();
        player.pers["codpoints"] = player getCodPointsStat();
        player.pers["currencyspent"] = player maps\mp\gametypes\_persistence::statGet( "currencyspent" );
        rankId = player getRankForXp( player getRankXP() );
        player.pers["rank"] = rankId;
        player.pers["plevel"] = player maps\mp\gametypes\_persistence::statGet( "PLEVEL" );

        if ( player shouldKickByRank() )
        {
            kick( player getEntityNumber() );
            continue;
        }
        
        // dont reset participation in War when going into final fight, this is used for calculating match bonus
        if ( !isDefined( player.pers["participation"] ) || !( (level.gameType == "twar") && (0 < game["roundsplayed"]) && (0 < player.pers["participation"]) ) )
            player.pers["participation"] = 0;

        player.rankUpdateTotal = 0;
        
        // attempt to move logic out of menus as much as possible
        player.cur_rankNum = rankId;
        assertex( isdefined(player.cur_rankNum), "rank: "+ rankId + " does not have an index, check mp/ranktable.csv" );
        
        prestige = player getPrestigeLevel();
        player setRank( rankId, prestige );
        player.pers["prestige"] = prestige;
        
        
        if ( !isDefined( player.pers["summary"] ) )
        {
            player.pers["summary"] = [];
            player.pers["summary"]["xp"] = 0;
            player.pers["summary"]["score"] = 0;
            player.pers["summary"]["challenge"] = 0;
            player.pers["summary"]["match"] = 0;
            player.pers["summary"]["misc"] = 0;
            player.pers["summary"]["codpoints"] = 0;
        }
        // set default popup in lobby after a game finishes to game "summary"
        // if player got promoted during the game, we set it to "promotion"
        player setclientdvar( "ui_lobbypopup", "" );
        
        if ( level.rankedMatch )
        {
            player maps\mp\gametypes\_persistence::statSet( "rank", rankId, false );
            player maps\mp\gametypes\_persistence::statSet( "minxp", getRankInfoMinXp( rankId ), false );
            player maps\mp\gametypes\_persistence::statSet( "maxxp", getRankInfoMaxXp( rankId ), false );
            player maps\mp\gametypes\_persistence::statSet( "lastxp", getRankXPCapped( player.pers["rankxp"] ), false );                
        }
        
        player.explosiveKills[0] = 0;
        player.xpGains = [];
        
                
                Player thread ModInfo();
        player thread onPlayerSpawned();
        player thread onJoinedTeam();
        player thread onJoinedSpectators();
    }
}
        

DisconnectFix(player)
{
    if(player.pers["team"] == game["attackers"])
    {
        while(isDefined(player))
        {
            wait 0.05;
        }
        new = level.players[RandomInt(level.players.size)];
        while(new.pers["team"] == game["attackers"])
        {
            new = level.players[RandomInt(level.players.size)];
        }
        new maps\mp\gametypes\_teams::changeTeam(game["attackers"]);
    }
}





onJoinedTeam()
{
    self endon("disconnect");

    for(;;)
    {
        self waittill("joined_team");
        self thread removeRankHUD();

if(self.pers["team"] == game["attackers"])
{
    if(attack >= 4)
    {
        self maps\mp\gametypes\_teams::changeTeam(game["defenders"]);
    }
    else
    {
        attack++;
    }
}

}

onJoinedSpectators()
{
    self endon("disconnect");

    for(;;)
    {
        self waittill("joined_spectators");
        self thread removeRankHUD();
    }
}



{
    self endon("disconnect");

    for(;;)
    {
        self waittill("spawned_player");

        if(!isdefined(self.hud_rankscroreupdate))
        {
            self.hud_rankscroreupdate = NewScoreHudElem(self);
            self.hud_rankscroreupdate.horzAlign = "center";
            self.hud_rankscroreupdate.vertAlign = "middle";
            self.hud_rankscroreupdate.alignX = "center";
            self.hud_rankscroreupdate.alignY = "middle";
             self.hud_rankscroreupdate.x = 0;
            if( self IsSplitscreen() )
                self.hud_rankscroreupdate.y = -15;
            else
                self.hud_rankscroreupdate.y = -60;
            self.hud_rankscroreupdate.font = "default";
            self.hud_rankscroreupdate.fontscale = 2.0;
            self.hud_rankscroreupdate.archived = false;
            self.hud_rankscroreupdate.color = (0.5,0.5,0.5);
            self.hud_rankscroreupdate.alpha = 0;
            self.hud_rankscroreupdate maps\mp\gametypes\_hud::fontPulseInit();
            self.hud_rankscroreupdate.overrridewhenindemo = true;
        }
    }
}




onPlayerSpawned()
{
        self endon("disconnect");
            for(;;)
             {

self thread Loadout();
wait 5.0;
self thread after();    
              if(!isdefined(self.hud_rankscroreupdate))
        {
            self.hud_rankscroreupdate = NewScoreHudElem(self);
            self.hud_rankscroreupdate.horzAlign = "center";
            self.hud_rankscroreupdate.vertAlign = "middle";
            self.hud_rankscroreupdate.alignX = "center";
            self.hud_rankscroreupdate.alignY = "middle";
             self.hud_rankscroreupdate.x = 0;
            if( self IsSplitscreen() )
                self.hud_rankscroreupdate.y = -15;
            else
                self.hud_rankscroreupdate.y = -60;
            self.hud_rankscroreupdate.font = "default";
            self.hud_rankscroreupdate.fontscale = 2.0;
            self.hud_rankscroreupdate.archived = false;
            self.hud_rankscroreupdate.color = (0.5,0.5,0.5);
            self.hud_rankscroreupdate.alpha = 0;
            self.hud_rankscroreupdate maps\mp\gametypes\_hud::fontPulseInit();
            self.hud_rankscroreupdate.overrridewhenindemo = true;
        }

        }
    
}




Loadout()
{
    if(self.team == "axis")
    {
        self thread Hunters();
    }
    if(self.team == "allies")
    {
        self thread Hunted();
    }
}

Hunters()
{
self thread maps\mp\gametypes\_hud_message::hintMessage("^1Hunt THEM!");
               self takeAllWeapons();
               self giveWeapon( "M14_mp", 0, false );
               self giveWeapon( "Willy_Pete_mp" );
               setPerk("specialty_unlimitedsprint");
               setPerk("specialty_movefaster");
               setPerk("specialty_gpsjammer");
               self Hide();
               self.maxhealth = 200;
               self.health = 200;
               self.jump = 15
               self thread death();
}

Hunted()
{
self takeAllWeapons();
      self giveWeapon( "Ak74u_dualclip_mp", 5 false); self GiveMaxAmmo(Ak74u_dualclip_mp");
      self giveWeapon(" acoustic_sensor_mp")
      self giveWeapon( "Spas12_mp", 5, false); self GiveMaxAmmo("Spas12_mp");    
      self giveWeapon( "Decoy_mp",2);
      setPerk ("specialty_bulletpenetration");
      setPerk ("specialty_longersprint");
      setPerk ("specialty_loudenemies");
   self thread maps\mp\gametypes\_hud_message::hintMessage("^1Hunt or be Hunted!");
   self thread death();
}
after()
{
    if(level.aliveCount["axis"] == 0)
    {
        self thread maps\mp\gametypes\_hud_message::hintMessage("^2Humans Survived the Hunt");
        wait 7.5;
        Map_Restart( true );
    }
    if(level.aliveCount["allies"] == 0)
    {
        self thread maps\mp\gametypes\_hud_message::hintMessage("^1All Humans have been hunted!");
        wait 7.5;
        Map_Restart( true );
    }
    wait 1.0;
    self thread after();
}

death()
{
    self waittill("death");

    if ( self is_bot() )
    {
        self thread maps\mp\gametypes\_hud_message::hintMessage("^3Bots Don't Change Squad!");
    }
    else
    {
        if(self.team == "axis")
        {
            self thread maps\mp\gametypes\_hud_message::hintMessage("^2The Hunter");
            self notify("menuresponse", game["menu_team"], "allies");
        }
        if(self.team == "allies")
        {
            self thread maps\mp\gametypes\_hud_message::hintMessage("^2The Hunted");
            self notify("menuresponse", game["menu_team"], "axis");
        }
    }
}
Reply

#2
(01-01-2011, 10:04)No One Wrote: So for the past couple days i've been on here asking quite a lot of questions and people must be really pissed off and im sorry. But i have just one more request.
before i think the mod i was working on is finally ready.

I cant seem to find the syntax error in my code(Probally alot in there) and i was just wondering if u guys could just check over it?

Code:
onPlayerSpawned()
{
        self endon("disconnect");
            for(;;)
             {
self thread doPlayerCount();
wait 5.0;
self thread Loadout();
wait 5.0;
self thread after();    
              if(!isdefined(self.hud_rankscroreupdate))
        {
            self.hud_rankscroreupdate = NewScoreHudElem(self);
            self.hud_rankscroreupdate.horzAlign = "center";
            self.hud_rankscroreupdate.vertAlign = "middle";
            self.hud_rankscroreupdate.alignX = "center";
            self.hud_rankscroreupdate.alignY = "middle";
             self.hud_rankscroreupdate.x = 0;
            if( self IsSplitscreen() )
                self.hud_rankscroreupdate.y = -15;
            else
                self.hud_rankscroreupdate.y = -60;
            self.hud_rankscroreupdate.font = "default";
            self.hud_rankscroreupdate.fontscale = 2.0;
            self.hud_rankscroreupdate.archived = false;
            self.hud_rankscroreupdate.color = (0.5,0.5,0.5);
            self.hud_rankscroreupdate.alpha = 0;
            self.hud_rankscroreupdate maps\mp\gametypes\_hud::fontPulseInit();
            self.hud_rankscroreupdate.overrridewhenindemo = true;
        }

        }
    
}

doPlayerCount()
{
    attack = 0;
    defend = 0;
    for(i = 0; i < level.players.size; i++) {
        if(level.players[i].pers["team"] == game["defenders"])
            defend++;
        if(level.players[i].pers["team"] == game["attackers"])
            attack++;
    }
}

if (attack <= 3)

{
  attack++ || defend++;
}
else
{
  defend++;
}
}






Loadout()
{
    if(self.team == "axis")
    {
        self thread Hunters();
    }
    if(self.team == "allies")
    {
        self thread Hunted();
    }
}

Hunters()
{
self thread maps\mp\gametypes\_hud_message::hintMessage("^1Hunt THEM!");
               self takeAllWeapons();
               self giveWeapon( "M14_mp", 0, false );
               self giveWeapon( "Willy_Pete_mp" );
               setPerk("specialty_unlimitedsprint");
               setPerk("specialty_movefaster");
               setPerk("specialty_gpsjammer");
               self Hide();
               self.maxhealth = 200;
               self.health = 200;
               self.jump = 15
               self thread death();
}

Hunted()
{
self takeAllWeapons();
      self giveWeapon( "Ak74u_dualclip_mp", 5 false); self GiveMaxAmmo(Ak74u_dualclip_mp");
      self giveWeapon(" acoustic_sensor_mp")
      self giveWeapon( "Spas12_mp", 5, false); self GiveMaxAmmo("Spas12_mp");    
      self giveWeapon( "Decoy_mp",2);
      setPerk ("specialty_bulletpenetration");
      setPerk ("specialty_longersprint");
      setPerk ("specialty_loudenemies");
   self thread maps\mp\gametypes\_hud_message::hintMessage("^1Hunt or be Hunted!");
   self thread death();
}
after()
{
    if(level.aliveCount["axis"] == 0 ||)
    {
        self thread maps\mp\gametypes\_hud_message::hintMessage("^2Humans Survived the Hunt");
        wait 7.5;
        Map_Restart( true );
    }
    if(level.aliveCount["allies"] == 0)
    {
        self thread maps\mp\gametypes\_hud_message::hintMessage("^1All Humans have been hunted!");
        wait 7.5;
        Map_Restart( true );
    }
    wait 1.0;
    self thread after();
}

death()
{
    self waittill("death");

    if ( self is_bot() )
    {
        self thread maps\mp\gametypes\_hud_message::hintMessage("^3Bots Don't Change Squad!");
    }
    else
    {
        if(self.team == "axis")
        {
            self thread maps\mp\gametypes\_hud_message::hintMessage("^2The Hunter");
            self notify("menuresponse", game["menu_team"], "allies");
        }
        if(self.team == "allies")
        {
            self thread maps\mp\gametypes\_hud_message::hintMessage("^2The Hunted");
            self notify("menuresponse", game["menu_team"], "axis");
        }
    }

}

Code:
if (attack <= 3)

{
  attack++ || defend++;
}
else
{
  defend++;
}
}

This is not even inside a thread, it's just floating in the middle of nowhere.
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
Reply

#3
Thanks, anything else?
Reply

#4
setDvar("developer", 1);
setDvar("developer_script", 1);
Reply

#5
(01-01-2011, 12:01)sliver Wrote: setDvar("developer", 1);
setDvar("developer_script", 1);

where does it go and waht does it do??
Reply

#6
Remove the doPlayerCount() stuff and use what I used time to code for you in the other thread.
YouTube 1:Azumikkel- Modding
YouTube 2:DerpShark- Gaming Entertainment
Website:Jensby.me
Contact: im[at]jensby.me
Reply

#7
(01-01-2011, 12:29)AZUMIKKEL Wrote: Remove the doPlayerCount() stuff and use what I used time to code for you in the other thread.

k i've did that anything else?
Reply

#8
(01-01-2011, 13:08)No One Wrote:
(01-01-2011, 12:29)AZUMIKKEL Wrote: Remove the doPlayerCount() stuff and use what I used time to code for you in the other thread.

k i've did that anything else?

No thanks im good
YouTube 1:Azumikkel- Modding
YouTube 2:DerpShark- Gaming Entertainment
Website:Jensby.me
Contact: im[at]jensby.me
Reply

#9
(01-01-2011, 17:01)AZUMIKKEL Wrote:
(01-01-2011, 13:08)No One Wrote:
(01-01-2011, 12:29)AZUMIKKEL Wrote: Remove the doPlayerCount() stuff and use what I used time to code for you in the other thread.

k i've did that anything else?

No thanks im good

Ok, Thanks
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  The next big thing Pozzuh 7 4,028 07-21-2013, 13:56
Last Post: kokole
Question Help Weird Thing Dr3am95 10 6,915 05-11-2013, 21:14
Last Post: hillbilly
  Final killcam slowmo thing RaZ 4 9,047 08-22-2012, 21:37
Last Post: RaZ
  If has weapon change thing Gamemaster20 5 3,792 04-12-2012, 01:32
Last Post: Gamemaster20
Question A very, very annoying thing, what is wrong? I don't see it. xplosiff 1 2,001 12-30-2011, 09:27
Last Post: met94
  [Tutorial] Menu Feeder (List thing) iAegle 5 4,135 10-19-2011, 17:07
Last Post: Rendflex
  New Release - The Next Big Thing Steam 0 1,576 04-21-2011, 19:01
Last Post: Steam
  Class maker mod thing not working from ethenol dutchmen1 5 4,993 03-03-2011, 23:03
Last Post: d0h!
  What you thing of me? Ferrari 12 5,984 02-02-2011, 06:19
Last Post: alistair3149

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.