ID:268126
 
mob/Clan/verb
Recrut()
set category = "Clan"
var/mob/list/List
for(var/mob/Player/M in world)
if(M.Clan == null)
List += M
var/mob/R = input("Who would you like to recrut in this world?") in List
switch(alert(R,"[usr] has invited you to join the [usr.Clan]!","[world.name]","Yes","No"))
if("Yes")
R.Clan = usr.Clan
for(var/mob/Player/M in world)
if(M.Clan == usr.Clan)
M<<"<font color = silver>[M] has been recruted into your clan!"
else
usr<<"<B><font color = silver>[R] has disagreed to joining your clan!"

runtime error: Cannot modify null.Clan.
proc name: Recrut (/mob/Clan/verb/Recrut)
source file: Party.dm,32
usr: Kasumi (/mob/Player)
src: Kasumi (/mob/Player)
call stack:
Kasumi (/mob/Player): Recrut()
I see a few problems. Most specifically using usr.
mob
Clan
verb
Recruit()
var/list/peoples
var/lotsofem = 0
for(var/mob/M in world)
if(M.client && !M.Clan) //Kill two birds with one stone
peoples += M
lotsofem++
if(!peoples | !lotsofem) return //Don't do anything if there's no one to recruit.
var/mob/R = input("Who would you like to ask to join your clan?","Recruit") as null|anything in peoples //Gives them the option to cancel.
if(!R) return //If they hit cancel, stop.
if(alert(R,"Would you like to join [src]'s clan, [src.Clan]?","Join Clan","Yes","No") == "Yes") //If they say yes to the invitation
R.Clan = src.Clan //Assign their clan.
for(var/mob/M in world)
if(M.Clan = src.Clan)
M << "[R] has joined [src.Clan]!"
In response to Enigmaster2002
Enigmaster2002 wrote:
I see a few problems. Most specifically using usr.

It's a verb; usr is safe there.

Lummox JR