ID:168999
 
Can someone help me make a phone company that will setup a phone system and have peoples name on a list so that when people use a verb called call on the phone it will read from the list.

And can u make me the phone verbs so taht it will go along with the company. I will make the company i need the code to make the company add the names to the list tho!
I can't give you the code(many ways of doing this and others) but uh..I can help a bit..Note: If copied and pasted, it won't work.
mob
proc
Register()
if(src.gotnumber)
var/no1 = rand(1,9)
var/no2 = rand(1,9)
var/no3 = rand(1,9)
src.number = no1+no2+no3//gives them a unique number
for(var/mob/M in world)
if(M.number == src.number)//if someone already has the number, add 1 to it...there IS a btter way to do this
src.number += 1
alert("Your number is [src.number]!"
src.gotnumber = 1


[EDIT]Oh yeah..forgot..
mob
verb
Call()
var/number = input("Dial the number...") as num
for(var/mob/M in world)
if(M.number == number)
src.talker = M

mob
verb
Say()
if(src.talker)
var/msg = input("Waht to say?") as text
for(var/mob/M in world)
if(M == src.talker)
M << "[src] : [msg]"

Whew..alot of work..But it should work...-.-
In response to Mecha Destroyer JD
OK so if i add this into the coding how do i make it work so that when u go to the phone company that when u enter and hit talk to phone salesmen it will give u a phone number.. and then how do i make it so that if they build a phone their number is build in..
In response to Robertg0123
Can't make the game for you, but what I showed you can lead you in the right direction.
In response to Mecha Destroyer JD
can u make it without the numbers.. just a list?

like a list but u still have to register to be on the list..
In response to Robertg0123
If you wait a sec (maybe more) I will have a nice little system (it will need lots of testing) thats a phone system,
1 dif the phones are preplaced and u get to connect them just by clicking on the phone.

and if its by a list it would just be a PM system.

In response to Zmadpeter
Zmadpeter wrote:
If you wait a sec (maybe more) I will have a nice little system (it will need lots of testing) thats a phone system,
1 dif the phones are preplaced and u get to connect them just by clicking on the phone.

and if its by a list it would just be a PM system.


wheres the code?
In response to Robertg0123
STILL WAITS FOR CODE!
In response to Robertg0123
Don't count on other people to give you "the code". Create it yourself.
In response to Robertg0123
mob
proc
Register()
if(!src.name in phonenumbers) // If not in the phone number list
phonenumbers += src.name

var/global/list/phonenumbers = new // Phone number list variable


mob
verb
Call()
var/whom = input("Who?") in phonenumbers // Who from the list
for(var/mob/M in world)
if(whom == M.name) // Find the user
src.talker = M.name // Set the variable for who your calling

mob
verb
Say(msg as text) // Works like a normal Say() verb
for(var/mob/M in world)
if(M.name == src.talker) // Find the mob again
M << "[src] : [msg]" // Send the message
src << "[src] : [msg]" // Echo the message so you can see it, always nice to see what you have said.

Maybe that will suit your purposes, took me less than 3 minutes, I can't see why you needed help with it, hopefully now you'll be able to read this, and understand how to do this type of thing in the future, good luck, everyone has to start somewhere, don't give up.