Raised This Month: $ Target: $400
 0% 

Entity problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Apb hq
Senior Member
Join Date: Apr 2014
Old 07-09-2018 , 16:45   Entity problem
Reply With Quote #1

Hi i have an issue with this code i want that pb bullets can go through teammates i have tried with this but there is a bug sometimes you can’t kill your opponents the bullets go through ennemies also
PHP Code:
if( get_user_teamowner ) == get_user_teament ) )
    
set_peventpev_solidSOLID_NOT ); 
Here is my function
PHP Code:
public fw_touch(bulletent)
{
    new class[
20];
    
pev(bulletpev_classname, class, 19);
    if (!
equali(class, "pbBullet"))
        return 
FMRES_IGNORED;

    new 
Float:origin[3], class2[20], owner pev(bulletpev_owner), is_ent_alive is_user_alive(ent);
    
pev(entpev_classnameclass219);
    
pev(bulletpev_originorigin);

    if (
is_ent_alive)
    {
        if (
owner == ent || pev(entpev_takedamage) == DAMAGE_NO)
            return 
FMRES_IGNORED;
if( 
get_user_teamowner ) == get_user_teament ) )
    
set_peventpev_solidSOLID_NOT );
        if (
get_user_team(owner) == get_user_team(ent))
            if (!
get_pcvar_num(friendlyfire))
                return 
FMRES_IGNORED;

        
ExecuteHam(Ham_TakeDamageentownerownerfloat(get_pcvar_num(damge)), 4098);
    }

    if (!
equali(class, class2))
    {    
        
set_pev(bulletpev_velocityFloat:{0.00.00.0});
        
set_pev(bulletpev_classname"pbPaint");
        
set_pev(bulletpev_solid0);
        
set_pev(bulletpev_movetype0);
        
engfunc(EngFunc_SetModelbullet"sprites/paintball.spr");

        new 
afindpb 0;
        while (
a++ < g_pbcount && !findpb)
            if (
g_paintballs[a] == bullet)
                
findpb g_pbstatus[a] = 2;

        
remove_task(bullet);
        
remove_task(bullet+TASK_PB_RESET);

        if (
get_pcvar_num(sound))
        {
            static 
wav[20];
            
formatex(wav20is_ent_alive "player/pl_pain%d.wav" "misc/pb%d.wav"is_ent_alive random_num(4,7) : random_num(1,4));
            
emit_sound(bulletCHAN_AUTOwav1.0ATTN_NORM0PITCH_NORM);
        }

        new 
bool:valid_surface = (is_ent_alive || containi(class2"door") != -1) ? false true;
        if (
pev(entpev_health) && !is_ent_alive && pev(ent,pev_takedamage))
{
        
ExecuteHam(Ham_TakeDamageentownerownerfloat(pev(entpev_health)), 0);
        
valid_surface false;
}
        if (
valid_surface)
        {
            
paint_splat(bullet);
            
set_task(float(get_pcvar_num(blife)), "paint_reset"bullet+TASK_PB_RESET);
        }
        else
            
paint_reset(bullet+TASK_PB_RESET);

        return 
FMRES_HANDLED
    }

    return 
FMRES_IGNORED;

Apb hq is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 07-09-2018 , 17:53   Re: Entity problem
Reply With Quote #2

use SOLID_TRIGGER. It will execute Touch but will let the entity go through except wall.
__________________
My plugin:

Last edited by Celena Luna; 07-09-2018 at 17:54.
Celena Luna is offline
Apb hq
Senior Member
Join Date: Apr 2014
Old 07-10-2018 , 04:27   Re: Entity problem
Reply With Quote #3

Bro your code crashes my server

Code:
 FATAL ERROR (shutting down) : SV_ClipToLinks: Trigger in clipping list
Segmentation fault core dumped
Apb hq is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 07-10-2018 , 05:09   Re: Entity problem
Reply With Quote #4

I said using SOILD_TRIGGER when create the entity, not in that code
__________________
My plugin:
Celena Luna is offline
Apb hq
Senior Member
Join Date: Apr 2014
Old 07-10-2018 , 05:44   Re: Entity problem
Reply With Quote #5

You are amazing bro thanks a lot
Apb hq is offline
Apb hq
Senior Member
Join Date: Apr 2014
Old 07-12-2018 , 09:45   Re: Entity problem
Reply With Quote #6

I am sorry for double post but i have noticed a new bug , when the player has a bad connection and gets stuck we can’t kill him the entities just go through him just like for the teammates
Do you have any idea why is this happening

EDIT : Photos of stucked players

Spoiler

Last edited by Apb hq; 07-13-2018 at 06:09.
Apb hq is offline
Apb hq
Senior Member
Join Date: Apr 2014
Old 08-01-2018 , 05:55   Re: Entity problem
Reply With Quote #7

Has someone an idea how to fix the issue from the photos , can maybe is_user_stuck help ?
Apb hq is offline
Apb hq
Senior Member
Join Date: Apr 2014
Old 08-27-2018 , 04:19   Re: Entity problem
Reply With Quote #8

Bump
Apb hq is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 08-27-2018 , 04:21   Re: Entity problem
Reply With Quote #9

Quote:
Originally Posted by Apb hq View Post
Bump
https://forums.alliedmods.net/misc.php?do=showrules
__________________

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


Probably Left AM
Ghosted is offline
Reply



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 12:50.


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