[MOD] Simple Live MAP

Place for sharing your game modifications for Life is Feudal: Your Own

MacDante
 
Posts: 95
Joined: 12 May 2015, 10:08

Re: [MOD] Simple Live MAP

Post by MacDante » 16 Feb 2016, 15:43

any error ? or what ?


Cogollops
 
Posts: 40
Joined: 04 Dec 2015, 14:56
Location: Spain

Re: [MOD] Simple Live MAP

Post by Cogollops » 17 Feb 2016, 00:58

No, excuse me for not specifying the problem. :oops:
Php error does not appear on the page, just only see the guild's me as before, the players do not appear. :Search:

Web: http://cogollops.es/MAP :sorry:
Last edited by Cogollops on 07 Mar 2016, 11:43, edited 1 time in total.
Image

Image


MacDante
 
Posts: 95
Joined: 12 May 2015, 10:08

Re: [MOD] Simple Live MAP

Post by MacDante » 17 Feb 2016, 09:01

its simple my scrip is to MYSQL and you use script to MYSQLI.

Propobably correct script to MYSQLII should be this:

Code: Select all
$sql = "select *, (GeoID >> 18) as terID,(GeoID & ((1 << 9) - 1)) as `x`, ((GeoID >> 9) & ((1 << (9)) - 1)) as `y`  from `character` where IsActive=1";


$res = mysqli_query($db_handle, $sql) or die("error: " . mysqli_error($db_handle));
$sum_players=0;
   while( $row = mysqli_fetch_array($res) ) {
      $x=0;
      $y=0;
      $size = $_POST['size'];
      $name = $row['Name']." ".$row['LastName'];
   
      if ($row['terID'] == 442) {
         $y=1533-$row['y'];
         $x=$row['x'];
      }
      else if ($row['terID'] == 443) {
         $y=1533-$row['y'];
         $x=$row['x']+511;         
      }
      else if ($row['terID'] == 444) {
         $y=1533-$row['y'];
         $x=$row['x']+1022;         
      }
      else if ($row['terID'] == 445) {
         $y=1022-$row['y'];
         $x=$row['x'];         
      }
      else if ($row['terID'] == 446) {
         $y=1022-$row['y'];
         $x=$row['x']+511;         
      }
      else if ($row['terID'] == 447) {
         $y=1022-$row['y'];
         $x=$row['x']+1022;         
      }
      else if ($row['terID'] == 448) {
         $y=511-$row['y'];
         $x=$row['x'];         
      }
      else if ($row['terID'] == 449) {
         $y=511-$row['y'];
         $x=$row['x']+511;         
      }           
      else if ($row['terID'] == 450) {
         $y=511-$row['y'];
         $x=$row['x']+1022;         
      }                                 
      print "<div style='border: 1px; background: red;' class='player' title='player: $name' style='left:".($x-(2))."px; top: ".($y-(2))."px; ' ></div>";
   }
   print "<div style='position: absolute; margin:0; padding: 0; background: green; width: 1px; height: 1px; left: 1px; top:1533px'></div>";


Cogollops
 
Posts: 40
Joined: 04 Dec 2015, 14:56
Location: Spain

Re: [MOD] Simple Live MAP

Post by Cogollops » 18 Feb 2016, 14:28

I does not work, you pass a link to the code used:

http://pastebin.com/b5Ps1JmZ


I do not understand why
Image

Image


MacDante
 
Posts: 95
Joined: 12 May 2015, 10:08

Re: [MOD] Simple Live MAP

Post by MacDante » 18 Feb 2016, 15:45

i dont know how it happen but is error inline :

is
Code: Select all
print "<div style='border: 1px; background: red;' class='player' title='player: $name' style='left:".($x-(2))."px; top: ".($y-(2))."px; ' ></div>";

sholud be:
Code: Select all
print "<div style='border: 1px solid yellow; background: yellow; left:".($x-(2))."px; top: ".($y-(2))."px; width: 2px; height: 2px; position: absolute;' class='player' title='player: $name' ></div>";


