Author Topic: MessafeBoxYesNo not working  (Read 460 times)

When ever a server uses messageboxyesno mod or not, it works the first time then it just stops working. In console it just says in red, "Syntax error." It's really beginning to tick me off.
Please don't comment if your not helping.


that mod is broken.
Then Event_PromptEvents is broken.
So is every single mod that uses MessageBoxYesNo that gets the command from the server.
:|

Then Event_PromptEvents is broken.
So is every single mod that uses MessageBoxYesNo that gets the command from the server.
:|
How could such a simple mod even be broken?
Code: [Select]
registerOutputEvent("FxDTSBrick","MessageBoxYesNo","string 255 300",1);
registerInputEvent("FxDTSBrick","OnMessageBoxYes","Self FxDTSBrick Player Player Client GameConnection MiniGame MiniGame");

function GameConnection::MessageBoxYesNo(%this, %text,%client)
{
%client.clickBrick = %this;
messageClient(%client,'messageBoxYesNo',"Brick",%text,'YesEventCmd');
}

function serverCmdYesEventCmd(%this)
{
%this.clickBrick.onMessageBoxYes(%this);
}

function fxDTSBrick::onMessageBoxYes(%this, %client)
{
$InputTarget_["Self"]   = %this;
$InputTarget_["Player"] = %client.player;
$InputTarget_["Client"] = %client;

if($Server::LAN)
{
$InputTarget_["MiniGame"] = getMiniGameFromObject(%client);
}
else
{
if(getMiniGameFromObject(%obj) == getMiniGameFromObject(%client))
$InputTarget_["MiniGame"] = getMiniGameFromObject(%obj);
else
$InputTarget_["MiniGame"] = 0;
}
//process the event
%obj.processInputEvent("OnMessageBoxYes", %client);
}
Note: This code is not guaranteed to work as I have not tested it and wrote it in like 5 seconds and never proofread it.

I already see a forgetin' mistake.
Code: [Select]
registerOutputEvent("FxDTSBrick","MessageBoxYesNo","string 255 300",1);
registerInputEvent("FxDTSBrick","OnMessageBoxYes","Self FxDTSBrick Player Player Client GameConnection MiniGame MiniGame");

function GameConnection::MessageBoxYesNo(%this, %text,%client)
{
%client.clickBrick = %this;
messageClient(%client,'messageBoxYesNo',"Brick",%text,'YesEventCmd');
}

function serverCmdYesEventCmd(%this)
{
%this.clickBrick.onMessageBoxYes(%this);
}

function fxDTSBrick::onMessageBoxYes(%this, %client)
{
$InputTarget_["Self"]   = %this;
$InputTarget_["Player"] = %client.player;
$InputTarget_["Client"] = %client;

if($Server::LAN)
{
$InputTarget_["MiniGame"] = getMiniGameFromObject(%client);
}
else
{
if(getMiniGameFromObject(%obj) == getMiniGameFromObject(%client))
$InputTarget_["MiniGame"] = getMiniGameFromObject(%this);
else
$InputTarget_["MiniGame"] = 0;
}
//process the event
%obj.processInputEvent("OnMessageBoxYes", %client);
}
Fixed. Still not guaranteed to work.

I already see a forgetin' mistake.Fixed. Still not guaranteed to work.
Mother forgeter. Ctrl+H and replace %obj with %this. I don't even use %obj for anything, this is what I get for referencing Space Guy's event topic.