Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

Match doesn't begin.

| Inside3d Forums Forum Index -> QuakeC Programming

View previous topic :: View next topic
Author | Message
--- | ---
Orion Joined: 12 Jan 2007 Posts: 414 Location: Brazil |

Posted: Wed Dec 26, 2007 12:09 am Post subject: Match doesn't begin. |

Hi, I did a mod that all weapons does randomly between normal damage and 2x damage, and each client receives 1000 dollars when connecting. I did like last man standing, when a player dies it respawn as an observer, and when another match begins it automatically teleports to a spawn spot on the map.
And, I put that dollar thing because you can bet from between 1 and 255 dollars using a pre-impulse command. If you're the last man standing, you receive all money the others have bet.
When I start a map and connect 4 bots, the match starts normally, but the second or more matches doesn't start even if everybody gave their bets.
Can someone tell me what's wrong in my code?
PlaceBets(), called from impulse 50 and any other impulse that's the value of your bets.

Code:
void(float howmany) PlaceBets = { self.t_length = 0; self.last_impulse = 0; self.impulse = 0;
if (howmany > self.cash)
howmany = self.cash; // lost all cash
self.cash = self.cash - howmany;
self.bet = howmany;
bet_placed = bet_placed + 1;
if (bet_placed == total_players)
{
bprint ("Everybody placed their bets. Let's fight!!\n");
everybody_placed = 1;
}
bprint (self.netname);
bprint (" bets ");
bprint (ftos(howmany));
bprint (" dollars.\n");
};

My modifed StartFrame():

Code:
void() StartFrame = { local entity p, bot, oself; local float bets; local string s;
teamplay = cvar("teamplay");
skill = cvar("skill");
framecount = framecount + 1;
bot = find(world, classname, "player");
while (bot != world)
{
if (!bot.human)
{
oself = self;
self = bot;
BotThink ();
self = oself;
}
bot = find(bot, classname, "player");
}
if (dead_players >= total_players - 1 && total_players > 1)
{
dead_players = 0;
everybody_placed = 0;
p = find(world, classname, "player");
while (p != world)
{
bets = bets + p.bet;
if (p.health > 0)
{
bprint (p.netname);
bprint (" wins! He gained ");
s = ftos(bets);
bprint (s);
bprint (" dollars!\n");
p.bet = p.bet + bets;
}
p.spec = 0;
p.betted = 0;
oself = spawn ();
oself.owner = p;
oself.nextthink = time + 1 + random()*2;
oself.think = ReSpawn;
p = find(p, classname, "player");
}
PrintCash ();
}
if (!everybody_placed)
cease_fire = 1;
else
cease_fire = 0;
if (everybody_placed)
bet_placed = 0;
};

Any help would be appreciated.
_________________
There's no signature here. Stop looking for one.

Back to top |

Display posts from previous:

| Inside3d Forums Forum Index -> QuakeC Programming | All times are GMT
Page 1 of 1

Jump to:

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2004 phpBB Group