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

Sentry gun edit - CreateEntityByName("dronegun");


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
supertimor
AlliedModders Donor
Join Date: Sep 2017
Old 07-05-2019 , 05:28   Sentry gun edit - CreateEntityByName("dronegun");
Reply With Quote #1

Hello,
I tried many times with no result, found some topics here but no one knows how to did it - so i am asking now, maybe some1 got an answer

How to make dronegun not to even aim on teammates of owner? I know there's solution to detect if someone's team is equal to our, and make us owner's of dronegun, but in my case i need something different. I can't switch owner.

Another question, if someone got how to change HP amount of dronegun? Tried with SetEntProp(ent, Prop_Data, "m_iHealth", x);, but its not working.

Thanks in advance for any informations.
supertimor is offline
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 07-05-2019 , 08:36   Re: Sentry gun edit - CreateEntityByName("dronegun");
Reply With Quote #2

Quote:
Originally Posted by supertimor View Post
SetEntProp(ent, Prop_Data, "m_iHealth", x);
Prop_Send *

If it still doesn't work try with SetEntityHealth() ;
__________________
kratoss1812 is offline
supertimor
AlliedModders Donor
Join Date: Sep 2017
Old 07-05-2019 , 15:14   Re: Sentry gun edit - CreateEntityByName("dronegun");
Reply With Quote #3

Oh.. SetEntityHealth works fine. I've tried it before, but not with 500 or 600hp, just sth like 1000 or more, because i tested it now, and you can set it max to 998. 999 and more makes dronegun invincible.
Thanks for this tip!

Also i am still looking for answer for my first question, i'll be really grateful if someone got it!
supertimor is offline
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 07-07-2019 , 07:49   Re: Sentry gun edit - CreateEntityByName("dronegun");
Reply With Quote #4

Quote:
Originally Posted by supertimor View Post
Oh.. SetEntityHealth works fine. I've tried it before, but not with 500 or 600hp, just sth like 1000 or more, because i tested it now, and you can set it max to 998. 999 and more makes dronegun invincible.
Thanks for this tip!

Also i am still looking for answer for my first question, i'll be really grateful if someone got it!

PHP Code:
#define PLUGIN_AUTHOR "kRatoss"
#define PLUGIN_VERSION "1.00"

#include <sourcemod>
#include <sdkhooks>
#include <sdktools>

#pragma newdecls required

int iSentry[MAXPLAYERS 1];

public 
Plugin myinfo 
{
    
name "Idk",
    
author PLUGIN_AUTHOR,
    
description "",
    
version PLUGIN_VERSION,
    
url ""
};

public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_sentry"SpawnSentry);
}

public 
Action SpawnSentry(int Clientint Args)
{
    
iSentry[Client] = CreateEntityByName("point_dz_dronegun");
    
float origin[3];
    
GetClientAbsOrigin(Clientorigin);
    
    
TeleportEntity(iSentry[Client], originNULL_VECTORNULL_VECTOR);
    
ActivateEntity(iSentry[Client]);
    
    
SDKHookEx(ClientSDKHook_OnTakeDamageOnTakeDamage);
}

public 
Action OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetype
{
    for(
int Id 0Id MaxClientsId++){
        if(
attacker == iSentry[Id])
        {
            if(
GetClientTeam(Id) == GetClientTeam(victim))
            {
                return 
Plugin_Stop;
            }
        }
    }
    
    return 
Plugin_Continue

__________________
kratoss1812 is offline
supertimor
AlliedModders Donor
Join Date: Sep 2017
Old 07-09-2019 , 12:16   Re: Sentry gun edit - CreateEntityByName("dronegun");
Reply With Quote #5

This plugin is not working. Sentry is not spawning.
supertimor is offline
FroGeX
Senior Member
Join Date: Aug 2020
Old 01-24-2021 , 02:41   Re: Sentry gun edit - CreateEntityByName("dronegun");
Reply With Quote #6

Quote:
Originally Posted by supertimor View Post
This plugin is not working. Sentry is not spawning.
You must call 'spawn' input on all point_ type entities.
FroGeX 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 03:05.


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