The online racing simulator
Announce command
I created a new command only for admins !ann <announce> but do not go my way. When i type for example !ann Hello I just occurs to me, but not other players :|
Here is some of the code:

var Conn = Connections[GetConnIdx(MSO.UCID)];
{
if (Conn.IsAdmin == 1 || Conn.IsSuperAdmin == 1)
{
string Announce = Msg.Remove(0, +5);
InSim.Send_BTN_CreateButton("^1Admin Announcement:", Flags.ButtonStyles.ISB_DARK, 20, 50, 50, 75, 190, Conn.UniqueID, 2, false);
InSim.Send_BTN_CreateButton("^1" + Announce, Flags.ButtonStyles.ISB_DARK, 11, 150, 70, 25, 192, Conn.UniqueID, 2, false);
}
}

Well that's obvious. You're only sending the buttons to the connection that issues the !ann command, aka you.

You will have to either loop through the list of connections and send it to everyone, or use UCID 255 instead of your connection UCID.
So you want to say: var Conn = Connections[GetConnIdx(MSO.UCID 255)]; ?
#4 - heawy
var Conn = Connections[GetConnIdx(MSO.UCID)];
{
if (Conn.IsAdmin == 1 || Conn.IsSuperAdmin == 1)
{
string Announce = Msg.Remove(0, +5);
InSim.Send_BTN_CreateButton("^1Admin Announcement:", Flags.ButtonStyles.ISB_DARK, 20, 50, 50, 75, 190, 255, 2, false);
InSim.Send_BTN_CreateButton("^1" + Announce, Flags.ButtonStyles.ISB_DARK, 11, 150, 70, 25, 192, 255, 2, false);
}
}

or you can use C here as other connections than admin if you want later to send it for specific player too.


var Conn = Connections[GetConnIdx(MSO.UCID)];
if (StrMsg.Length > 1)
{
if (Conn.Username.ToLower() == "heawy" || Conn.IsSuperAdmin == 1)
{
string Message = Msg.Remove(0, 4);

foreach (clsConnection C in Connections)
{
InSim.Send_BTN_CreateButton(Message, Flags.ButtonStyles.ISB_DARK, 15, 109, 55, 46, 10, C.UniqueID, 2, true);
InSim.Send_MST_Message("/rcm ^1 Admin Announcement:");
InSim.Send_MST_Message("/rcm_all");


}
}
else
{
MsgPly("^7Not Authorized", (MSO.UCID));
}
}
else
{
MsgPly("^7Invalid Command.", (MSO.UCID));
}

Thank you very much heawy !

FGED GREDG RDFGDR GSFDG