1 registered members (TipmyPip),
18,633
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
ANET entity problem
#359793
02/19/11 16:36
02/19/11 16:36
|
Joined: Dec 2010
Posts: 63
Ceryni
OP
Junior Member
|
OP
Junior Member
Joined: Dec 2010
Posts: 63
|
hi, i want to create some holes on the walls when u shoot but when more than one player is on the server u cant see your own holes just the ones of the other players,it apears for one second an dthen its invisible for you, any idea?
function set_Schussloch()
{
set(my,TRANSLUCENT);
my.alpha=80;
set(my,PASSABLE);
vec_to_angle(my.pan,normal);
c_move(me,vector(0.2,0,0),nullvector,GLIDE);
my.roll = random(360);
my.scale_x=0.2;
my.scale_y=0.2;
my.scale_z=0.2;
my.pan += 0.01;
my.tilt+= 0.01;
my.roll+= 0.01;
while(enet_ent_globpointer(my) == ANET_ERROR)
{
wait(1);
}
enet_send_flags(enet_ent_globpointer(my), 1,8,BROADCAST);
enet_send_angle(enet_ent_globpointer(my),BROADCAST,0);
enet_send_pos(enet_ent_globpointer(my),BROADCAST,0);
wait(Schusslochdauer);
while(my.alpha>0)
{
my.alpha-=0.2;
wait(1);
}
enet_ent_remove(enet_ent_globpointer(my));
}
|
|
|
Re: ANET entity problem
[Re: Ceryni]
#359794
02/19/11 16:50
02/19/11 16:50
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
I miss the part where the bullet hole is created through enet_ent_create(). Please also post it.
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: ANET entity problem
[Re: Ceryni]
#359797
02/19/11 17:15
02/19/11 17:15
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
The function set_Schussloch() is called on every client and on the server. --> The code in your function makes no sence, because every client will send the current position of the bullet hole. Also removing will cause problems. The client that was the fastest, will delete the bullet hole. The other clients are still in the waiting phase and when they want to delete the bullet hole, the pointer is already invalid --> Error!
This is how I would do it: Create the bullethole local by using an event. You pass the position where the bullethole should be created through the msg parameter of the event and in the event function you use a normal ent_create() to create the bullet hole.
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: ANET entity problem
[Re: Ceryni]
#359798
02/19/11 17:19
02/19/11 17:19
|
Joined: Dec 2010
Posts: 63
Ceryni
OP
Junior Member
|
OP
Junior Member
Joined: Dec 2010
Posts: 63
|
|
|
|
Re: ANET entity problem
[Re: Ceryni]
#359902
02/20/11 09:13
02/20/11 09:13
|
Joined: Dec 2010
Posts: 63
Ceryni
OP
Junior Member
|
OP
Junior Member
Joined: Dec 2010
Posts: 63
|
sry in my manual the is use_data(...);
Last edited by Ceryni; 02/20/11 09:17.
|
|
|
|