[Question] Communication between Manialinks

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
User avatar
undef.de
Posts: 2095
Joined: 06 Apr 2011, 21:57
Location: Germany, North Sea Coast
Contact:

[Question] Communication between Manialinks

Post by undef.de »

I'm unsure if my script was ever working, I guess it was... but maybe I've forgot to test it well... or something...

Anyway, I have a server side manialink which asks for a vote (answers are "Yes" or "No").
Image

To display on every players screen the status, I want to store each players' vote into the array "Players" with my var "VoteManager_CurrentVote":

Code: Select all

Void StorePlayerVote (Text _Login, Text _Vote) {
	foreach (Player in Players) {
		if (Player.User.Login == _Login) {
			declare Text VoteManager_CurrentVote for Player = "None";
			if (VoteManager_CurrentVote != _Vote) {
				VoteManager_CurrentVote = _Vote;
			}
		}
	}
}
mmain () {
	while (True) {
		foreach (Event in PendingEvents) {
			switch (Event.Type) {
				case CMlEvent::Type::KeyPress : {
					// Prevent the initiator from changing his vote
					if (InputPlayer.Login != InitiatorLogin) {
						if (Event.KeyName == "F5") {
							StorePlayerVote(InputPlayer.Login, "Yes");
						}
						else if (Event.KeyName == "F6") {
							StorePlayerVote(InputPlayer.Login, "No");
						}
					}
				}
			}
		}
	}
}
But that is not working, the Input.Player see only his own vote and not the votes from the other. How can i communicate this between the manialinks?
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org


Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name

You like what I do? Then award a ManiaStar.
oliverde8
Posts: 1345
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: [Question] Communication between Manialinks

Post by oliverde8 »

Hi,

you can't do that with ingame manialinks. You can't share data between players.

What you must do is send the data to the controller which in return it will send to everyone a new manialink which updates only the player value without displaying anything.
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 1 guest