ID:179449
 
Well, I started redoing my HQ system again. I think its much better now and allows for better gamplay for future HQ vs HQ gameplay. Here is my code:
turf/cheaphq
var/mob/master = null
var/list/L
L = new /list/
door
icon = 'HQ.dmi'
icon_state = "door"
density = 0
Enter()
if(usr.key in L)
usr << "you are a member!"
return ..()
else
usr << "You cannot enter"
return 0
Click()
if(master == null)
var/buy = input("Do you wish to buy this HQ?") in list("Yea!","No!")
if(buy == "Yea!")
usr<< "you would have lost some money by now."
master = "[usr.key]"
L+= "[usr.key]"
else
usr << "HQ: We don't need your stinkin' businuss!"
else
Join()
verb
checkmaster()
set src in oview(1)
usr << "my master is [master]"
checkmembers()
set src in oview(1)
usr << "the members of this hq are [L]"
mastertest()
set src in oview(1)
master << "test"*
------
* = That last line never seems to work.
------

------
Here is the Join() proc
------
turf/cheaphq/proc
Join()
switch(alert(master,"[usr.name] wants to join you!","Yes","No"))
if("Yes")
L+= "[usr.key]"
world << "[usr] has joined the [master]'s HQ!"
if("No")
usr << "You were not accepted"

-------
That was supposed to send the alert to the master, but it never did...
-------

Thank you for taking the time to help me, even if you don't help, thanks for reading :)
-Sariat

Sariat wrote:
Well, I started redoing my HQ system again. I think its much better now and allows for better gamplay for future HQ vs HQ gameplay. Here is my code:
> turf/cheaphq
> var/mob/master = null
> var/list/L
> L = new /list/
> door
> icon = 'HQ.dmi'
> icon_state = "door"
> density = 0
> Enter()
> if(usr.key in L)
> usr << "you are a member!"
> return ..()
> else
> usr << "You cannot enter"
> return 0
> Click()
> if(master == null)
> var/buy = input("Do you wish to buy this HQ?") in list("Yea!","No!")
> if(buy == "Yea!")
> usr<< "you would have lost some money by now."
> master = "[usr.key]"
> L+= "[usr.key]"
> else
> usr << "HQ: We don't need your stinkin' businuss!"
> else
> Join()
> verb
> checkmaster()
> set src in oview(1)
> usr << "my master is [master]"
> checkmembers()
> set src in oview(1)
> usr << "the members of this hq are [L]"
> mastertest()
> set src in oview(1)
> master << "test"*
> ------
> * = That last line never seems to work.
> ------
>
> ------
> Here is the Join() proc
> ------
> turf/cheaphq/proc
> Join()
> switch(alert(master,"[usr.name] wants to join you!","Yes","No"))
> if("Yes")
> L+= "[usr.key]"
> world << "[usr] has joined the [master]'s HQ!"
> if("No")
> usr << "You were not accepted"
>
> -------
> That was supposed to send the alert to the master, but it never did...
> -------
> Thank you for taking the time to help me, even if you don't help, thanks for reading :)
> -Sariat
>
>

thats because master is a var (i think) try for(M in world)
if(M.master=blah)//you get the point i hope
Hope this works!!!
In response to Air _King
Doh! I never remembered that! Thanks!

-Sariat
In response to Sariat
Sariat wrote:
Doh! I never remembered that! Thanks!

-Sariat

No Problem! Glad I could help!!!

~~~~~~~~~~~~~~~~~~
~--==Air King==--~
~~~~~~~~~~~~~~~~~~

<font color=blue><x><</x><font color=skyblue><x>^</x><font color=green><x>></x><font color=darkblue>A<font color=blue>I<font color=skyblue>R <font color=green>_<font color=lightgreen>K<font color=skyblue>I<font color=blue>N<font color=darkblue>G<font color=green><x><</x><font color=lightgreen><x>^</x><font color=skyblue><x>></x>
In response to Air _King
Personally, I would just change from:

master = "[usr.key]"

to:

master = usr

You've already defined master as a mob.