PS: i dont use table 'lifdscp_online_character', but if is in this table position with player last position, this script can show only online players. But now show all active players registered on server.


Cogollops
 
Posts: 40
Joined: 04 Dec 2015, 14:56
Location: Spain

Re: [MOD] Simple Live MAP

Post by Cogollops » 19 Feb 2016, 14:14

Thanks, it works! ;)

So you could have this same map, showing the guilds and players unused -> lifdscp_online_character ??? :shock:

Could you tell me how to change that please? :oops:

And one thing I also wanted to comment on, the player that are within the radius of the guild, when I put the cursor over the player's information for the guild but I get Player. :Search:

Again, thanks for everything, I hope your answer. :beer:
Image

Image


MacDante
 
Posts: 95
Joined: 12 May 2015, 10:08

Re: [MOD] Simple Live MAP

Post by MacDante » 19 Feb 2016, 22:09

in player line in style add: z-index: 100;

print "<div style='z-index: 100; border: 1px solid yellow; background: yellow; left:".($x-(2))."px; top: ".($y-(2))."px; width: 2px; height: 2px; position: absolute;' class='player' title='player: $name' ></div>";


Cogollops
 
Posts: 40
Joined: 04 Dec 2015, 14:56
Location: Spain

Re: [MOD] Simple Live MAP

Post by Cogollops » 19 Feb 2016, 22:56

Okay :D , now how you could use this script without using lifdscp_online_character ??? :Search:

I imagine and it makes sense to connect this script with the database, but any configuration changes lifdscp_online_character ??? :Search:

I await your response with many thanks. :beer:
Image

Image


MacDante
 
Posts: 95
Joined: 12 May 2015, 10:08

Re: [MOD] Simple Live MAP

Post by MacDante » 20 Feb 2016, 00:04

i don't use 'lifdscp_online_character' and i can't see actual online players (Jugadores Conectados)
And i don't know what is stored in 'lifdscp_online_character ' and when is saved.

I dont have anny idea whether in this table is store last player position or not (if is then you can use this table to show only online players on the map).


Cogollops
 
Posts: 40
Joined: 04 Dec 2015, 14:56
Location: Spain

Re: [MOD] Simple Live MAP

Post by Cogollops » 20 Feb 2016, 04:10

You could replace the lifdscp_online_character, for this other script baron_players, I found these forums also:

http://pastebin.com/ht8TxHxm

Whichever way is and tell me what you think, thanks.
Image

Image


Nathorus
 
Posts: 9
Joined: 18 Oct 2014, 12:46

Re: [MOD] Simple Live MAP

Post by Nathorus » 04 Mar 2016, 11:34

Pls help me,

i dont understand , in need the PHP script pls :oops:

Thx for Help
Image
Image


Nathorus
 
Posts: 9
Joined: 18 Oct 2014, 12:46

Re: [MOD] Simple Live MAP

Post by Nathorus » 05 Mar 2016, 20:14

Okay sry Guys,

my map is Online, thx for this nice Simple Map :D
Image
Image


Kortal
 
Posts: 8
Joined: 02 Jan 2016, 23:33

Re: [MOD] Simple Live MAP

Post by Kortal » 09 May 2016, 00:34

@MacDante, would it be possible to add the player ip in the tables lifdscp_online_character and lifdscp_online_character ?


MacDante
 
Posts: 95
Joined: 12 May 2015, 10:08

Re: [MOD] Simple Live MAP

Post by MacDante » 10 May 2016, 07:17

Probably is this possibility, but not from my side. I don't use this table on my server and don't change it.


Halvdal
 
Posts: 107
Joined: 20 Jan 2016, 13:36

Re: [MOD] Simple Live MAP

Post by Halvdal » 10 May 2016, 16:45

If you want to show online players you should use this:
http://lifeisfeudal.com/forum/lif-baron-script-get-all-currently-active-players-t3364/

Here you find the script: http://pastebin.com/h2t5yev4
(Save it as baron.cs)

You have to create a new table named "baron_players" and in this table you create a column named "CharacterID". Then you can upload the baron.cs into your LiF server main directory, open your main.cs and add exec("baron.cs"); at the end of the file.

