Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,549 guests, and 14 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
why does it say crash in....., when i use ent_remove(me)? #317477
03/31/10 20:53
03/31/10 20:53
Joined: Nov 2008
Posts: 196
the wrong place
Muhsin Offline OP
Member
Muhsin  Offline OP
Member

Joined: Nov 2008
Posts: 196
the wrong place
Hi!

why does it say crash in mace2_pickup, when i use ent_remove(me) in this action?:
----------------------------------------------------------------
action mace2_pickup()
{
my = me;

while(1)
{
if(vec_dist(my.x, player.x) < 50 && player.HEALTH > 0)
{
if(key_e && player.weapon_on == 0)
{
ent_create("mace2.mdl", vector(player.x, player.y, player.z), mace2_equiped);

player.weapon_on = 1;

ent_remove(me);
}

}


wait(1);
}
}
-------------------------------------------------------------

thanks!!!


- Muhsin Kaymak


Come and play my new browsergame - Valley Of Wolves:

http://www.mafiacreator.com/ValleyOfWolves

Hurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it!
And be the most feared MafiaBoss in the World!!
Re: why does it say crash in....., when i use ent_remove(me)? [Re: Muhsin] #317481
03/31/10 21:18
03/31/10 21:18
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
put a return after the ent_remove or set while(me) and not while(1)

Re: why does it say crash in....., when i use ent_remove(me)? [Re: Muhsin] #317482
03/31/10 21:18
03/31/10 21:18
Joined: Jul 2007
Posts: 619
Turkey, Izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 619
Turkey, Izmir
You can not remove the entity that way.
Try this;
Code:
action mace2_pickup()
{
	while(1)
	{
		if(vec_dist(my.x, player.x) < 50 && player.HEALTH > 0)
		{
			if(key_e && player.weapon_on == 0)
			{
				ent_create("mace2.mdl", vector(player.x, player.y, player.z), mace2_equiped);
				player.weapon_on = 1;
				break;
			}
		}
		wait(1);
	}
	ent_remove(me);
}



Re: why does it say crash in....., when i use ent_remove(me)? [Re: Emre] #317483
03/31/10 21:20
03/31/10 21:20
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
this is also possible

Code:
action mace2_pickup()
{
my = me;

while(me)
{
if(vec_dist(my.x, player.x) < 50 && player.HEALTH > 0)
{
if(key_e && player.weapon_on == 0)
{
ent_create("mace2.mdl", vector(player.x, player.y, player.z), mace2_equiped);

player.weapon_on = 1;

ent_remove(me);
}
}
wait(1);
}
}




Visit my site: www.masterq32.de
Re: why does it say crash in....., when i use ent_remove(me)? [Re: MasterQ32] #317493
03/31/10 21:55
03/31/10 21:55
Joined: Nov 2008
Posts: 196
the wrong place
Muhsin Offline OP
Member
Muhsin  Offline OP
Member

Joined: Nov 2008
Posts: 196
the wrong place
thank you all for your helpes!!!

I changed while(1) to while(me) and it worked!


thanks again!!!


- Muhsin Kaymak


Come and play my new browsergame - Valley Of Wolves:

http://www.mafiacreator.com/ValleyOfWolves

Hurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it!
And be the most feared MafiaBoss in the World!!

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | 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