SA-MP Forums Archive
Live-Radar to Website - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: General (https://sampforum.blast.hk/forumdisplay.php?fid=13)
+--- Thread: Live-Radar to Website (/showthread.php?tid=429)



Live-Radar to Website - Rafioso - 08.04.2007

Hi,

how can i do a Radar to my Website?

Radar:
A San Andreas Map with points of the place from the players ingame.
If someone ingame move, the point on the Radar moves too (live).

I hope you understand me

Thanks

Rafioso


Re: Live-Radar to Website - boylett - 08.04.2007

I did this with a PHP script, except you had to reload the page to get where the players are again xD. If you want it live without reload you need a flash script.


Re: Live-Radar to Website - Rafioso - 08.04.2007

Thank you for answer

But what i have to write in the Serverscript?

I see here the map >>> click here
And thats great


Re: Live-Radar to Website - ThePsyco - 08.04.2007

wow if enyone can get hold of one, send us a link :P looks awsome


Re: Live-Radar to Website - Rafioso - 08.04.2007

Quote:
Originally Posted by Y_Less
That's really not easy and will require alot of coding knowledge in a range of languages - PAWN to transmit the player's location, some server scripting, e.g. PHP to rebroadcast or process the data from the PAWN transmissions (probably done via files) and a web scripting language such as javascript, java, action script etc. to display it.
i only need the Pawn lines
The other are no problem


Re: Live-Radar to Website - rizla - 10.04.2007

Quote:
Originally Posted by Rafioso
Thank you for answer

But what i have to write in the Serverscript?

I see here the map >>> click here
And thats great
that is well cool its reloading the map by itself :O didnt even know this was possible
id like to see this for LWs server but i havent a clue about coding n stuff


Re: Live-Radar to Website - Rafioso - 13.04.2007

Can somebody MOVED that to Scripting, please


Re: Live-Radar to Website - boylett - 13.04.2007

The pawn side really isnt all that hard. If you want to do it via PHP you can create a file that PHP can include.

Heres an example:
pawn Code:
if(fexist("player.php")) fremove("player.php");
new File:file;
file = fopen("player.php",io_write);
new string[256];
fwrite(file,"<?php\n");
for(new i; i < MAX_PLAYERS; i++)
{
  new Float:x,Float:y,Float:z;
  GetPlayerPos(i,x,y,z);
  format(string,sizeof(string),"$x[%d] = %f;\n", i, x);
  fwrite(file,string);
}
fwrite(file, "?>");
fclose(file);
Then on the PHP side you would use a loop to get each players xyz that are set in player.php
Code:
<?php

include("path/to/player.php");

for($i = 0; $i < 100; $i++)
{
  if(isset($x[$i]))
  {
    // create an image using $x[$i], $y[$i] and $z[$i] as the players positions
  }
}

?>
And thats all there is really.

P.S i havent tested it this is just an example.


Re: Live-Radar to Website - DragonMasterNYC - 13.04.2007

maybe i can try something on the php side but it will take time unless someone here knows alot about php and can help

my people and i have been trying to make something like this for a wile with no luck in flash


Re: Live-Radar to Website - Nissandrifter - 13.04.2007

how to make the map recognize coords easily with php script?