Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 16,302 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
ANET entity problem #359793
02/19/11 16:36
02/19/11 16:36
Joined: Dec 2010
Posts: 63
C
Ceryni Offline OP
Junior Member
Ceryni  Offline OP
Junior Member
C

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?

Code:
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 Offline
Serious User
Dark_samurai  Offline
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] #359796
02/19/11 17:01
02/19/11 17:01
Joined: Dec 2010
Posts: 63
C
Ceryni Offline OP
Junior Member
Ceryni  Offline OP
Junior Member
C

Joined: Dec 2010
Posts: 63
Code:
function Schuss()
{	
	if(waffeready==1)
	{	
		switch(waffe)
		{
			case 1:  Pistole_Schiessen();
						break;
		}
		waffeready=0;
	}
}

function Pistole_Schiessen()
{	
	random_seed(0);
	temp_schuss.x = (screen_size.x / 2) + (random(5))-2; 
	temp_schuss.y = (screen_size.y / 2) + (random(5))-2;
	temp_schuss.z = 100000;
	vec_for_screen(temp_schuss,camera);
	c_trace(camera.x,temp_schuss,USE_POLYGON + IGNORE_ME + GET_HITVERTEX + ACTIVATE_SHOOT + IGNORE_PASSABLE );
	if(you!=NULL)
	{
		
	}
	else
	{
	enet_ent_create("media/Pics/schussloch.tga",target,"set_Schussloch");
	return; 
	}
}



Last edited by Ceryni; 02/19/11 17:01.
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 Offline
Serious User
Dark_samurai  Offline
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
C
Ceryni Offline OP
Junior Member
Ceryni  Offline OP
Junior Member
C

Joined: Dec 2010
Posts: 63
k thx

Re: ANET entity problem [Re: Ceryni] #359895
02/20/11 07:32
02/20/11 07:32
Joined: Dec 2010
Posts: 63
C
Ceryni Offline OP
Junior Member
Ceryni  Offline OP
Junior Member
C

Joined: Dec 2010
Posts: 63
How can i send an array in a event?
because the return type is always STRING*?

Re: ANET entity problem [Re: Ceryni] #359900
02/20/11 09:10
02/20/11 09:10
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
We discussed that in this thread: http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=351490&page=1

But it's also explained in the manual under enet_sv/clsend_event().


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] #359902
02/20/11 09:13
02/20/11 09:13
Joined: Dec 2010
Posts: 63
C
Ceryni Offline OP
Junior Member
Ceryni  Offline OP
Junior Member
C

Joined: Dec 2010
Posts: 63
sry in my manual the is use_data(...);

Last edited by Ceryni; 02/20/11 09:17.

Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1