Raised This Month: $ Target: $400
 0% 

[TF2]Realistic/Campaign mod for TF2 - almost done


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 10-19-2020 , 22:52   Re: [TF2]Realistic/Campaign mod for TF2 - almost done
Reply With Quote #2

A couple of things I'd suggest:
  • Instead of enabling cheats in order to force the round to win, just strip the flag from it instead.
  • Instead of using server commands to create the weapons for the player, I'd use TF2Items to just manually do that.
  • If you hook Spawn instead of SpawnPost for ammo packs and just return stop on it, that'll do the same thing as killing them after they've spawned already.
  • I'd move the server commands which you execute OnMapStart to OnConfigsExecuted instead and use ConVar functions instead to set them.

Code:
stock void TF2_ForceWin(TFTeam team = TFTeam_Unassigned)
{
	int iFlags = GetCommandFlags("mp_forcewin");
	SetCommandFlags("mp_forcewin", iFlags &= ~FCVAR_CHEAT);
	ServerCommand("mp_forcewin %i", view_as<int>(team));
	SetCommandFlags("mp_forcewin", iFlags);
}
https://github.com/Drixevel/sourcemo...c-tf.inc#L2659

Last edited by Drixevel; 10-19-2020 at 22:56.
Drixevel is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:45.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode