Jump to content
MakeWebGames

[mccode v2] Very simple travel time mod.


shaved92bravada

Recommended Posts

This is a very simple and easy to make mod and I'm sure there is something that is not secure about it so if there is something wrong with it and you can fix it then please do so. I would like to thank War_Hero for the idea of using travellingglobals.php with his club mod. Hope ya don't mind me using that little bit in this. Anyway on to the mod.

I use the travellingglobals.php for my jail, hospital, searchtime, as well as traveltime. It saves down on alot of if ($ir['blah']

so I will just post the whole thing.

the SQL ( if you are already using War_Hero's club mod then you already have this in your DB and don't need to run it. )

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

save this as travellingglobals.php ( if you already have War_Hero's club mod you have this file already )

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

I have to use the print " ": $h->endpage(); exit; for it to make everything look correctly on my game if someone else knows of a way to make it work better and still include the endpage as I have to have it due to my 3 column template I am working on them please let me know.

replace your monorail.php with this one.

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Now to make it where you can't do anything while you are travelling then you need to place

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

at the top of which ever page/s you don't want them to access while they are travelling.

And if you want it to display how much time they have left while they are travelling then open header.php

find this

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

and put this either above or below it doesn't matter

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Also add this into your cron_minute.php

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Link to comment
Share on other sites

Re: [mccode V2] Very simple travel time mod.

Ive noticed that the time taken to travel is $random, is there any way in which you could do this for a dedicated time for each destination... ??

See i was thinking of making a new query in locations and add the time to travel in there and then place the query onto the page so that it picks it straight out... Would i be correct ?

Also say you had more ways of transport eg driving a car what would you do, im under the impression you would just make another sql table within the locations again but call it something entirely different and add it in the for eg monorail page above, instead of my driving car traveling system.... could anyone actually tell me if im on the right track... Thanks, Jc

Link to comment
Share on other sites

Re: [mccode V2] Very simple travel time mod.

Sorry just to point out, i havn't looked at this mod say it might be a quite good but it seems alot compared to the time travel mod i have which is alot easier to add (its a paid mod which i bought).... the paid mod has dedicated traveling times.

Link to comment
Share on other sites

Re: [mccode V2] Very simple travel time mod.

See thats my problem, like I have stated in a previous topic can't remember which one lol, I am just a beginner so I may not be doing things the most efficient way. I do know that yes you can have dedicated times but I'm not sure the query you would need to select the locations, I would say something like fetch array or something along those lines. and then it would be like

if ($_GET['to'] ==1)

{

$rantime= the amount of time you want ;

}

etc, etc. But that could end up being alot of if's. So I do know there is a more efficient way to do it but I am not sure on how that part works. Believe me if I knew I would atleast try it, I just haven't gotten that far yet. I do know that if I am gonna be a good efficient respected game owner in the community then I atleast need to know programming in php some what thats why I am throwing little things out here in hopes that I can improve my skills with some constructive critisim. lol

also josh-j-c I am not for certain on what exactly to do if you have different modes of travel in the game, but if I do find something out that works then I will for sure let you know. And thanks again for the comments or critisim.

Link to comment
Share on other sites

Re: [mccode V2] Very simple travel time mod.

See i was in the direction of using,

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

And i was running through what else i would need to use to get the actual query to run on the page of the say "transportcar.php" Also it would be a little job editing the global you made like you said alot of "IF's" and "elseif"

Im not the most efficiant coder and im by far not the best but ill foccus all my concentration on this mod now, i hope other people can help me and shaved92bravada make a kool free modification thanks, Jc

Link to comment
Share on other sites

Re: [mccode V2] Very simple travel time mod.

My bro made this aswell but didnt post this, he added something in admin panel so you can have different moving time for each location

Link to comment
Share on other sites

Re: [mccode V2] Very simple travel time mod.

ok well in that case then this should work perfectly if you want a dedicated traveltime for each city on the monorail.php

And you will also need the travellingglobals, etc from my first post. I just like having random times and things like that. Alot of other things are random on my game, like the cost to travel is also random. Why not make it like the real world where things change ya know.

SQL

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

replace your monorail.php with this one

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

replace your staff_cities.php with this

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

I haven't tested that but it should work properly. Someone can feel free to try it out.

Link to comment
Share on other sites

Re: [mccode V2] Very simple travel time mod.

your using V1 so you would need to add the information into your admin panel. I would do it for you but I really don't have the time as I am working on my itemuse.php so everything will work correctly with some of my new special items I made. lol. plus its really simple to add those things in there.

Link to comment
Share on other sites

Re: [mccode V2] Very simple travel time mod.

Mod seems to be kool and ill be trying it out tomorrow after college nice mod mate all the coding looks legit... although are the prices easily negotiable ??? like taken from the database ???

Anyway nice mod and thanks for helping customise it to some of our specifications.

Jc

Link to comment
Share on other sites

Re: [mccode V2] Very simple travel time mod.

Put the coding through testing and seems it failed straight away I'm getting errors such as,

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Completely out of the blue...

See I'm in confussion now because i edited the database etc and it seem like the mod completely contradicts itself, for example to two MySql additions you have given us don't work together so the code couldn't possible work, and the page coding isn't sufficient ether anyone else experienced any issues such as these ?

Sorry to be the bearer of bad news :S

Jc

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...