|
|
GSTNet ent_create problem
#426636
07/26/13 13:00
07/26/13 13:00
|
Joined: Jun 2012
Posts: 15
rotti
OP
Newbie
|
OP
Newbie
Joined: Jun 2012
Posts: 15
|
Hello Community I have been testing some things with GSTNet today. But now i have a problem. I wanted to create a global entity which every Client can see. I used GSTNet_ent_create. But only the Server can see the entity but the clients are connected! Please help! My Server code: #include <GSTNet.h> #include <acknex.h>
function main() { GSTNet_StartServer(2300, 1); while(GSTNet_Connection() == 0) { wait(1); } level_load("multiplayer6.wmb"); vec_set(camera.x, vector (-600, 0, 100)); wait(-0.5); GSTNet_ent_create(_str("redguard.mdl"),vector(-100,-50, 40),_str("NULL")); } My Client code: #include <GSTNet.h> #include <acknex.h>
function main() { GSTNet_StartClient(_str("127.0.0.1"), 2300, 1); while(GSTNet_Connection() == 0) { wait(1); } level_load("multiplayer6.wmb"); vec_set(camera.x, vector (-600, 0, 100)); }
|
|
|
Re: GSTNet ent_create problem
[Re: Ch40zzC0d3r]
#426643
07/26/13 13:47
07/26/13 13:47
|
Joined: Jun 2012
Posts: 15
rotti
OP
Newbie
|
OP
Newbie
Joined: Jun 2012
Posts: 15
|
ok thanks that worked #Edit another question: I want the entity to move globally but again it just moves locally! here is the code: #include <GSTNet.h> #include <acknex.h>
function create() { GSTNet_ent_create(_str("redguard.mdl"),vector(-100,-50, 40),_str("walk")); }
function main() { GSTNet_StartServer(2300, 1); while(GSTNet_Connection() == 0) { wait(1); } level_load("multiplayer6.wmb"); vec_set(camera.x, vector (-600, 0, 100)); on_x = create; } client: #include <GSTNet.h> #include <acknex.h>
action walk() { while(1) { my.pan += (key_cul-key_cur)*5*time_step;
var distance = (key_cuu-key_cud)*5*time_step; c_move(me, vector(distance,0,0), NULL, GLIDE); wait(1); } }
function main() { GSTNet_StartClient(_str("127.0.0.1"), 2300, 1); while(GSTNet_Connection() == 0) { wait(1); } level_load("multiplayer6.wmb"); vec_set(camera.x, vector (-600, 0, 100)); }
Last edited by rotti; 07/26/13 13:57.
|
|
|
|