0 registered members (),
1,549
guests, and 14
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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
OP
Member
|
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/ValleyOfWolvesHurry 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]
#317482
03/31/10 21:18
03/31/10 21:18
|
Joined: Jul 2007
Posts: 619 Turkey, Izmir
Emre
User
|
User
Joined: Jul 2007
Posts: 619
Turkey, Izmir
|
You can not remove the entity that way. Try this;
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
Expert
|
Expert
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
|
this is also possible
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);
}
}
|
|
|
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
OP
Member
|
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/ValleyOfWolvesHurry 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!!
|
|
|
|