obj/var/owner
obj/car1
icon = 'car1.dmi'
if(owner == usr)
usr<<"this is your car"
obj/car2
icon = 'car2.dmi'
if(owner == usr)
usr<<"this is your car"
obj/car3
icon = 'car3.dmi'
if(owner == usr)
usr<<"this is your car"
obj/car4
icon = 'car4.dmi'
if(owner ==usr)
usr<<"this is your car"
ID:162882
Nov 12 2007, 5:36 am
|
|
On this example, Would i need to make a owner var for every car.
|
In response to Kichimichi
|
|
The argument for that verb shouldn't be there, and all instances of "P" should be replaced with "usr". Additionally, ..() has no meaning when you are defining a new verb or proc (if you have to put the "verb" line before it). The first if() should just be if(owned), which is the proper way of checking a true/false value, and the second if() shouldn't even be there. 6000$ is incorrect, it should be $6000. "car1" in the verb should be "src" in every case. If you wanted to allow multiple cars to be owned, you would NOT create new variables. Instead, you would change the carowned var to a list.
|
In response to Garthor
|
|
ok, my game has a person making money to buy a car. Once he has a car, he can make more money, buy better cars
i dont want other players to be able to get in other peoples cars |
In response to Kylemark
|
|
Good to hear.
|
Kylemark wrote:
anyhow I think this basically works might need a tweak or 2.
This doesn't look like it would do much of anything how it is you're if's would have no effect since they're not triggered anywhere. If these are going to be left on the street somewhere or something where anyone could walk up to them in the game you could make the usr var = to the car name.