Sign in to follow this  
={FMJ}=Smiley

B3/CoD4XWebAdmin

Recommended Posts

Hi All, I tried to search but did not find so I will ask.

I am using Neho's CoD4XWebAdmin (Love It) But also wanted to have messages scrolling in the way that B3 does. 

I can have B3 running but it seems kind of pointless to use when you can do all with the CoD4XWebAdmin. 

I would use B3 running for screen messages ONLY. So the question is what do you guys do if you want screen messages. I am using OW based MoD and yes you can have messages scrolling through but I dont think they are so good as having them where 'chat' appears. 

1. I can use CoD4XWebAdmin with the $ prefix ( I don't like that 😁 ) (But probably easiest solution)

2. Is there some script I can add to display messages in the 'chat' area ?

3. Can julia plugin be used to generate messages? The image shows 'julia' or is this just B3? 

1776141204_2021-04-0513_49_37-Photos.png.01b855c3b02689c3746d982ece116f77.png

I think I am missing a trick here. 😆

Would be interested what you guys are doing..using both webadmin and b3 ? something else?

Thanks for the input.

Smiley. 

Share this post


Link to post
Share on other sites

I also use Neho's CoD4XWebAdmin  but I stopped using b3 because of all the functions of CoD4XWebAdmin

to put messages in my server I use _advertisement.gsc which I got from this web site - I just edited it to suit my needs

here is the link https://cod4x.me/index.php?/forums/topic/4278-automatic-messages-script/

you must know how to call scripts in the main_shared folder to use that file

Share this post


Link to post
Share on other sites
2 hours ago, wkuzma said:

I also use Neho's CoD4XWebAdmin  but I stopped using b3 because of all the functions of CoD4XWebAdmin

to put messages in my server I use _advertisement.gsc which I got from this web site - I just edited it to suit my needs

here is the link https://cod4x.me/index.php?/forums/topic/4278-automatic-messages-script/

you must know how to call scripts in the main_shared folder to use that file

Thanks mate, I think those message will appear in bottom of screen? You can already do that in OW MoD. I was hoping to get something in the same place as B3 did..Its not a massive problem but would be nice. When i seen the image above I was wondering if we can do something with 'julia' 

I dont use a main_shared folder either. Anything I want to work like that is done with a serverside iwd file. Same thing basically. 

I am not a guru with all this so all a learning curve. 🙂 

Share this post


Link to post
Share on other sites
Posted (edited)
init()
{
	level.delay = 10;
	
	level thread advertisement();
	
	for(;;)
	{
		level waittill("connected",player);
		
		if(game["roundsplayed"] == 0)  // stops welcome spamming on map change
			return;
		
		if( isdefined( player.pers["player_welcomed"] ) ) // stops the welcome repeating each round
			return;
		player.pers["player_welcomed"] = true;  // player welcomed
		
		
	}
}

advertisement()
{	
	for(;;)
	{
		wait 6;
		
			{
				level hudmsg("Message 1");
				wait 6;
				level hudmsg("Message 2");
				wait 6;
				level hudmsg("Message 3");
				wait 6;
				level hudmsg("Message 4");
				wait 6;
				level hudmsg("Message 5");
				wait 6;
				level hudmsg("Message 6");
				wait 6;
				level hudmsg("Message 7");
				wait 6;
				level hudmsg("Message 8");
				wait 6;
				level hudmsg("Message 9");
				wait 6;
				level hudmsg("Message 10");
				wait 6;
			}
	}

}


hudmsg(text)
{
	msg = addTextHud( level, 0, 470, 1, "left", "middle", undefined, undefined, 1.4, 888 );
	msg SetText(text);
	msg.sort = 102;
	msg.foreground = 1;
	msg.archived = true;
	msg.alpha = 1;
	msg.fontScale = 1.8;
	wait 20;
	msg destroy();
	level notify ("msg_done");
}

MoveHud(time,x,y)
 {
    self moveOverTime(time);
    if(isDefined(x))
        self.x = x;
       
    if(isDefined(y))
        self.y = y;

}
addTextHud( who, x, y, alpha, alignX, alignY, horiz, vert, fontScale, sort ) {
	if( isPlayer( who ) )
		hud = newClientHudElem( who );
	else
		hud = newHudElem();

	hud.x = x;
	hud.y = y;
	hud.glowColor =  ( 0.043, 0.203, 1 ); 
	hud.glowAlpha = 1; 	
	hud.alpha = alpha;
	hud.sort = sort;
	hud.alignX = alignX;
	hud.alignY = alignY;
	if(isdefined(vert))
		hud.vertAlign = vert;
	if(isdefined(horiz))
		hud.horzAlign = horiz;		
	if(fontScale != 0)
		hud.fontScale = fontScale;
	hud.foreground = 1;
	hud.archived = 0;
	return hud;
}

I edited the code you showed to meet my needs and it now displays bigger at the bottom left (no scrolling) plus it is a lot less code

Edited by MAD_DAD

Share this post


Link to post
Share on other sites
Posted (edited)

have a play with 

msg = addTextHud( level, 0, 470, 1, "left", "middle", undefined, undefined, 1.4, 888 );

The 0, 400 is the position on screen, you could get it positioned near the chat area but reduce  msg.fontScale = 1.8; or the writing is too big

Edited by MAD_DAD

Share this post


Link to post
Share on other sites

Welcome to my server Smiley :) On the screenshot what you have shared I am using plugin http and gsc scripts. There are some premade json files what you can read/POST with plugin http. You can find the json files if you navigate on cod4xwebadmin to Admin->Server Edit

 

