mob/players
proc
Update_Party()
var/party_limit = 0
for(var/mob/players/P in party)
party_limit++
if(party_limit == 1) // -- If the Party was jsut created when the Update Proc was ran
P.party = src.party // it will assign the Following Verbs to the Party Leader
P.in_party = 1
P.party_leader = src.name
P.verbs -= /mob/Party/verb/Create_Party
P.verbs += /mob/Party/verb/Party_Chat
P.verbs += /mob/Party/verb/Leave_Party
P.verbs += /mob/Party_Leader/verb/Party_Invite
P.verbs += /mob/Party_Leader/verb/Boot_Party_Member
else
P.in_party += 1 // -- Else the Member verbs are assigned to those who join after the party is created
P.verbs -= /mob/Party/verb/Create_Party
P.verbs += /mob/Party/verb/Leave_Party
P.verbs += /mob/Party/verb/Party_Chat
Remove_Verbs() // -- Used when a Mob Joins. Removes any Verbs that may have been accidently Saved
src.verbs -= /mob/Party_Leader/verb/Party_Invite
src.verbs -= /mob/Party_Leader/verb/Boot_Party_Member
src.verbs -= /mob/Party/verb/Party_Chat
src.verbs -= /mob/Party/verb/Leave_Party
Disband_Party_Proc() // -- This proc is used for when the Leader leaves the Party
for(var/mob/players/P in party)
src.verbs -= /mob/Party_Leader/verb/Party_Invite // -- Removes the Party Leaders Verbs
src.verbs -= /mob/Party_Leader/verb/Boot_Party_Member
P.verbs += /mob/Party/verb/Create_Party // -- Then Add's the Default Party Creation verb
P.verbs -= /mob/Party/verb/Leave_Party // -- and removes the verbs when used in a Party
P.verbs -= /mob/Party/verb/Party_Chat
P << "<b>[src] Disbands the party."
P.party_leader = list()
P.party = list()
P.in_party = 0
Leave_Party_Proc() // -- This proc is used for when a Member of the Party Leaves
if(src.in_party == 0)
return
for(var/mob/players/P in party)
if(src.party_leader == src.name)
src.Disband_Party_Proc()
else
P << "<b>[src] Leaves's the party"
P.party.Remove(src)
src.party = list()
src.in_party = 0
src.party_leader = list()
src.verbs += /mob/Party/verb/Create_Party // -- Removes the Party Members Verbs
src.verbs -= /mob/Party/verb/Leave_Party
src.verbs -= /mob/Party/verb/Party_Chat
mob/Party
verb
Create_Party()
set category = "Party"
if(src.in_party == 1)return
party.Add(src) // -- Add's the Person to the Party's List
src.in_party = 1
src.Update_Party() // -- Runs the Update proc (See above)
src.party_leader = src.name // -- Sets the Party's Leader to src (One who Created the Party)
Party_Chat(msg as text)
set category = "Party"
if(src.in_party == 1) // -- Makes it so only P (Party Members) of your Party can see the Chat
P << "<B>[src]</B> *Party* says: [msg]" // -- Sends the Message to the Party
else
M << "<B>[src]</B> Your not part of a party!!!" // -- It will tell the player they arn't part of a party!
Leave_Party()
set category = "Party"
src.Leave_Party_Proc() // -- Runs the Leave Party Proc (See above)
mob/Party_Leader
verb
Boot_Party_Member(var/mob/players/M in src.party) // -- Used to Boot a Member of the Party
set category = "Party"
if(M == src)return // -- Prevents the Party Leader from Booting Themself!
switch(alert(usr,"Are you sure about Boot [M] from the Party?","","Yes","No"))
if("Yes")
alert(M,"You have been Booted from the Party") // -- Sends an Alert to the Member being Booted
M.Leave_Party_Proc() // -- Runs the Leave Party Proc (See above)
else
return
Party_Invite()
set category = "Party"
var/members = 0 // -- Members in the Party so Far
for(var/mob/players/M in get_step (src,src.dir)) // To invite someone, you must be facing them
if(M.in_party == 1)// -- Prevents the Leader from inviting someone already in a party
usr << "<B>They are already in a Party!"
return
if(M.considering == 1)// -- Prevents the Leader from inviting someone already being asked to Join a Party
usr << "<B>They are already Considering Joining a Party!"
return
if(usr.name == usr.party_leader && members < 8 && usr.key != null) // -- If the Person inviting someone to the Party is the Party leader
M.considering = 1 // -- And the Party count is less than 8 (Max Party Limit. Can be changed)
switch(alert(M,"Do you want to join [usr]'s Party?","","Yes","No")) // -- And the Party Leader's Key isn't null, then it asks
if("Yes") // -- The Person [M] if they want to join the party
members++ // -- If they accept, then the Party gains One member (members++)
usr.party += M // -- Add's [M] to the Party's list
M.party = usr.party // -- Set's [M]'s Party to the Leaders
M.considering = 0
usr.Update_Party() // -- Runs the Update Party Proc (See above)
for(var/mob/P in usr.party)
P << "<b>[M] has joined the Party"
return
else
usr << "<B>[M]:</B> I don't want to join your Party"
M.considering = 0
else
if(usr.name == usr.party_leader && members > 5 && usr.key != null)
usr << "The party is full"
return
// -- NOTE: The Stat Panel below is Optional, but make's it easier to See how many people are in the Party
mob
Stat()
if(src.in_party == 1) // -- If the person is in a Party, it gives them the Stat Panel
statpanel("Party")
stat("Name:","")
for(var/mob/P in src.party)
stat(P) // -- Lists the Members of the Party
client
New()
..()
mob/players.Remove_Verbs() // -- Runs the Remove Verbs Proc (See above)
Del()
if(mob.in_party == 1 && mob.name != mob.party_leader) // -- When the person leaves the world
mob/players.Leave_Party_Proc() // -- it runs the 2 If statements below
if(mob.name == mob.party_leader)
mob/players.Leave_Party_Proc()
mob
var
tmp
party_leader
in_party = 0
party_count = 0
considering = 0
mob
var
tmp
list
party = list()
Problem description:
Party.dm:69:error:P:undefined var
Party.dm:71:error:M:undefined var
Party.dm:63:error:src.Update_Party:undefined proc
Party.dm:75:error:src.Leave_Party_Proc:undefined proc
Party.dm:108:error:usr.Update_Party:undefined proc
*pulls out the gun and gets ready to fire*
and as far as: