Купить

 

multiplayer client demo

sync on
sync rate 0
set window on
perform checklist for net connections
sleep 1000
o = checklist quantity()
for i=0 to o-1
print checklist string$(o)
sleep 1000
next i
sleep 1000
input "What type of net connection do you want? ",nc
set net connection nc
sleep 1000
perform checklist for net sessions
q = checklist quantity()
for w=0 to q-1
print checklist string$(q)
sleep 1000
next w
input "Join what session number? ",jgn
input "Playername? ",pn$
join net game jgn,pn$
cls
do
npc = 1
if inkey$() = "p"
cls
endif
if inkey$() = "q"
set cursor 5,420
input "Command: ",cmd$
if cmd$ = "send string"
input "text to send: ",tts$
send net message string nvc,tts$
endif
if cmd$ = "send integer"
input "value to send: ",tvs
send net message integer nvc,tvs
endif
if cmd$ = "send float"
input "value to send: (using .) ",fts#
send net message float npc,fts#
endif
if cmd$ = "get message"
get net message
if net message exists() = 1
if net message type() = 3
print "STRING: ";
print net message string$()
endif
if net message type() = 2
print "FLOAT: ";
print net message float()
endif
if net message type() = 1
print "INTEGER: ";
print net message integer()
endif
endif
endif
endif
get net message
if net message exists() = 1

` message types
` 1 = integer
` 2 = float
` 3 = string
` 4 = memblock
if net message type() = 3
print "STRING: ";
print net message string$()
endif
if net message type() = 2
print "FLOAT: ";
print net message float()
endif
if net message type() = 1
print "INTEGER: ";
print net message integer()
endif
` i'll add memblocks soon :)
endif
sync
loop

Hosted by uCoz