ID:262260
 
Code:
mob
other
Title_Man
icon='mobs.dmi'
icon_state = "Mayor"
npc = 1
Click(msg as text)
set src in oview(1)
if(usr.zenni >= 15000)
usr.title = "[msg]"
usr.zenni -= 15000
if(usr.zenni <= 14999)
usr << "<b><font color= Lime>You cannot give yourself a title until you have 15,000 zenni!"


Problem description:

Here's what is the probelm, when clcik on him the etxt screen wouldn't apper for me to typ in my title ?
What is wrong with this ?
Sayian Hunter wrote:
Here's what is the probelm, when clcik on him the etxt screen wouldn't apper for me to typ in my title ?
What is wrong with this ?

Well, mainly the fact that Click() doesn't work that way. If you want a box asking for a title, use input().

And unless you want some serious spam problems from rogue users, I strongly recommend using html_encode() around whatever message a user sets.

Also you should replace the if(usr.zenni<=14999) line, which is bogus, with else.

Lummox JR
mob
other
Title_Man
icon='mobs.dmi'
icon_state="Mayor"
npc=1
Click()
if(usr.zenni<=15000)
usr<<"You don't have enough zenni."
else
var/a=input(usr,"What do you want your title to be?","Title")as null|text
if(a==null)return
usr.title=a
usr.zenni-=15000
In response to Asohtra
Asohtra wrote:
var/a=input(usr,"What do you want your title to be?","Title")as null|text
if(a==null)return

Minor problem: What if the player hits Enter and the result is an empty string?

Instead, use the more robust form: if(!a).

Lummox JR
In response to Lummox JR
Lummox JR wrote:
Asohtra wrote:
var/a=input(usr,"What do you want your title to be?","Title")as null|text
if(a==null)return

Minor problem: What if the player hits Enter and the result is an empty string?

Instead, use the more robust form: if(!a).

Lummox JR

Well, then the user would have no title, wouldn't he? :)

y'see, some people like the option to have no title. Disallowing them to remove their title would be annoying. :/
In response to Asohtra
OOK Thanks All