Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / db multiplayer question

Author
Message
Gravekeeper
21
Years of Service
User Offline
Joined: 12th Nov 2002
Location:
Posted: 12th Nov 2002 21:12
This code should send a message, but it dosn't. I know that the players are connected because I can see their names.
What's wrong with it?

DO

if net message exists()
get net message
mtype = net message type()

if mtype=3
m$ = net message string$()
endif
endif

text 10,50,m$

if keystate(50)=1 then EnterMessage=1
if EnterMessage=1 then gosub EnterMessage

LOOP

EnterMessage:

if keystate(14)
if len(text$) > 0 then text$ = left$(text$,len(text$)-1)
cls
else

if returnkey()
EnterMessage=0
cls
text 10,10,text$
send net message string 0,text$
else

oldkey$ = newkey$
newkey$ = inkey$()

if newkey$ oldkey$ then text$ = text$ + newkey$
text 10,30,text$

endif
endif
return
Gravekeeper
21
Years of Service
User Offline
Joined: 12th Nov 2002
Location:
Posted: 13th Nov 2002 00:17
Anyone? If you can't tell me what's wrong maybe you could post some simple code that works.

Gravekeeper
21
Years of Service
User Offline
Joined: 12th Nov 2002
Location:
Posted: 13th Nov 2002 00:25
Just noticed there are a couple of things missing in there (<> signs near last line). That's not part of the problem. They're not missing in my code.

The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 13th Nov 2002 00:30
You might want to try using different names for the EnterMessage variable and subroutine, otherwise it might get confused. That's only a suggestion, I haven't worked with multiplayer commands.
Gravekeeper
21
Years of Service
User Offline
Joined: 12th Nov 2002
Location:
Posted: 13th Nov 2002 01:08
Yeah, I didn't mean to make them the same. It seems to work fine for entering the message. It just dosn't send/recieve them for some reason.

Someone must be able to help or at least have some simple code for sending a message.

Login to post a reply

Server time is: 2024-04-18 09:49:04
Your offset time is: 2024-04-18 09:49:04