Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Cog needed, forgot how to do this...
Cog needed, forgot how to do this...
2004-03-20, 7:28 AM #1
I need a simple MP cog for JK...

When a trigger is sent, it would teleport all the players to ghost1, get the player with the most scores and print "The winner is... playername with xxx scores!", then reset every player's scores.

------------------
ILLEGAL PORNOGRAPHIC VIDEOS NEWEST GAMES MP3Z AND MOVIES!!!
Last edited by mb; today at 10:55 AM.
2004-03-20, 7:54 AM #2
Code:
# When a trigger is sent, it would teleport all the players to ghost1,
#  get the player with the most scores and print "The winner is...playername
#  with xxx scores!", then reset every player's scores.
#
# [Darth Slaw]
# 3/20/04
#==============================================================#
symbols

int       i              local
int       highscore      local
int       teleportid=0

thing     highscorer     local
thing     player         local
thing     ghost

message   trigger

end
#==============================================================#
code
#------------------------------------------------------
trigger:
	if(GetSenderID() == teleportid)
	{
		highscorer = GetPlayerThing(0);
		highscore = GetPlayerScore(highscorer);
		for(i = 0; i < GetNumPlayers(); i = i + 1)
		{
			player = GetPlayerThing(i);
			TeleportThing(player, ghost);
			if(highscore < GetPlayerScore(player))
			{
				highscorer = player;
				highscore = GetPlayerScore(highscorer);
			}
			SetPlayerScore(player, 0);
		}
		jkStringClear();
		jkStringConcatAsciiString("The winner is...");
		jkStringConcatPlayerName(highscorer);
		jkStringConcatAsciiString(" with ");
		jkStringConcatInt(highscore);
		jkStringConcatAsciiString(" scores.");
	}

Return;
#------------------------------------------------------
end


Try this cog. It should work if I did everything right.

------------------
I am Darth Slaw.
The Dark Lord of the Sith,
And part of the Nightfire mod team
May the mass times acceleration be with you.
2004-03-20, 10:20 AM #3
Yay. it works. except for the printing "the player is playername with xxx scores!"... it doesn't do that for some reason :/

------------------
ILLEGAL PORNOGRAPHIC VIDEOS NEWEST GAMES MP3Z AND MOVIES!!!
Last edited by mb; today at 10:55 AM.
2004-03-20, 11:01 AM #4
add this line:

jkStringOutput(-3, -1);

after the line

jkStringConcatAsciiString(" scores.");

------------------
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

-Tazz

[This message has been edited by Tazz (edited March 20, 2004).]
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

Tazz

↑ Up to the top!