Then you have to edit the index.php and edit the line $sql = "SELECT * FROM `lifdscp_online_character`"; into $sql = "SELECT * FROM `baron_players`";.


Thats it!


Kortal
 
Posts: 8
Joined: 02 Jan 2016, 23:33

Re: [MOD] Simple Live MAP

Post by Kortal » 10 May 2016, 20:21

MacDante wrote:Probably is this possibility, but not from my side. I don't use this table on my server and don't change it.

yeah sorry, was just an example, any table would be fine lol
a new table, or the "account" table for example

Halvdal, thanks, but this doesnt match ip to a player, or ... did i miss something ?


K475u
 
Posts: 10
Joined: 14 Jun 2016, 19:02

Re: [MOD] Simple Live MAP

Post by K475u » 26 Jun 2016, 01:28

Kortal wrote:Thanks MacDante for your great work.
I have updated a bit the code and added some more other things.

+ updated to mysqli
+ migrated config to a separated file
+ grid on mouse over the map
+ guild members list on mouse over the guild claim
+ optional online count: need to have lifdscp (lif-dedicated-server-control-panel-lifds-cp-t15168/)
+ optional online player list: need to have lifdscp (lif-dedicated-server-control-panel-lifds-cp-t15168/)
+ optional weather display (today and tomorrow): need to copy the cm_weather1.xml file into map folder

css by Jakommo.

Image

download: https://mega.nz/#!k84kwbJI!yet-vK3qqPAh ... RZjPb-XXSY



Hey There,

Thanks for the map! Is it possible to Print the Ingame Time and Date on it instead of the RL Time and Date ?


Seregaman
 
Posts: 7
Joined: 17 Jun 2016, 19:32

Re: [MOD] Simple Live MAP

Post by Seregaman » 21 Nov 2016, 12:52

Thank you for Live MAP.
Everything works fine.
But the weather is not displayed.
(cm_weather1.xml file is in the folder MAP)

Code: Select all
if (file_exists('./cm_weather1.xml')) {
   $data = file_get_contents('./cm_weather1.xml', true);
   $pos = strpos($data, "=" . $daynumber .">");
   $weather=substr($data, $pos+2+strlen($daynumber), 15);
   $weather=substr($weather, 0, strpos($weather,"<"));

   $daynumber2 = $daynumber + 1;
   if ($daynumber == 364) { $daynumber2 = 1;}
   $pos = strpos($data, "=" . $daynumber2 .">");
   $weather2=substr($data, $pos+2+strlen($daynumber2), 15);
   $weather2=substr($weather2, 0, strpos($weather2,"<"));

   $infos = $infos . "Погода: " . $weather ." (завтра:". $weather2 . ")<br />";


Help please, what could be wrong.

User avatar
Dragodor
Zealous Believer
 
Posts: 327
Joined: 20 May 2015, 13:08

Re: [MOD] Simple Live MAP

Post by Dragodor » 15 Jan 2017, 14:29

Hello,
it works fine! :Yahoo!:

But 2 questions:
  1. I can't find the "cm_weather1.xml". Where do I have to download it?
  2. How can I deactivate the player names in the claim-tooltips?
Best Wishes,
Dragodor

User avatar
SnowSharky
 
Posts: 29
Joined: 01 Jun 2016, 02:50

Re: [MOD] Simple Live MAP

Post by SnowSharky » 04 May 2017, 10:22

Dragodor wrote:Hello,
it works fine! :Yahoo!:

But 2 questions:
  1. I can't find the "cm_weather1.xml". Where do I have to download it?
  2. How can I deactivate the player names in the claim-tooltips?
Best Wishes,
Dragodor

1. Its found in
Steam\steamapps\common\Life is Feudal Your Own Dedicated Server\data\weather
Tried messing around with the weather, assuming the format must have been changed as it doesnt seem to work anymore.

2. Go into the index.php and remove

{$guildmembers = $guildmembers . $db_field['Name'] . " " . $db_field['LastName'] . ", "; }
Should remove the names from being displayed, tho the popup will still show up

Return to Game mods