Raised This Month: $120 Target: $400
 30% 

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 , 05:16   CSGO Spawn DroneGun any map
Reply With Quote #1

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

public void OnPluginStart()
{
    
    
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;
    
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-08-2018 at 05:23.
e54385991 is offline
Send a message via ICQ to e54385991
Bara
AlliedModders Donor
Join Date: Apr 2012
Location: Germany
Old 12-08-2018 , 05:17   Re: CSGO Spawn DroneGun any map
Reply With Quote #2

netprops for CDroneGun https://pastebin.com/K8k3QUQ8
__________________
Steam | More plugins | Discord: Bara#1676
Bara is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 12-08-2018 , 06: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 , 07: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.
__________________
Steam | More plugins | Discord: Bara#1676
Bara is offline
PeEzZ
Senior Member
Join Date: Jan 2014
Location: Hungary
Old 12-09-2018 , 14:14   Re: CSGO Spawn DroneGun any map
Reply With Quote #5

Nice
__________________
Sorry for my bad english, correct me if i'm wrong.
Ha magyar vagy, írj PM-et ha szeretnél valamit!
A multifunctional guy: scripting, mapping and a bit modelling
If you want to donate me, you can do here:
Also: My Plugins
PeEzZ is offline
Vit_amin
Senior Member
Join Date: Dec 2015
Location: Russian Federation
Old 12-09-2018 , 17: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 , 18: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 14:37.


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