Raised This Month: $32 Target: $400
 8% 

Solved [HELP] My created entity wont go.....remove doesnt work...pls help!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BANDIT228
Member
Join Date: Sep 2017
Old 07-16-2018 , 02:33   [HELP] My created entity wont go.....remove doesnt work...pls help!
Reply With Quote #1

https://pastebin.com/RB87V31E

hi there....hope u can help me cause i am going nuts...

@line100
i added a touch for the entity....it shall detect when the entity hits a player. IF so the player should be stunned.....the entity should dissapear and i want to spawn a explosion there.

explosion and stuff aint atm....

i am a bit confused with the touched and the toucher.....tried to identify them with client prints...
thing is when i reactive line 127 the game crashes 2 seconds after the touch........
i added a ISValid and the entity name........then it doesnt crash anymore but the entity wont dissapear...


can someone pls help here? why wont that stupid entity be gone? and if someone can help with a stun that would be awesome aswell.....

appreciate the help.

Last edited by BANDIT228; 07-16-2018 at 09:49.
BANDIT228 is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 07-16-2018 , 05:56   Re: [HELP] My created entity wont go.....remove doesnt work...pls help!
Reply With Quote #2

PHP Code:
register_touch("worldspawn""capsule_jar""@Touch_Jar"
should be

PHP Code:
register_touch("capsule_jar""*""@Touch_Jar"
also if you used FM_Touch then use it with capsule_jar too

PHP Code:
public @EntityTouch(ptr,ptd)   //toucher+touched
{
new 
classname[32]
   
pev(ptr,pev_classname,classname,31)
   
   
if ( 
equal(classname"capsule_jar") )
{
//Code here

__________________
My plugin:
Celena Luna is offline
BANDIT228
Member
Join Date: Sep 2017
Old 07-16-2018 , 06:07   Re: [HELP] My created entity wont go.....remove doesnt work...pls help!
Reply With Quote #3

thx and yeah that would solve problem number 3^^ i can add a pev sequence for that.

but what about the stun? what about the entity that wont dissapear when i tell her to?


the flying entitys are mafubaentity and mafubaentityphase2

when mafuba entity touches a player....that one should freeze. and then there should spawn the mafubaentityphase2 and that should go where i aim.....and when that hits the ground near a mafuba_jar entity something should happen....



i know its sure a bit complex if you dont get the background.
https://youtu.be/T7spJPq5DiY?t=175
that video should help.

mafuba jar is the little bottle. you can spawn that via rightclick. works perfectly. even can get destroyed. mafubaentity is the first beam that goes to a enemy.then the enemy should be stunned. some effects and stuff....then mafubaentityphase2 should spawn. entity1 is gone till that. and you aim phase2 entity to the bottle(mafuba jar). camera of the victim should be forced onto that entity.....

if anyone could help that would be awesome..cause that project really gotten to big.....but i want it to be done....for me...and for the community.

Last edited by BANDIT228; 07-16-2018 at 06:43.
BANDIT228 is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-16-2018 , 06:32   Re: [HELP] My created entity wont go.....remove doesnt work...pls help!
Reply With Quote #4

Last time i've seen people using @ before function name. Any meaning?
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
BANDIT228
Member
Join Date: Sep 2017
Old 07-16-2018 , 06:35   Re: [HELP] My created entity wont go.....remove doesnt work...pls help!
Reply With Quote #5

can i get some usefull replies pls?

and no it doesnt have any meaning...
BANDIT228 is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 07-16-2018 , 06:58   Re: [HELP] My created entity wont go.....remove doesnt work...pls help!
Reply With Quote #6

Quote:
Originally Posted by BANDIT228 View Post
can i get some usefull replies pls?

and no it doesnt have any meaning...
Hey, that rude. No one want to help a rude person :/

Anyway, I am not sure if "capsule_jar" or "mafuba" is the one you want to remove.
Also

PHP Code:
public @Touch_Jar(ptrptd//ptr is the entity ID & ptd is the player/object ID that touch 
P/S: How old is this kind of writing is? I have not since this kind of writing for a long time
__________________
My plugin:

Last edited by Celena Luna; 07-16-2018 at 06:59.
Celena Luna is offline
BANDIT228
Member
Join Date: Sep 2017
Old 07-16-2018 , 07:00   Re: [HELP] My created entity wont go.....remove doesnt work...pls help!
Reply With Quote #7

sorry^^ wasnt meant to offend anyone. thats why i placed the smiley;)
and it only aimed for the question about the @^^


i wanna remove mafuba. in line 128 of my code. and i would need to identify the one being hit to stun him.
i tried to clientprint ptr and ptd....but its quite confusion


i tried the line 130 till 140 with ptr and ptd.....both times it didnt dissapear.
so ptr would be normally correct and ptd would be the victim i wanna stun right?

Last edited by BANDIT228; 07-16-2018 at 07:04.
BANDIT228 is offline
Old 07-16-2018, 07:02
Ghosted
This message has been deleted by Ghosted.
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 07-16-2018 , 07:16   Re: [HELP] My created entity wont go.....remove doesnt work...pls help!
Reply With Quote #8

Quote:
Originally Posted by BANDIT228 View Post
i wanna remove mafuba. in line 128 of my code. and i would need to identify the one being hit to stun him.
i tried to clientprint ptr and ptd....but its quite confusion

i tried the line 130 till 140 with ptr and ptd.....both times it didnt dissapear.
so ptr would be normally correct and ptd would be the victim i wanna stun right?
You need to change the code

PHP Code:
public plugin_init()
{
    ...
    
register_forwardFM_Touch"@EntityTouch" );  
    ...
}

...

public @
EntityTouch(ptr,ptd)   //toucher+touched
{
    new 
classname[32]
   
    
pev(ptdr,pev_classname,classname,31)
   
   
    if ( 
equal(classname"mafuba") )
    {
       
        
phase2(ptd)
       
       
    }  
 
    return 
FMRES_HANDLED
}
 
phase2(ball)
{
   
    new 
Float:orig[3]
    
pev(ballpev_originorig)
   
   
    
//client_print(ball,print_chat,"jo");
    
set_task(2.0"removeEntity"ball);
}
 
public 
removeEntity(ptr,ptd)
{
    new 
classname[32]
   
    
pev(ptd,pev_classname,classname,31)
   
   
    if ( 
equal(classname"mafuba") && is_valid_ent(ptd) )
    {
        
remove_entity(ptd);
    }

=>

PHP Code:
public plugin_init()
{
    ...
    
register_touch("mafuba""*""Mafuba_Touch"); //This way, is will only run if the entity is "Mafuba"
    
...
}

...

public 
Mafuba_Touch(entid)
{
    if(!
pev_valid(ent))
        return
    if(!
is_user_alive(id)) //Check if the touched thing is a player or not
        
return

    if(
id == pev(entpev_owner)) //Prevent owner from touch it (Put yourself in your own trap is so silly)
        
return

    if(!
task_exists(ent+9999)) set_task(2.0"removeEntity"ent+9999); //Prevent from touching multiple time
}
 
public 
removeEntity(entremove_entity(ent-9999); //Shorten 
__________________
My plugin:

Last edited by Celena Luna; 07-16-2018 at 07:19.
Celena Luna is offline
BANDIT228
Member
Join Date: Sep 2017
Old 07-16-2018 , 07:18   Re: [HELP] My created entity wont go.....remove doesnt work...pls help!
Reply With Quote #9

o.O ok gonna try that

thx buddy!. gonna tell you later if it worked

in case that works....


i would need that the second entity...its name gonna be mafubaphase2

will detect if its hits the ground/wall or if it hits the ground/wall near 10meters of the entity mafuba_jar
so these two cases.....

can u help here aswell? sorry to bother..... but i am on this since weeks....and not as experienced as i should be>_>
you are already on my credit list;)

Last edited by BANDIT228; 07-16-2018 at 07:32.
BANDIT228 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-16-2018 , 07:37   Re: [HELP] My created entity wont go.....remove doesnt work...pls help!
Reply With Quote #10

Quote:
Originally Posted by Ghosted View Post
Last time i've seen people using @ before function name. Any meaning?
@ = at , its for readability, means its a forward.

OP :
Instead of removing the entitiy instantly give it a the flag FL_KILLME
No need to set task.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 07-16-2018 at 13:29.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode