Get host ip:
rem get external ip address
Multiplayer Create TCP Server "yeye"
ipaddress$=MULTIPLAYER GET IP ADDRESS()
for a=1 to len(ipaddress$)
if mid$(ipaddress$,a)=":" then ipaddress$=left$(ipaddress$,a-1) : exit
next c
Multiplayer disconnect
rem get local ip address :
localipaddress$=MULTIPLAYER GET IP ADDRESS()
for a=1 to len(localipaddress$)
if mid$(localipaddress$,a)=":" then localipaddress$=left$(localipaddress$,a-1) : exit
next a
join a server
MULTIPLAYER CONNECT TO TCP SERVER "myname",theipaddress$
check for connect
if MULTIPLAYER GET CONNECTION()=0
multiplayer disconnect
end
endif
get info on how many players, names and id
dwid as dword
players=MULTIPLAYER GET PLAYER COUNT()
for i=0 to players
navn$=MULTIPLAYER GET PLAYER NAME(i)
dwid=MULTIPLAYER GET PLAYER ID(i)
text 10,30,hoster$
text 10,45+i*15,navn$+" ID: "+strs{dwid]
next i
check for messages
dwsentmsg as dword
if MULTIPLAYER MESSAGE EXISTS()=1
Multiplayer get message
dwsentmsg = MULTIPLAYER GET MESSAGE PLAYER FROM() :rem id of sender
IF MULTIPLAYER GET MESSAGE TYPE ()=2
messy$=MULTIPLAYER GET MESSAGE STRING()
endif
endif
send message to 1 player
MULTIPLAYER SEND MESSAGE TO dwtargetplayerid
MULTIPLAYER SEND MESSAGE STRING "header"+message$
send message to all
MULTIPLAYER SEND MESSAGE TO 0
MULTIPLAYER SEND MESSAGE STRING "header"+message$
rem MULTIPLAYER SEND MESSAGE STRING "header"+message$,0 also worked
hope this helps...