|
2 registered members (TipmyPip, AndrewAMD),
5,134
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
client_id not work
#407773
09/19/12 09:50
09/19/12 09:50
|
Joined: Jul 2011
Posts: 55 Berlin, Germany
Sammy32
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2011
Posts: 55
Berlin, Germany
|
Hello @ all
i have a little bit problem.
my.client_id == dplay_id
not work,
result as server from client_id = 0.677 and dplay_id = 0 result as client client_id = 0.677 and dplay_id = 142011.078
version a8.40 com
I need a query to have different objects at the clients for my first person shooter (weapon and body).
thx for the help and best regards
- 3d Gamestudio Commercial - - ANET Pro - <JAVA | PHP | HTML | Flash > DEVELOPER
|
|
|
Re: client_id not work
[Re: Ch40zzC0d3r]
#407776
09/19/12 10:33
09/19/12 10:33
|
Joined: Jul 2011
Posts: 55 Berlin, Germany
Sammy32
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2011
Posts: 55
Berlin, Germany
|
hi,
if I could I would use anet i can use this:
enet_get_clientid() == enet_ent_creator(enet_ent_globpointer(my)
true, but i must pay for this ,-) and i think about it, if I'll buy it.
but, gamestudio have also a multiplayer part and i think it must be work with this " if ((my.client_id == dplay_id) ) " ?
the results come with my debug code con_writeNum(dplay_id); con_writeNum(my.client_id); this code use from my player action.
but in the future i must buy this, i think so, my game need more player ,-)
best regards
- 3d Gamestudio Commercial - - ANET Pro - <JAVA | PHP | HTML | Flash > DEVELOPER
|
|
|
Re: client_id not work
[Re: Sammy32]
#407779
09/19/12 11:06
09/19/12 11:06
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
client_id and dplay_id work fine, I've used them many times without a problem. Check out my following test code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////
void object()
{
while(my.client_id < 0) wait(1);
while(1)
{
VECTOR temp,col;
if(dplay_id == my.client_id) vec_set(col,COLOR_GREEN);
else vec_set(col,COLOR_RED);
vec_set(temp,my.x);
vec_to_screen(temp,camera);
draw_text(str_for_num(NULL,my.client_id),temp.x,temp.y,col);
wait(1);
}
}
void main()
{
fps_max = 60;
dplay_timeout = 80;
dplay_localfunction = 2;
while(!key_1 && !key_2) wait(1);
if(key_1) session_open("mplayer");
else session_connect("mplayer",NULL);
while(dplay_status < 2) wait(1);
level_load(NULL);
while(dplay_status < 6) wait(1);
if(connection == 2) ent_create(CUBE_MDL,vector(100,30,0),object);
else ent_create(SPHERE_MDL,vector(100,-30,0),object);
while(1)
{
draw_text(str_for_num(NULL,dplay_id),20,20,COLOR_WHITE);
wait(1);
}
}
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: client_id not work
[Re: Superku]
#407819
09/19/12 17:36
09/19/12 17:36
|
Joined: Jul 2011
Posts: 55 Berlin, Germany
Sammy32
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2011
Posts: 55
Berlin, Germany
|
thank you so mutch Superku, for your answer.
i must try this.
best regards
- 3d Gamestudio Commercial - - ANET Pro - <JAVA | PHP | HTML | Flash > DEVELOPER
|
|
|
|