There is a TaB -> 3rd Party Http Plugin

 

Server messages are pure gsc

The welcome message, stats message on your screenshot are made with plugin http + gsc

You can also add other stuff to your server like player vision settings (playerID based), new server commands like banlist, server admins, player name aliases etc etc

 

check out the premade json files 

 

 

Screenshot_2021-04-05 Edit Server - Cirkus Serveri.png

  • Like 1

Share this post


Link to post
Share on other sites

Hi Neho,

Thx for the reply..A little bit above my head but I can give it a try...

That is if I can get WebAdmin working again....Been working great and today I took a screenshot..Got a message saying connection refused or something like that and then boom..page is gone.. grrrrrrr 

I posted on your forum...

So if I can get it working again it would be great because I LOVE the app...

The only thing I did was set up VHOST with Apache. The page was displayed ok and I could stop/start servers etc...I had done nothing else with it until today (screenshot) 😞 

Hope you can help. 

Smiley

1385965363_2021-04-0623_18_09-smiley@fmjcod4__public_cod4xwebadmin.thumb.png.84dd8772e41a82a27a4064de50bd35e2.png

Share this post


Link to post
Share on other sites
Posted (edited)

I found the error I ot when i screenshot the player....It caused problems and page was gone but I put my back up folder back in and went through like it was fresh install and it was ok. I wont start servers yet on this app until i know what this is. 127.0.1.1 ?? That's not right ?? Where to change etc/hosts file is ok...its not in config.json......So??

1668517127_2021-04-0718_55_01-FMJSniperElite_TDM_-FMJCoD4XWebAdmin.png.d27a2062a2c259fbb7cb84ffa4aab081.png

Edited by ={FMJ}=Smiley
Update On Situation.

Share this post


Link to post
Share on other sites
Posted (edited)

to show messages in chat like b3 you don't need a hud, that's just wasting ressources.

 

all you need is to add a loop that executes the say command on the server.

 

something like

init()

{

  messages = [];

  messages[0] = "hello";

  messages[1] = "world";

 

  curMessage = 0;

  delay = 30;

  while(1)

  {

    if(curMessage >= messages.size)

      curMessage = 0;

 

    exec("say " + messages[curMessage]);

    curMessage++;

    wait delay;

  }

}

 

edit: you can use dvars instead of plain strings, that way you can change the messages easier.

Edited by Viking
  • Like 1

Share this post


Link to post
Share on other sites
On 4/5/2021 at 10:14 PM, NeHo said:

Welcome to my server Smiley :) On the screenshot what you have shared I am using plugin http and gsc scripts. There are some premade json files what you can read/POST with plugin http. You can find the json files if you navigate on cod4xwebadmin to Admin->Server Edit

 

There is a TaB -> 3rd Party Http Plugin

 

Server messages are pure gsc

The welcome message, stats message on your screenshot are made with plugin http + gsc

You can also add other stuff to your server like player vision settings (playerID based), new server commands like banlist, server admins, player name aliases etc etc

 

check out the premade json files 

 

 

Screenshot_2021-04-05 Edit Server - Cirkus Serveri.png

That's great but where is the idiots guide on how to actually get this working lol....:-)

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this