PDA

View Full Version : PHP Maps with Coords


andreagighi
17.05.2005, 20:22
I've make an easy script to take the position of player and to know the exactly coords position of any player (very useful in C2 that got /loc not workin).
Now with this method i can use the map to make coord for new span in npcpos.

Easier to see that to say here the screen...

andreagighi
17.05.2005, 20:23
here the script:
sorry for multiply post but my connection suck...

damienstone
17.05.2005, 21:51
wow thats pretty cool. Itd be nice if we can get a bigger higher resolution map especially for a server like mines where 2000 people could be logged in at one time.

Dubie
17.05.2005, 23:31
Great job bro.
Worked great.

You must of used png for your own copy or test copy.
Still have that in there for the images but the ones you packaged were jpg ;)
Will have to change them couple of lines not a big deal.

Yeah bigger map would also be cool like Dam said for higher number of players be hard to target one players on this one out of 2000+ hehe

You could try this one out I uploaded
Well shit I did not want to show the pic just link it.

Keep up the good work.

Peace,
Dubie

Kane Hart
18.05.2005, 04:11
Man wish we had really smart people I mean thats sweet work but saw one time you all think sweet i think java or somthing map shows all locations of the players in the world... was a wow server. it would be sorta sweet have that for admin use or even player use hehe.

archy
18.05.2005, 06:11
Havent looked at source, just wanted to say good morning europe! :-)

But, if you use the x,y,z from database you may know they aint all that correct (more like totally wrong and written to every 5 min)

But thats just my experience..

Kane Hart
18.05.2005, 07:13
oh wait LOL I was not looking this guy made somthing like this LOL I only looked at the 2nd image thought was just a nice map LOL cool!

Don't think can do in php like a biger map then guy added and be able zoom or have more then 1 map layout.. so people like small one can use or click on for bigger map and such.,

andreagighi
18.05.2005, 07:31
Yeah ops sorry mymistake... with png if u need i will post...

The map in the package is 1027x768 if u need more resolution pm me i can correct the script...

Kane Hart
18.05.2005, 07:38
Yeah ops sorry mymistake... with png if u need i will post...

The map in the package is 1027x768 if u need more resolution pm me i can correct the script...

I'm going see if I can learn correct on my own sorta learning php man this so cool though :D

Edit gave up on trying im guessing:
$xsito=($valorex + 131072)/400-7; //Aden
$ysito=($valorey + 32768)/410-7; //Aden
but dont know how get exactly to match.. Im guessing you sat there fin tunning it to be perfect not sure..

andreagighi
18.05.2005, 08:25
Yeah ops sorry mymistake... with png if u need i will post...

The map in the package is 1027x768 if u need more resolution pm me i can correct the script...

I'm going see if I can learn correct on my own sorta learning php man this so cool though :D

Edit gave up on trying im guessing:
$xsito=($valorex + 131072)/400-7; //Aden
$ysito=($valorey + 32768)/410-7; //Aden
but dont know how get exactly to match.. Im guessing you sat there fin tunning it to be perfect not sure..


$valorex=mssql_result($resultlistaplayer, $i, 1); //Take x from DB
$valorey=mssql_result($resultlistaplayer, $i, 2); //Take y from DB



if ($valorey>(-32768)) { //choose if in Aden or Elmore
$xsito=($valorex + 131072)/400-7; //131072=Offset DB; 400 = multiplier half image x; 7 = Icon Offset
$ysito=($valorey + 32768)/410-7;}
else {
$xsito=($valorex - 98336)/325-7+510;
$ysito=($valorey + 229352)/325-7+719+90; //719 = Offset for image.
}

Kane Hart
18.05.2005, 08:30
ahh cool. I did bring down size of my icons to 5 don't know made diffrence in where people are if correct or not heres little shot of it. was just messing around hehe.

Kane Hart
18.05.2005, 08:38
Yeah ops sorry mymistake... with png if u need i will post...

The map in the package is 1027x768 if u need more resolution pm me i can correct the script...

I'm going see if I can learn correct on my own sorta learning php man this so cool though :D

Edit gave up on trying im guessing:
$xsito=($valorex + 131072)/400-7; //Aden
$ysito=($valorey + 32768)/410-7; //Aden
but dont know how get exactly to match.. Im guessing you sat there fin tunning it to be perfect not sure..


$valorex=mssql_result($resultlistaplayer, $i, 1); //Take x from DB
$valorey=mssql_result($resultlistaplayer, $i, 2); //Take y from DB



if ($valorey>(-32768)) { //choose if in Aden or Elmore
$xsito=($valorex + 131072)/400-7; //131072=Offset DB; 400 = multiplier half image x; 7 = Icon Offset
$ysito=($valorey + 32768)/410-7;}
else {
$xsito=($valorex - 98336)/325-7+510;
$ysito=($valorey + 229352)/325-7+719+90; //719 = Offset for image.
}

