Author Topic: messageAll without the use of a minigame.  (Read 1067 times)

I'm building a city, and there's going to be a missile silo/launch site. I want to be able to tell everyone that there's a missile launch via events, but I don't want to go through the hassle of minigames to make this happen.

Can someone make a messageAll output event that doesn't require a minigame?

Would you want it to be host only?

Would you want it to be host only?
Probably yeah, as to prevent abuse.

wouldnt you kinda have to set it as a minigame in order to kill people with said missile?

wouldnt you kinda have to set it as a minigame in order to kill people with said missile?
The point of the missile is for show, not for killing. Plus I don't want people shooting each other randomly for e-gangster points.

Most missiles, if not all missiles being launched from a launch site or silo, go straight up but slightly curved. I aim the projectile so that they go up high, slightly curving and then disappear out of sight.

Code: [Select]
function fxDtsBrick::messageAllClients(%this,%message,%client)
{
if(%this.getGroup().client.isHost)
messageAll('',%message);
}

registerOutputEvent(fxDTSBrick, "messageAllClients", "string 255 255",1);

//Code from Truce's admin controls add-on
//This is for checking for host.
package ACM {
function GameConnection::autoAdminCheck(%cl) {
%cl.isHost=0;
if(%cl.isLocalConnection()||%cl.bl_id==getNumKeyID())
%cl.isHost=1;
return Parent::autoAdminCheck(%cl);
}
function CheckACM(%cl,%cmd) {
switch($AdminControls[%cmd]) {
case 0:
if(%cl.isAdmin||%cl.isSuperAdmin||%cl.isHost)
return 1;
%type="\c3Admins\c0, \c3Super Admins\c0, and the \c3Host";
case 1:
if(%cl.isSuperAdmin||%cl.isHost)
return 1;
%type="\c3Super Admins\c0 and the \c3Host";
case 2:
if(%cl.isHost)
return 1;
%type="the \c3Host";
}
messageClient(%cl,'',"\c0Sorry, only "@%type@" \c0can use the \c3"@%cmd@" \c0command.");
return 0;
}
};
activatePackage(ACM);

Untested.

Code: [Select]
messageAll('',%message);

Isn't there supposed to be another " in there? or is it two apostrophes?

Isn't there supposed to be another " in there? or is it two apostrophes?
That's two of these ---> '

-snipsnip-

Untested.
Now I'm going to go ahead and ship this into a .zip file and name it server.cs?

I would assume save it as server.cs, then zip it... but idk.

Make your own description.txt
Save that code as server.cs
Zip 'em up.

The event will only work if it's on the host's brick.

Im going to start working on 2 kinds of this messageAll event.

1) Unrestricted
2) Admin-Only
« Last Edit: April 24, 2009, 11:44:10 AM by Club559 »



...


What, i'm going to need that one.
I hope to god you don't release that to the public.