Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2015-02-26 15:51:06, last edited by Xfrogman43 (2015-02-27 00:06:08)

Xfrogman43
Member
From: need to find a new home
Joined: 2015-02-15
Posts: 4,174

"say" error

Lock, fixed.


zsbu6Xm.png thanks zoey aaaaaaaaaaaand thanks latif for the avatar

Offline

#2 2015-02-26 16:11:34, last edited by ZeldaXD (2015-02-26 16:12:49)

ZeldaXD
EE Homeboy
From: Cyprus
Joined: 2015-02-15
Posts: 1,539
Website

Re: "say" error

Try: players[m.GetInt(0)].name.ToUpper()

Also, error seems most likely that the ID wasn't found in "players".


gLjTZE1.png

Offline

#3 2015-02-26 16:13:20, last edited by Xfrogman43 (2015-02-26 16:17:11)

Xfrogman43
Member
From: need to find a new home
Joined: 2015-02-15
Posts: 4,174

Re: "say" error

It's already a int,string so I don't have .name
Edited first post


zsbu6Xm.png thanks zoey aaaaaaaaaaaand thanks latif for the avatar

Offline

#4 2015-02-26 16:18:36

TiKen
Member
Joined: 2015-02-24
Posts: 298

Re: "say" error

It means the player was in game, but not present in you Dictionary "players". So you now have to figure out why

Offline

#5 2015-02-26 16:21:02

Xfrogman43
Member
From: need to find a new home
Joined: 2015-02-15
Posts: 4,174

Re: "say" error

Shouldn't it be adding them in "add"?


zsbu6Xm.png thanks zoey aaaaaaaaaaaand thanks latif for the avatar

Offline

#6 2015-02-26 16:38:51

Koya
Fabulous Member
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,310

Re: "say" error

This is an EEPhysics error, I had the same error with add


Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

#7 2015-02-26 16:43:17, last edited by Xfrogman43 (2015-02-26 16:43:35)

Xfrogman43
Member
From: need to find a new home
Joined: 2015-02-15
Posts: 4,174

Re: "say" error

Will it be fixed?


zsbu6Xm.png thanks zoey aaaaaaaaaaaand thanks latif for the avatar

Offline

#8 2015-02-26 17:45:46

Koya
Fabulous Member
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,310

Re: "say" error


Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

#9 2015-02-26 18:10:15

Xfrogman43
Member
From: need to find a new home
Joined: 2015-02-15
Posts: 4,174

Re: "say" error

Ok then what do I do to fix the issue?


zsbu6Xm.png thanks zoey aaaaaaaaaaaand thanks latif for the avatar

Offline

#10 2015-02-26 18:55:48, last edited by ewoke (2015-02-26 19:11:02)

ewoke
Member
Joined: 2015-02-20
Posts: 412

Re: "say" error

it might be calling "say" earlier that the "add" message.

edit, copied your code, worked fine for me.
are you sure that you sent init2 after the initialisation has been done?


if you can read this....good for you

Offline

#11 2015-02-26 21:23:39, last edited by Xfrogman43 (2015-02-26 21:26:48)

Xfrogman43
Member
From: need to find a new home
Joined: 2015-02-15
Posts: 4,174

Re: "say" error

Yes I do

case "init":
{
conn.Send("init2");
}

Edit: Edited 1st post


zsbu6Xm.png thanks zoey aaaaaaaaaaaand thanks latif for the avatar

Offline

#12 2015-02-26 22:51:37

912468
Member
Joined: 2015-02-21
Posts: 212
Website

Re: "say" error

I'm not sure if it has something to do with the error or that I'm right (I don't use switches very often), but I think you shouldn't add the braces {} (Please correct me if I'm wrong...). I think your switch needs to look like this:

switch(m.Type)
{
    case "init":
        con.Send("init2");
        break;
    case "add":
        players.Add(m.GetInt(0), m.GetString(1));
        break;
    // More Code
}

vF0MA5o.png

Offline

#13 2015-02-26 23:08:04

Xfrogman43
Member
From: need to find a new home
Joined: 2015-02-15
Posts: 4,174

Re: "say" error

912468 wrote:

I'm not sure if it has something to do with the error or that I'm right (I don't use switches very often), but I think you shouldn't add the braces {} (Please correct me if I'm wrong...). I think your switch needs to look like this:

switch(m.Type)
{
    case "init":
        con.Send("init2");
        break;
    case "add":
        players.Add(m.GetInt(0), m.GetString(1));
        break;
    // More Code
}

It's the same thing, just looks neater to me.


zsbu6Xm.png thanks zoey aaaaaaaaaaaand thanks latif for the avatar

Offline

#14 2015-02-27 00:32:27

ewoke
Member
Joined: 2015-02-20
Posts: 412

Re: "say" error

Its fixed


if you can read this....good for you

Offline

#15 2015-02-27 01:31:18

ZeldaXD
EE Homeboy
From: Cyprus
Joined: 2015-02-15
Posts: 1,539
Website

Re: "say" error

Xfrogman43 wrote:
912468 wrote:

I'm not sure if it has something to do with the error or that I'm right (I don't use switches very often), but I think you shouldn't add the braces {} (Please correct me if I'm wrong...). I think your switch needs to look like this:

switch(m.Type)
{
    case "init":
        con.Send("init2");
        break;
    case "add":
        players.Add(m.GetInt(0), m.GetString(1));
        break;
    // More Code
}

It's the same thing, just looks neater to me.

It isn't the same thing, i'll give you an example:

switch (arg[0]){ 
        case "hi":
        Player p = players[id];
        say(p.name + ": hi!");
        break;

        case "bye":
        Player p = players[id]; // This will trigger error because "p" is alredy declared, when using brackets it wont trigger error.
        say(p.name + ": bye!");
        break;
}

gLjTZE1.png

Offline

#16 2015-02-27 01:33:50

Xfrogman43
Member
From: need to find a new home
Joined: 2015-02-15
Posts: 4,174

Re: "say" error

ZeldaXD wrote:
Xfrogman43 wrote:
912468 wrote:

I'm not sure if it has something to do with the error or that I'm right (I don't use switches very often), but I think you shouldn't add the braces {} (Please correct me if I'm wrong...). I think your switch needs to look like this:

switch(m.Type)
{
    case "init":
        con.Send("init2");
        break;
    case "add":
        players.Add(m.GetInt(0), m.GetString(1));
        break;
    // More Code
}

It's the same thing, just looks neater to me.

It isn't the same thing, i'll give you an example:

switch (arg[0]){ 
        case "hi":
        Player p = players[id];
        say(p.name + ": hi!");
        break;

        case "bye":
        Player p = players[id]; // This will trigger error because "p" is alredy declared, when using brackets it wont trigger error.
        say(p.name + ": bye!");
        break;
}

Thanks for clarification.


zsbu6Xm.png thanks zoey aaaaaaaaaaaand thanks latif for the avatar

Offline

#17 2015-02-27 10:25:22

Different55
Forum Admin
Joined: 2015-02-07
Posts: 16,574

Re: "say" error

locked on request of owner.


"Sometimes failing a leap of faith is better than inching forward"
- ShinsukeIto

Offline

Different551425029122477220

Board footer

Powered by FluxBB

[ Started around 1715001820.3523 - Generated in 0.045 seconds, 12 queries executed - Memory usage: 1.55 MiB (Peak: 1.73 MiB) ]