Jump to content

Sign in to follow this  
SOFTACT

Score Counting Script?

Recommended Posts

Hello,

Ive been searching for some time on a easy way to Score Count for a PvP game.

Just a basic one, that will count the kills from each faction, and who ever reaches the limit wins.

If there is a easy script, or even a line of code that will count, that would be awesome.

If we can compile something, i will post my finding, and possibly a sample mission for people can create some in-house pvp with there community's.

Thanks,

-SOF- Tactical Realism Dev Team

Share this post


Link to post
Share on other sites

Use the default scoring system to evaluate each side's score with scoreSide and end the mission when one side reaches a defined amount. A very simple way would be to do something like:

if (isServer) then {
waitUntil {scoreSide WEST >= 100 || {scoreSide EAST >= 100}};
if (scoreSide WEST >= 100) then {
	[{hint "Blufor wins!!!";},"BIS_fnc_spawn",true,false] spawn BIS_fnc_MP;
	//Code to globally end the mission
} else {
	[{hint "Opfor wins!!!";},"BIS_fnc_spawn",true,false] spawn BIS_fnc_MP;
	//Code to globally end the mission
};
};

This way you can avoid uneeded Eventhandlers / counters.

Edited by Iceman77

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×