Raised This Month: $7 Target: $400
 1% 

CSGO Spawn DroneGun any map


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
e54385991
AlliedModders Donor
Join Date: Aug 2013
Old 12-08-2018 , 04:16   CSGO Spawn DroneGun any map
Reply With Quote #1

PHP Code:
#pragma semicolon  1
#include <sourcemod>
#include <sdktools>

int g_offsCollisionGroup;

public 
void OnPluginStart()
{
    
g_offsCollisionGroup FindSendPropInfo("CBaseEntity""m_CollisionGroup");
    
RegAdminCmd("sm_spawn_dg",        CMD_SpawnDroneGun,    ADMFLAG_BAN);
}

public 
void OnMapStart()
{
    
int precache PrecacheModel("models/props_survival/dronegun/dronegun.mdl"true);
    if (
precache == 0) {
        
SetFailState("models/props_survival/dronegun/dronegun.mdl not precached !");
    }
    
    
PrecacheModel("models/props_survival/dronegun/dronegun_gib1.mdl"true);
    
PrecacheModel("models/props_survival/dronegun/dronegun_gib2.mdl"true);
    
PrecacheModel("models/props_survival/dronegun/dronegun_gib3.mdl"true);
    
PrecacheModel("models/props_survival/dronegun/dronegun_gib4.mdl"true);
    
PrecacheModel("models/props_survival/dronegun/dronegun_gib5.mdl"true);
    
PrecacheModel("models/props_survival/dronegun/dronegun_gib6.mdl"true);
    
PrecacheModel("models/props_survival/dronegun/dronegun_gib7.mdl"true);
    
PrecacheModel("models/props_survival/dronegun/dronegun_gib8.mdl"true);
    
    
PrecacheSound("sound/survival/turret_death_01.wav"true);
    
PrecacheSound("sound/survival/turret_idle_01.wav"true);
    
    
PrecacheSound("sound/survival/turret_takesdamage_01.wav"true);
    
PrecacheSound("sound/survival/turret_takesdamage_02.wav"true);
    
PrecacheSound("sound/survival/turret_takesdamage_03.wav"true);
    
    
PrecacheSound("sound/survival/turret_lostplayer_01.wav"true);
    
PrecacheSound("sound/survival/turret_lostplayer_02.wav"true);
    
PrecacheSound("sound/survival/turret_lostplayer_03.wav"true);
    
    
PrecacheSound("sound/survival/turret_sawplayer_01.wav"true);
}

public 
Action CMD_SpawnDroneGun(int clientint args)
{
    if(!
IsClientInGame(client))
    {
        return 
Plugin_Handled;
    }
    
    
float vec[2][3];
    
GetClientEyePosition(clientvec[0]);
    
GetClientEyeAngles(clientvec[1]);
    
    
Handle trace TR_TraceRayFilterEx(vec[0], vec[1], MASK_SOLIDRayType_InfiniteFilter_ExcludePlayers);
    if(!
TR_DidHit(trace))
    {
        
delete trace;
        return 
Plugin_Handled;
    }
    
TR_GetEndPosition(vec[0], trace);
    
delete (trace);
    
    
int dronegun CreateEntityByName("dronegun");
    if(
dronegun == -|| !IsValidEntity(dronegun))
    {
        
//PrintToServer("dronegun %d",dronegun);
        
return Plugin_Handled;
    }
    
    
//PrintToServer("A dronegun %d",dronegun);
    
    
    
vec[0][2] = vec[0][2] + 16.0;
    
    
    
SetEntData(dronegung_offsCollisionGroup24true); // no Collision
    
SetEntPropEnt(dronegunProp_Send"m_hOwnerEntity"client); // owner.
    //SetEntPropEnt(dronegun, Prop_Send, "m_iTeamNum", 2); //Team 2= CT 1 = T 0 = any [default 0]
    
    
TeleportEntity(dronegunvec[0], NULL_VECTORNULL_VECTOR);
    
DispatchSpawn(dronegun);
    
    
    return 
Plugin_Handled;
}
//-----FILTERS-----//
public bool Filter_ExcludePlayers(int entityint contentsMaskany data)
{
    return !((
entity 0) && (entity <= MaxClients));


Last edited by e54385991; 12-18-2018 at 13:21.
e54385991 is offline
Send a message via ICQ to e54385991
Bara
AlliedModders Donor
Join Date: Apr 2012
Location: Germany
Old 12-08-2018 , 04:17   Re: CSGO Spawn DroneGun any map
Reply With Quote #2

netprops for CDroneGun https://pastebin.com/K8k3QUQ8
__________________
Discord (Bara#5006) | My Plugins (GitHub)
You like my work? Support is not a crime.
Bara is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 12-08-2018 , 05:11   Re: CSGO Spawn DroneGun any map
Reply With Quote #3

I bet you can use SetEntPropEnt(dronegun, Prop_Send, "m_hOwnerEntity", client); to prevent you from being targted, but I don't think you can make it ignore a team. But aslong their AI acts like a popato they are kinda useless ^^
__________________
zipcore is offline
Bara
AlliedModders Donor
Join Date: Apr 2012
Location: Germany
Old 12-08-2018 , 06:07   Re: CSGO Spawn DroneGun any map
Reply With Quote #4

Quote:
Originally Posted by zipcore View Post
I bet you can use SetEntPropEnt(dronegun, Prop_Send, "m_hOwnerEntity", client); to prevent you from being targted, but I don't think you can make it ignore a team.
Correct and as owner of the dronegun you can't shoot at it.

Weapon Name in player_hurt is envgunfire and the classname with GetEntityClassname is env_gunfire.
__________________
Discord (Bara#5006) | My Plugins (GitHub)
You like my work? Support is not a crime.
Bara is offline
PeEzZ
Senior Member
Join Date: Jan 2014
Location: Hungary
Old 12-09-2018 , 13:14   Re: CSGO Spawn DroneGun any map
Reply With Quote #5

Nice
__________________
I MAKING MY PLUGINS/MAPS STILL, BUT I DON'T HAVE ENOUGH TIME, PLEASE STAND BY.
Sorry for my bad english, correct me if i'm wrong.
Magyarok írjanak PM-et ha fontos!

If you want, you can donate for me here
My plugins here / My maps here
PeEzZ is offline
Vit_amin
Senior Member
Join Date: Dec 2015
Location: Russian Federation
Old 12-09-2018 , 16:32   Re: CSGO Spawn DroneGun any map
Reply With Quote #6

Drons has AI and they used navigation mesh's ?
Vit_amin is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 12-09-2018 , 17:09   Re: CSGO Spawn DroneGun any map
Reply With Quote #7

Quote:
Originally Posted by Vit_amin View Post
Drons has AI and they used navigation mesh's ?
Idk if you like to argue what AI means or if you misread the thread title, it's about the dronegun (turret) not the drone entity.
__________________
zipcore is offline
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 04:02.


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