[PHP+DJSON] DMap 0.4 - Dynamic Website Player/Car/Obj/Shop Map(******Maps based)
#41

I got it working via ftp for any of those people who dont have access other than by ftp for their server.

Quote:

<?php

global $config;

$local_file = "dmap_feed.json";
$server_file = "chaosserver/0.3/scriptfiles/dmap_feed.json";

$ftp_server = "******"; // Address of FTP server.
$ftp_user_name = "chaos"; // Username
$ftp_user_pass = "*****"; // Password
#$destination_file = "chaosserver/0.3/scriptfiles";

// set up basic connection
$conn_id = ftp_connect($ftp_server);

// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

// try to download $server_file and save to $local_file
if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
"File Downloaded $local_file\n";
} else {
"There was a problem\n";
}

$config['api key']='---Removed---';
$config['default script'] = 'dmap_feed.json';
$config['allow external'] = true;

?>


Simply replace the server, user and user_pass fields with your ftp login information.
Then replace the bits in bold with the path to your scriptfiles.
Reply
#42

When i want to compile the include, it just gives me over 20 errors of djson. wtf?

Oh, and my map still repeats.. how can i block it? My online map
Reply
#43

Quote:
Originally Posted by (ed!med!
When i want to compile the include, it just gives me over 20 errors of djson. wtf?

Oh, and my map still repeats.. how can i block it? My online map
I am pretty sure you need to have the djson.inc include!

This is supposed to allow me to see the online players through the map, right?
Reply
#44

Quote:
Originally Posted by RealCop228™
Quote:
Originally Posted by (ed!med!
When i want to compile the include, it just gives me over 20 errors of djson. wtf?

Oh, and my map still repeats.. how can i block it? My online map
I am pretty sure you need to have the djson.inc include!

This is supposed to allow me to see the online players through the map, right?
1. No, i allready have the djson include

2. Yes.
Reply
#45

Quote:
Originally Posted by (ed!med!
Quote:
Originally Posted by RealCop228™
Quote:
Originally Posted by (ed!med!
When i want to compile the include, it just gives me over 20 errors of djson. wtf?

Oh, and my map still repeats.. how can i block it? My online map
I am pretty sure you need to have the djson.inc include!

This is supposed to allow me to see the online players through the map, right?
1. No, i allready have the djson include

2. Yes.
1. Okay, post the errors here.

2. Yeah, I figured it out. (forgot I has an RP server in which the player icons don't show) Thanks!
Reply
#46

Please can I use this in the filterscript? I have only .amx of mod , and I want to use this online map.
Please can you help me?
Thanks.
Sorry for my bad english, I am from Slovakia.
Reply
#47

This isn't working for me. I have everything up correctly and everything running right. The map on my browser is blank, while it should have some icons on it. When I manually type in /fetch_data.php into my browser it shows the contents of data_feed.djson correctly. So I know my path is correct and it is getting the contents correctly.
I have tried many things and my map doesn't show with any player icons.

I have tried setting my API key to http://localhost and http://localhost/indexmap.php

Nothing seems to work. Everything is set up correctly and is working fine. Please help me!
Reply
#48

Quote:
Originally Posted by lolumadd
This isn't working for me. I have everything up correctly and everything running right. The map on my browser is blank, while it should have some icons on it. When I manually type in /fetch_data.php into my browser it shows the contents of data_feed.djson correctly. So I know my path is correct and it is getting the contents correctly.
I have tried many things and my map doesn't show with any player icons.

I have tried setting my API key to http://localhost and http://localhost/indexmap.php

Nothing seems to work. Everything is set up correctly and is working fine. Please help me!
localhost is a different thing. Try 127.0.0.1 instead.

- Draco
Reply
#49

Quote:
Originally Posted by DracoBlue
Quote:
Originally Posted by lolumadd
This isn't working for me. I have everything up correctly and everything running right. The map on my browser is blank, while it should have some icons on it. When I manually type in /fetch_data.php into my browser it shows the contents of data_feed.djson correctly. So I know my path is correct and it is getting the contents correctly.
I have tried many things and my map doesn't show with any player icons.

I have tried setting my API key to http://localhost and http://localhost/indexmap.php

Nothing seems to work. Everything is set up correctly and is working fine. Please help me!
localhost is a different thing. Try 127.0.0.1 instead.

- Draco
Still doesn't work man. I don't know what im doing wrong! The server is writing the .djson file correctly and the server is reading the file correctly! Why isnt it working?
Reply
#50

Hi, sorry up thread.

My fetch_data.php return:

Code:
{"items":{"p0":{"icon":"58","id":0,"name":"Player1","pos":{"x":2475,"y":-1672},"text":"Vida: 100"},"p2":{"icon":"58","id":2,"name":"Player2","pos":{"x":-1681,"y":411},"text":"Vida: 100"}}}
But it does not show the icons of the players.


Note: I have not changed that one should not change

Sinceraly, Strong.
Reply
#51

This is still working?
Reply
#52

Quote:
Originally Posted by thimo
View Post
This is still working?
You mean - does it work? If yes, yeah it does..
Reply
#53

Great work Draco, I have always enjoyed your work.
Would be great if anybody could re-do the pictures in a higher resolution
Reply
#54

Alright fellas, I got the API working, the feed file was created in /scripfiles, so obviously this thing is ready to work.

The website also shows the map & the API functions (zoom, zoom out) work.

Now I wonder why it didn't update when a player joined, nothing changed.

I did however load this up as a Filterscript rather than using it in the gamemode, so I started the djson gamemode in OnFilterScriptInit & djson gamemodexit in OnFilterScriptExit.

I wonder if it didn't work because of that? I also used the djsInt OnPlayerConnect as provided in the stats.pwn test gamemode.
Reply
#55

wowww
Reply
#56

Top Top.
Reply
#57

after a few secs i get a message saying: "****** has disabled API codes for this prodect or your api key is invalid"

and i got my own api key for v2.0 so is there a way to fix this?
Reply
#58

https://code.******.com/apis/console/

Here
Reply
#59

Wonderful
Reply
#60

If i join server and look at the online map it doesnt show my location or anything. Only the map.
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)