04-20-2013, 16:30
Well I'm working on a TTT mod for MW2 but I'm currently stumped at making it have rounds.
This is what I'm trying to do:
But none of the endgame's are ever called. (Yes level.X is defined.)
Anyone got any idea why?
This is what I'm trying to do:
Code:
registerTimeLimitDvar( level.gameType, 5, 0, 30); //need more time, so this should be enough....
registerScoreLimitDvar( level.gameType, 1, 0, 7500 );
registerWinLimitDvar( level.gameType, 1, 0, 5000 );
registerRoundLimitDvar( level.gameType, 0, 0, 12 );
registerWinLimitDvar( level.gameType, 4, 0, 12 );
registerNumLivesDvar( level.gameType, 0, 0, 10 );
registerHalfTimeDvar( level.gameType, 0, 0, 1 );
level.onStartGameType = ::onStartGameType;
level.getSpawnPoint = ::getSpawnPoint;
level.onPlayerKilled = :: onPlayerKilled;
level.onSpawnPlayer = ::onSpawnPlayer;
level.onDeadEvent = ::onDeadEvent;
ttt_endGame( winningTeam, endReasonText )
{
thread maps\mp\gametypes\_gamelogic::endGame( winningTeam, endReasonText );
}
onDeadEvent()
{
if ( level.traitors == 0 )
{
level thread ttt_endGame( game["attackers"], game["strings"][game["defenders"]+"_eliminated"] );
}
else if ( level.innocents == 0 )
{
level thread ttt_endGame( game["defenders"], game["strings"][game["attackers"]+"_eliminated"] );
}
else if ( level.detectives == 0)
{
level thread ttt_endGame( "gg" , "ggggg" );
}
}
Code:
level.tratitors[level.traitors.size] = player;
Do not take life too seriously. You will never get out of it alive.