Username:    Password:        Click Here To Signup     Forgotten Password
Main Menu
Online
Members: 0

Guests: 24

213.222.x.x download
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x lgsl
46.229.x.x forum
46.229.x.x forum
46.229.x.x dilbertplus
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
54.225.x.x forum
54.36.x.x forum
54.36.x.x dilbertplus
54.36.x.x dilbertplus
54.36.x.x forum
54.36.x.x lgsl
54.36.x.x forum
54.36.x.x user
54.36.x.x dilbertplus
54.36.x.x guestbook
54.36.x.x forum
54.36.x.x forum

Last Seen

Wussie Fri 01:57
suzain lian Fri 07:52
85filip58 Wed 12:37
mmotony Sat 04:27
Dodgeitorelse Fri 12:48

Newest Members

Forums
Gamemode for BF and L4D
Sep
Thu Jul 15 2010, 01:26PM
Posts: 19
Joined: Sat Sep 08 2007, 01:02PM
Registered Member #3321
Hello,

http://muh.brunz.eu/header.png

i added the gamemode at post/get it works for bf2 and bc2 bot not for source (L4D/L4D2) also the bf2 should actually be co op any idea where this come from? or is it from the lgsl?
thanks

Website
Rich
Thu Jul 15 2010, 03:05PM
Posts: 1717
Joined: Wed Nov 26 2003, 04:30PM

The name of settings are different for each game, and may not be directly given.

So you need to look at the settings on each servers details page, and work out some logic.

http://brunz.eu/header/?s=2
Co-Op is not mentioned as a setting value, but some Co-Op keys have been added.

http://brunz.eu/header/?s=4
The only mention of the mode is in the description, but also has a 'L4D - ' prefix.

So from this you could do:


if ($server['b']['type'] == "bfbc2")
{
  $text = $server['e']['gamemode'];
}
elseif ($server['b']['type'] == "bf2")
{
  if (isset($server['e']['bf2_coopbotcount']))
  {
    $text = "Co-Op";
  }
  else
  {
    $text = ucfirst($server['e']['gamemode']);
  }
}
elseif ($server['b']['type'] == "source")
{
  if ($server['s']['game'] == "left4dead")
  {
    $text = str_replace("L4D - ", "", $server['e']['description']);
  }
}

Website
Sep
Fri Jul 16 2010, 05:53AM
Posts: 19
Joined: Sat Sep 08 2007, 01:02PM
Registered Member #3321
ok i use post/get type now and added your code aswell there
do i need to add more at lgsl_query_cached? "type" is already in there

it stays on "type" with your code guess its wrong placed :/

http://brunz.eu/header/lgsl_files/lgsl_header.php
Website
Rich
Fri Jul 16 2010, 04:10PM
Posts: 1717
Joined: Wed Nov 26 2003, 04:30PM

The above code sets a variable called $text.

Are you using $text in your image code ?

If you still have problems, zip up and post the code.
Website
Sep
Sat Jul 17 2010, 12:19AM
Posts: 19
Joined: Sat Sep 08 2007, 01:02PM
Registered Member #3321
no $text in my image.php, no clue how to seperate them than if u send them via post/get
sended just the zipped code link via pm
Website
Sep
Sat Jul 17 2010, 09:58AM
Posts: 19
Joined: Sat Sep 08 2007, 01:02PM
Registered Member #3321
thx for the files Rich works nice for 3 (bc2,bf2,l4d)

l4d2 does not have any indication here about mode/type so i tryed it like uve done for bf2 without success

  elseif ($server['b']['type'] == "source")
  {
    if (isset($server['s']['game'] == "left4dead2"))
    {
      $custom = "Versus";
    }
  }
Website
Rich
Sat Jul 17 2010, 10:57AM
Posts: 1717
Joined: Wed Nov 26 2003, 04:30PM

if (isset($server['s']['game'] == "left4dead2"))

isset checks if a variable is set, not its value, use:

if ($server['s']['game'] == "left4dead2")
Website
Sep
Sat Jul 17 2010, 11:06AM
Posts: 19
Joined: Sat Sep 08 2007, 01:02PM
Registered Member #3321
u mean like this? because this won't work here

   elseif ($server['b']['type'] == "source")
  {
    if ($server['s']['game'] == "left4dead2")
    {
      $custom = "Versus";
    }
  }

Website
Rich
Sat Jul 17 2010, 01:20PM
Posts: 1717
Joined: Wed Nov 26 2003, 04:30PM

E-Mail me your latest lgsl_header.php

Website
Sep
Sun Jul 18 2010, 06:53AM
Posts: 19
Joined: Sat Sep 08 2007, 01:02PM
Registered Member #3321
works great thank you rich!

i would have another question i saw u made that already for bc2 map names so i thought it can be easy to do the same for other games like l4d but i cant find the row where to place it in lgsl_protocol.php lol or do i need to rename and do something with the mapcheck?

// CONVERT MAP NUMBER TO DESCRIPTIVE NAME SOURCE

      $server['e']['level'] = $server['s']['map'];
      $map_check = strtolower($server['s']['map']);

      if     (strpos($map_check, "l4d_vs_hospital01_apartment") !== FALSE) { $server['s']['map'] = "Hospital Apartment";   }
      elseif (strpos($map_check, "l4d_vs_hospital02_subway") !== FALSE) { $server['s']['map'] = "Hospital Subway";     }
      elseif (strpos($map_check, "l4d_vs_hospital03_sewers") !== FALSE) { $server['s']['map'] = "Hospital Sewers";    }
      elseif (strpos($map_check, "l4d_vs_hospital04_interior") !== FALSE) { $server['s']['map'] = "Hospital Interior"; }
      elseif (strpos($map_check, "l4d_vs_hospital05_rooftop") !== FALSE) { $server['s']['map'] = "Hospital Rooftop"; }     

    }

//---------------------------------------------------------+
Website
Rich
Sun Jul 18 2010, 10:45AM
Posts: 1717
Joined: Wed Nov 26 2003, 04:30PM

Avoid editing the lgsl_protocol.php as it will break with upgrades. Instead add it to your lgsl_header.php

Add the code you posted
After $misc = lgsl_server_misc($server);
Before $mapname = $server['s']['map'];
Website
Sep
Tue Jul 20 2010, 07:25AM
Posts: 19
Joined: Sat Sep 08 2007, 01:02PM
Registered Member #3321
works great thanks again
Website
 

Jump:     Back to top


You are not logged in - Click Here To Signup

Username:    Password:   

Mini Buttons

.... © GreyCube.com - Richard Perry - Powered by e107.org