ID:159727
 
All fixed. Thanks for the assistance fellas.
How about you just move around the checks.
proc/Wanted_Alert()if(wanted>=10)for(var/mob/M)if(M.PoliceOfficer)
//...Do whatever

Though you never really said what the problem was.
In response to Kaiochao
Kaiochao wrote:
How about you just move around the checks.
> proc/Wanted_Alert()if(wanted>=10)for(var/mob/M)if(M.PoliceOfficer)
> //...Do whatever
>

Though you never really said what the problem was.

This is the, "How To" forum, not "Code Problems". That is why I posted How To do what I stated. I think I was pretty clear with what I asked.
In response to Branks
You didn't ask anything you didn't already have, or are you asking how to output text?
M<<text
In response to Kaiochao
Kaiochao wrote:
You didn't ask anything you didn't already have, or are you asking how to output text?
M<<text


Lol, I know how to do that. It's the first thing I learned in DM. Anyhow, I just wanted to know how to send text to all players who are part of the police, to say that the PLAYER or PLAYERS are wanted criminals. Meaning, it should list the players who are wanted in the server.
In response to Branks
Looks like the code I modified was good enough to do just that. You just have to call it.
In response to Kaiochao
Kaiochao wrote:
Looks like the code I modified was good enough to do just that. You just have to call it.

Not quite. Right now it outputs that I'm wanted about 7 times. Not sure what I'm doing wrong now...


Wanted level increases to (10)
Branks is a Wanted criminal!
Branks is a Wanted criminal!
Branks is a Wanted criminal!
Branks is a Wanted criminal!
Branks is a Wanted criminal!
Branks is a Wanted criminal!
Branks is a Wanted criminal!


Below is the code you modified for me, and I made a couple changes to comply with my game.
    proc
Wanted_Alert()
if(wanted>=10)
for(var/mob/M)
if(M.PoliceOfficer)
world<<"[src] is a Wanted criminal!"
else ..()
else ..()


This is just a verb for testing... and it outputs 7 notices.
mob/player/verb
Raise_Wanted()
usr.Wanted_Alert()
usr.wanted+=1
usr<<"Wanted level increases to ([usr.wanted])"
In response to Branks
Most likely because you didn't read my post about outputting.

Apparently you DIDN'T learn how. Correctly, at least.

Other Post:
M<<text

Currently, you have it outputting to the world, which in your code outputs the message "for each" police officer in the world.

And you don't have a parent proc to the parent proc. Don't use "..()", or anything for that matter, if you don't know how.

Also. The position of the code in a code block DOES affect what comes first.
mob/player/verb
Raise_Wanted()
usr.Wanted_Alert()
usr.wanted+=1
usr<<"Wanted level increases to ([usr.wanted])"

You're calling Wanted_Alert() before you become wanted.
Use this instead:
mob/player/verb
Raise_Wanted()
wanted++ //Shorthand for var+=1
src<<"Wanted level increases to [wanted]"
Wanted_Alert() //Call it AFTER your wanted level rises.
In response to Kaiochao
Kaiochao wrote:
Most likely because you didn't read my post about outputting.

Apparently you DIDN'T learn how. Correctly, at least.

Other Post:
M<<text

Currently, you have it outputting to the world, which in your code outputs the message "for each" police officer in the world.

And you don't have a parent proc to the parent proc. Don't use "..()", or anything for that matter, if you don't know how.

Also. The position of the code in a code block DOES affect what comes first.
> mob/player/verb
> Raise_Wanted()
> usr.Wanted_Alert()
> usr.wanted+=1
> usr<<"Wanted level increases to ([usr.wanted])"
>

You're calling Wanted_Alert() before you become wanted.
Use this instead:
> mob/player/verb
> Raise_Wanted()
> wanted++ //Shorthand for var+=1
> src<<"Wanted level increases to [wanted]"
> Wanted_Alert() //Call it AFTER your wanted level rises.
>


I see... Well now it's only repeating itself once, so it outputs 2 messages, as I decreased the rest with changing mob/M to mob/player/M. Still, I think for every player in the world, it will continue to repeat my name a billion times. Any idea why my proc is outputting that the player is a wanted criminal, two times... instead of one?

mob                     
proc
Wanted_Alert()
if(wanted>=10)
for(var/mob/player/M)
if(M.PoliceOfficer)
world<<"<center>ATTENTION all Police Officers on duty, <b>[src]</b> is a Wanted criminal!</center>"

mob/player/verb
Raise_Wanted()
wanted++
src<<"<center><b>Your Wanted level increases to ([wanted])</center></b>"
Wanted_Alert()
In response to Branks
Kaiochao wrote:
Most likely because you didn't read my post about outputting.

Apparently you DIDN'T learn how. Correctly, at least.

Other Post:

M<<text


Currently, you have it outputting to the world, which in your code outputs the message "for each" police officer in the world.
In response to Branks
You are sending the message to world, which means every player sees the message. So the message is sent to every player N times, where N is the number of police officers playing.