ok i get so the new map should be

$xsito=($valorex + 131072)/513.5-7; //Aden
$ysito=($valorey + 32768)/384-7; //Aden

now the 7= the icon offset hows that work default layout each icon map is 12 pixs.. so not sure yet how work.. and what be for 5pix one.

LOL my calculations are way off :P

What would be cool save me bandwidth and such is a image or somthing is made every 5 min sorta same way but makes the calulations on server pc then web server grabs info every like 5-10 min from server reduce lag just be a nice map have on front site.. dont know if it's possible..

Riane
18.05.2005, 12:31
hm great stuff, will look into this later
@kane of course thats possible, maybe will try later

BiGBoY
18.05.2005, 13:57
here the script:
sorry for multiply post but my connection suck...

Thumbs up !
Nice helper for GM's

BiGBoY
18.05.2005, 20:51
here is a hint how to narrow online players info a little bit more accurate:
replace
$querylistaplayer="SELECT char_name,xloc,yloc,race,zloc FROM [user_data] WHERE login > logout ORDER BY char_name ASC";
with
$querylistaplayer="SELECT char_name,xloc,yloc,race,zloc FROM [user_data] WHERE login>logout AND logout>0 AND login>0 ORDER BY char_name ASC";

and
$querynumeroplayer="SELECT count(*) FROM [user_data] WHERE login > logout";
with
$querynumeroplayer="SELECT count(*) FROM user_data WHERE login>logout AND logout>0 AND login>0";

Kane Hart
18.05.2005, 21:40
be cool if like at the ned script be like map?=kane

and it displays just kane or like map?=kane,all
and would make kane show up as image 6 or w/e image you want and then it stands him out..

demon
20.05.2005, 23:26
this is the map for C2 correct image size for this project

size is better 810x719 than 800 x 719 btw..

rodier
22.05.2005, 02:36
Heh I created version with C2 maps + better place descriptions + in title you see player name + location + clan .
next version (I post it here) will have player filter = you type player name and you see only that player on map :o)

Kane Hart
22.05.2005, 03:10
Heh I created version with C2 maps + better place descriptions + in title you see player name + location + clan .
next version (I post it here) will have player filter = you type player name and you see only that player on map :o)

I can't wait :D

EntroX
22.05.2005, 13:07
Yes, this is an awsome job, quite usefull because at my work on the cybercafe i can keep an eye on people :P

I will keep an eye on the next releases, keep the good work and thank you for releasing this.

Yours.
EntroX

EntroX
22.05.2005, 13:08
Sorry, double post, i got some weird XML error and i wasnt sure if this got posted.

Yours.
EntroX

ThaDon
26.05.2005, 07:44
hmm i have a problem with it, when i copy it in the wwwroot and try http://127.0.0.1/mappeadmin.php ill become this (look attachment), and yes i have modified the php file to my ip, sql nick and pw ;) anyone can help pls :) ?

demon
26.05.2005, 08:38
does your IIS run php ?..

ThaDon
26.05.2005, 09:18
hmm where i can enable php for IIS, i think only Asp is enabled, but iam not sure?

ThaDon
26.05.2005, 09:50
ok Php Version 4 and 5 in IIS is activated

ok i have modified some things in the IIS, and now i get this:

Nya-o
26.05.2005, 12:50
your php don't have MSSQL extension.....^_^
to use it, you must have php_mssql.dll in your extensions dir and enable it in php.ini by inserting 'extension=php_mssql.dll'

ThaDon
26.05.2005, 13:09
ok have added the php_mssql.dll in IIS, but iam not sure is right cuz u say extensions dir? btw problem is still there :(

and the line was allready added in php.ini and ill try the live map with PHP 5^^

Nya-o
26.05.2005, 13:49
you don't need php_mssql.dll in iis, you need it to be in your php extensions dir (ie ext)...

erlang
26.05.2005, 17:14
This woudl be nice for playrs to see to, to see were others are to group up, however for that wed need a seperate config.php, sicn ethe usernaem and pass for the sql is right there in the map leaves it open for attacks in that case.

_seih_
06.06.2005, 17:42
i'm so confused, i'm using the following maps:

aden: 1312x1179
elmore: 1312x984

i've changed the php to:

if ($valorey>(-32768)) {
$xsito=($valorex + 131072)/656-7; //Aden
$ysito=($valorey + 32768)/410-7; //Aden
}
else {
$xsito=($valorex - 98336)/325-7+510; //Elmore
$ysito=($valorey + 229352)/325-7+1179+90; //Elmore
}

should i modify anything else? :S

yendream
10.06.2005, 07:34
Can I display Big5 code with this web system.
thanks