If help

If help

Postby HETAL » 20 Dec 2013, 17:47

Code: Select all
using System.IO;
namespace MCDzienny
{
      public class PlayerJoinHandler : Command
        {
            public override void Init()
           {
      }
          public override void Use(Player p, string message)
      {
                Player.Joined+=
              if (!p.ExtraData.ContainsKey("agree"))
             {
            e.Player.frozen = true;
            e.Player.muted = true;
            Player.SendMessage(e.Player, "Read over the rules and type /agree to agree to them or /disagree to disagree to them.");
            Command.all.Find("rules").Use(e.Player, "");
            }
         else
         {
         e.Player.frozen = false;
            e.Player.muted = false;
           };
      }   
   }   
}

The error is /home/user/MCDzienny/MCDzienny/handler.cs(24,24): Error CS1525: Unexpected symbol `if' (CS1525) (MCDzienny)
This is for a future /agree and /disagree command based on PlayerExtraData
YOU HAVENT SEEN THE LAST OF ME ISMELLIKE
HETAL
 
Posts: 397
Joined: 24 May 2013, 12:10

Re: If help

Postby joppiesaus » 18 Jan 2014, 14:25

you forgot afte Player.Joined += the "{" character, so if you add that, it'll be fixed I think.
joppiesaus
 
Posts: 379
Joined: 20 Aug 2012, 07:28
Location: in a obsedian house, with glass in it so i can see the lava!

Re: If help

Postby Leeizazombie » 18 Jan 2014, 15:22

Or just use
Code: Select all
public override void Init()
        {
                Player.Joined += (object sender, PlayerEventArgs e) =>
                {
                 
                };
            }
Owner of:
LeeIzaZombie Freebuild and Lava Survival V2 (Shut Down and updated)
LeeIzaZombie Survival (Comming back soon)

Contact:
Skype: leeizazombie
IRC: irc.geekshed.net, #leeizazombie, #mcclassichosting
User avatar
Leeizazombie
 
Posts: 536
Joined: 10 Jun 2013, 17:45
Location: Ireland.


Return to Help in Coding

Who is online

Users browsing this forum: No registered users and 3 guests

cron