Code:
Problem description:
Ok I've been wondering about this for awhile, I don't even know how to start about it but its a system that i really want.
I want to know how to code a system where,
Player Can Make Themselve boss base on there level,
And If Someone else come along and is higher level.
They can Overtake them cause he higher lvl.
But For this kind of system there alot of things i don't know. How Do it make it so when the player who got over take loses his title and changed back to normal.
So If anyone got any ideas or clue just throw them at me and i'll try it.
May 29 2012, 1:06 pm
|
|
emmm kind of simple. You could use if statements in a verb and take away the lower level persons rank and give the higher level person the rank they deserve. This is really mostly to do with if statements and maybe adding/taking away a couple of verbs.
|
Here's Something Quick I Came Up With, Read Threw it carefully and ask if you don't know what something is and/or does, so that you can do it yourself next time
mob/var/Level=0//Level var May Be Different In You Source |
I understand the code, But I tried it in game and it doesn't seem to work.
When i click it, it doesn't do a thing. Doesn't even play the message "Horay ! etc." The Become_Leader() Verb My Level var is the same as the one you posted. |
That Could be because on ur skin the output is different, try
usr<<output("Horay ! Your Are The New Leader","w.e ur output is") |
its not the skin.
mob When you press it if it work, It should've changed my player rank = Boss, But it didn't when i tested it. Any ideas why it wouldn't work? |
Also, it isn't necessary to have Leader as a list. Since only one user will be a Leader at a time, simply assign that person to the Leader var. It will remove unnecessary Add() and Remove().
|
Well i don't know if that will remove the previous User, who was boss
so how come this code don't work D:? var/list/Leader=list() I put the everything in the right place Login() Logout etc. i think the probem is with LeaderLvl=0? maybe no? |
mob/var One issue is you didn't have anything set up if no one was leader. That's probably where your issue lies. Try something like this. |
when i tried click the verb in game i got this in the game chat.
Dark (/mob): Become Leader() runtime error: Cannot read null.Level proc name: Become Leader (/mob/verb/Become_Leader) source file: Family.dm,18 usr: Dark (/mob) src: Dark (/mob) call stack: Dark (/mob): Become Leader() Anyway Couldn't manage to make it work xD i guess its harder then it looks. |
You are all wrong.
var If you don't understand any of this, please ask. You need to know what the code means, not just copy and paste it. |
I understood the one they posted above.
I Did Copy and paste but I know what did what so i was able to put them around my own game without erorrs, But like i said before i don't know how to do this system so I couldn't have known why it wouldn't work. Anway, Thanks Undestood the one you posted fast. |
In response to Michael3131
|
|
Michael3131 wrote:
> mob/var One issue is you didn't have anything set up if no one was leader. That's probably where your issue lies. Try something like this. Hey -- the issue with your code is that you didn't short circuit the if statement, as in you checked leader.xxxx before !leader. That is what line 18 should have been. |
In response to Pirion
|
|
I should've seen that. Thank you for letting me know!
|