mob/Car_1/Move()
..()
for(var/mob/M in world)
if(M.vehicle == src)
M.loc = locate(src.x,src.y,src.z)
mob/Move()
if(src.vehicle)
return 0
..()
if(src.client)
for(var/mob/Car_1/M in world)
if(M.driver == src)
M.loc = locate(src.x,src.y,src.z)
M.dir = usr.dir
M.Move(locate(src.x,src.y,src.z))
mob/var
driver
maxpassengers = 0
currentpassengers = 0
vehicle = null
mob/Car_1
maxpassengers = 2
see_invisible = 100
icon = 'Cars.dmi'
icon_state = "Car 1"
npc = 1
verb/Hop_In()
set src in oview(1)
if(src.driver == null && !usr.vehicle)
view(src) << "[usr] hops into the [src] and begins driving!"
usr.invisibility = 100
usr.loc = locate(src.x,src.y,src.z)
src.driver = usr
else
if(src.currentpassengers < src.maxpassengers && !usr.vehicle && src.driver != usr)
view(src) << "[usr] jumps into the [src] and rides as [src.driver]'s passenger!"
usr.vehicle = src
usr.invisibility = 1
usr.loc = locate(src.x,src.y,src.z)
src.currentpassengers += 1
verb/Get_Out()
set src in view(0)
if(src.driver == usr)
view(src) << "The driver of the [src] ([usr]) hops out, leaving no driver behind!"
usr.vehicle = null
src.driver = null
walk_rand(usr,2)
sleep(2)
walk(usr,0)
usr.invisibility = 0
world << usr.vehicle
if(usr.vehicle == src)
if(src.driver != usr)
view(src) << "[usr] hops out of the [src], leaving an extra space for a new passenger!"
src.currentpassengers -= 1
src.vehicle = null
walk_rand(usr,2)
sleep(2)
walk(usr,0)
usr.invisibility = 0
Click()
usr << "The [src] is being driven by [src.driver] along with [src.currentpassengers] passengers."
DblClick()
usr << "The current passengers of the [src] driven by [src.driver].."
for(var/mob/M in world)
if(M.client)
if(M.vehicle == src)
usr << "[M]"
Problem description:
Ok everything work good including the car drives ok.
Only thing i want the car appear on the game when you log in and t he car apper at the location you last left it.
And if your driving it and log out, and goes back in the car next to you, otherwise if not driving the car is there where you last left it.
Please and thank You
-Create a set of variables for the cars to hold the location coordinates
-Make sure that before you log off, the variables are set to the cars current coordinates
-Create a variable(not specific to mobs and such) of the list type
-Make sure that before you log off, the list gets saved(of course)
-Make sure that before you log off, and before the list is saved, you add each car to the list
-For when you log back in, make sure that there is some sort of proc to read all of the cars from the list, create them to the world, and send them to their previous, saved coordinates.
Keep in mind that there are other, more efficient ways out there. This is just one representation of it from someone who doesn't feel like using the standard style of doing this right now. Hope this concept works for you.
Absolute Zer0