Raised This Month: $51 Target: $400
 12% 

[CSGO] !dick plugin fun plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Papero
Veteran Member
Join Date: Aug 2016
Location: Italy
Old 07-08-2017 , 07:32   Re: [CSGO] !dick plugin fun plugin
Reply With Quote #11

Try to compile this:
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>





#pragma newdecls required
#pragma semicolon 1

#define DickPath "models/3d/penis/penis.mdl"

#define PLUGIN_AUTHOR "Hexah"
#define PLUGIN_VERSION "1.00"


bool bEquipDick[MAXPLAYERS 1] = false;
int iEntIndex[MAXPLAYERS 1] = -1;




public 
Plugin myinfo 
{
    
name "Hexah | Blocks from zeph"
    
author PLUGIN_AUTHOR
    
description ""
    
version PLUGIN_VERSION
    
url "https://forums.alliedmods.net/showthread.php?t=298804"
};

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_dick"Command_DickADMFLAG_RESERVATION"Equip a dick!");
    
HookEvent("player_spawn"OnPlayerSpawnEventHookMode_Post);
}

public 
void OnPlayerSpawn(Event event, const char[] namebool dontbroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    if (
bEquipDick[client])
    {
        
CreateHat(client);
    }
}

public 
void OnMapStart()
{
    
PrecacheModel2(DickPath);
}


public 
Action Command_Dick(int clientint args)
{
    if (!
IsPlayerAlive(client))
    {
        
ReplyToCommand(client"[SM] You need to be alive to use this command");
        return 
Plugin_Handled;
    }
    if (!
bEquipDick[client])
    {
        
ReplyToCommand(client"[SM] You equiped the dick");
        
CreateHat(client);
        
bEquipDick[client] = true;
    }
    else
    {
        
ReplyToCommand(client"[SM] You unquiped the dick");
        
RemoveHat(client);
        
bEquipDick[client] = false;
    }
    return 
Plugin_Handled;
}

//From zeph store
void CreateHat(int client)
{
    
int m_iEnt CreateEntityByName("prop_dynamic_override");
    
DispatchKeyValue(m_iEnt"model"DickPath);
    
DispatchKeyValue(m_iEnt"spawnflags""256");
    
DispatchKeyValue(m_iEnt"solid""0");
    
SetEntPropEnt(m_iEntProp_Send"m_hOwnerEntity"client);
    
    
float fHatOrigin[3];
    
fHatOrigin[0] = -0.500000;
    
fHatOrigin[1] = -4.500000;
    
fHatOrigin[2] = -44.000000;
    
    
float fHatAngles[3];
    
fHatAngles[0] = 5.000000;
    
fHatAngles[1] = 0.000000;
    
fHatAngles[2] = 1.000000;
    
    
DispatchSpawn(m_iEnt);
    
AcceptEntityInput(m_iEnt"TurnOn"m_iEntm_iEnt0);
    
    
iEntIndex[client] = m_iEnt;
    
// We don't want the client to see his own hat
    
SDKHook(m_iEntSDKHook_SetTransmitHook_SetTransmit);
    
    
// Teleport the hat to the right position and attach it
    
TeleportEntity(m_iEntfHatOriginfHatAnglesNULL_VECTOR);
    
    
SetVariantString("!activator");
    
AcceptEntityInput(m_iEnt"SetParent"clientm_iEnt0);
    
    
SetVariantString(DickPath);
    
AcceptEntityInput(m_iEnt"SetParentAttachmentMaintainOffset"m_iEntm_iEnt0);
    
    
}

void RemoveHat(int client)
{
    if (
IsValidEdict(iEntIndex[client]))
    {
        
SDKUnhook(iEntIndex[client], SDKHook_SetTransmitHook_SetTransmit);
        
char m_szClassname[64];
        
GetEdictClassname(iEntIndex[client], m_szClassnamesizeof(m_szClassname));
        if (
strcmp("prop_dynamic"m_szClassname) == 0)
            
AcceptEntityInput(iEntIndex[client], "Kill");
    }
}


//From zeph stock
stock int PrecacheModel2(const char[] modelbool preload false)
{
    static 
int m_unModelPrecache INVALID_STRING_TABLE;
    
    if (
m_unModelPrecache == INVALID_STRING_TABLE)
    {
        
m_unModelPrecache FindStringTable("modelprecache");
    }
    
    
    return 
PrecacheModel(modelpreload);
}


public 
Action Hook_SetTransmit(int entint client)
{
    if (
client && IsClientInGame(client) && bEquipDick[client] && ent == iEntIndex[client])
    {
        return 
Plugin_Handled;
    }
    return 
Plugin_Continue;

It's my first time that "I work" with models... If you won't i'll test it after...
the command is: "sm_dick" and the default flag is "a".

You'll need use another plugin to download the models, if you want i can try to add an automatic download.
__________________
My Plugins
SPCode


Steam: hexer504
Telegram: Hexah
Discord: Hexah#6903

If you like my work you can donate here!

Last edited by Papero; 07-08-2017 at 09:52.
Papero is offline
LaGgLs
Senior Member
Join Date: Apr 2015
Location: sweden
Old 07-08-2017 , 09:41   Re: [CSGO] !dick plugin fun plugin
Reply With Quote #12

it wont crash the server but i dosent work ingame and the file is downloaded
LaGgLs is offline
Papero
Veteran Member
Join Date: Aug 2016
Location: Italy
Old 07-08-2017 , 09:50   Re: [CSGO] !dick plugin fun plugin
Reply With Quote #13

Quote:
Originally Posted by LaGgLs View Post
it wont crash the server but i dosent work ingame and the file is downloaded
Any error log? & Does the chat replies work right?
__________________
My Plugins
SPCode


Steam: hexer504
Telegram: Hexah
Discord: Hexah#6903

If you like my work you can donate here!

Last edited by Papero; 07-08-2017 at 09:52.
Papero is offline
LaGgLs
Senior Member
Join Date: Apr 2015
Location: sweden
Old 07-08-2017 , 10:24   Re: [CSGO] !dick plugin fun plugin
Reply With Quote #14

No error log but its works it says [SM] You equiped the dick but you cant se the D and the server download the files needed
LaGgLs is offline
WatchDogs
Senior Member
Join Date: Oct 2015
Location: Iran
Old 07-08-2017 , 10:48   Re: [CSGO] !dick plugin fun plugin
Reply With Quote #15

This line makes model invisible ! :

// We don't want the client to see his own hat
SDKHook(m_iEnt, SDKHook_SetTransmit, Hook_SetTransmit);



Try this:

PHP Code:
#include <sourcemod> 
#include <sdktools> 

#pragma newdecls required 
#pragma semicolon 1 

#define DickPath "models/3d/penis/penis.mdl" 

#define PLUGIN_AUTHOR "Hexah" 
#define PLUGIN_VERSION "1.00" 


bool bEquipDick[MAXPLAYERS 1] = false
int iEntIndex[MAXPLAYERS 1] = -1




public 
Plugin myinfo =  

    
name "Hexah | Blocks from zeph",  
    
author PLUGIN_AUTHOR,  
    
description "",  
    
version PLUGIN_VERSION,  
    
url "https://forums.alliedmods.net/showthread.php?t=298804" 
}; 

public 
void OnPluginStart() 

    
RegAdminCmd("sm_dick"Command_DickADMFLAG_RESERVATION"Equip a dick!"); 
    
HookEvent("player_spawn"OnPlayerSpawnEventHookMode_Post); 


public 
void OnPlayerSpawn(Event event, const char[] namebool dontbroadcast

    
int client GetClientOfUserId(event.GetInt("userid")); 
    if (
bEquipDick[client]) 
    { 
        
CreateHat(client); 
    } 


public 
void OnMapStart() 

    
PrecacheModel2(DickPath); 



public 
Action Command_Dick(int clientint args

    if (!
IsPlayerAlive(client)) 
    { 
        
ReplyToCommand(client"[SM] You need to be alive to use this command"); 
        return 
Plugin_Handled
    } 
    if (!
bEquipDick[client]) 
    { 
        
ReplyToCommand(client"[SM] You equiped the dick"); 
        
CreateHat(client); 
        
bEquipDick[client] = true
    } 
    else 
    { 
        
ReplyToCommand(client"[SM] You unquiped the dick"); 
        
RemoveHat(client); 
        
bEquipDick[client] = false
    } 
    return 
Plugin_Handled


//From zeph store 
void CreateHat(int client

    
int m_iEnt CreateEntityByName("prop_dynamic_override"); 
    
DispatchKeyValue(m_iEnt"model"DickPath); 
    
DispatchKeyValue(m_iEnt"spawnflags""256"); 
    
DispatchKeyValue(m_iEnt"solid""0"); 
    
SetEntPropEnt(m_iEntProp_Send"m_hOwnerEntity"client); 
     
    
float fHatOrigin[3]; 
    
fHatOrigin[0] = -0.500000
    
fHatOrigin[1] = -4.500000
    
fHatOrigin[2] = -44.000000
     
    
float fHatAngles[3]; 
    
fHatAngles[0] = 5.000000
    
fHatAngles[1] = 0.000000
    
fHatAngles[2] = 1.000000
     
    
DispatchSpawn(m_iEnt); 
    
AcceptEntityInput(m_iEnt"TurnOn"m_iEntm_iEnt0); 
     
    
iEntIndex[client] = m_iEnt
     
    
// Teleport the hat to the right position and attach it 
    
TeleportEntity(m_iEntfHatOriginfHatAnglesNULL_VECTOR); 
     
    
SetVariantString("!activator"); 
    
AcceptEntityInput(m_iEnt"SetParent"clientm_iEnt0); 
     
    
SetVariantString(DickPath); 
    
AcceptEntityInput(m_iEnt"SetParentAttachmentMaintainOffset"m_iEntm_iEnt0); 
     
     


void RemoveHat(int client

    if (
IsValidEdict(iEntIndex[client])) 
    { 
        
char m_szClassname[64]; 
        
GetEdictClassname(iEntIndex[client], m_szClassnamesizeof(m_szClassname)); 
        if (
strcmp("prop_dynamic"m_szClassname) == 0
            
AcceptEntityInput(iEntIndex[client], "Kill"); 
    } 



//From zeph stock 
stock int PrecacheModel2(const char[] modelbool preload false

    static 
int m_unModelPrecache INVALID_STRING_TABLE
     
    if (
m_unModelPrecache == INVALID_STRING_TABLE
    { 
        
m_unModelPrecache FindStringTable("modelprecache"); 
    } 
     
     
    return 
PrecacheModel(modelpreload); 

Also this plugin is for hats not weapons ! I think this plugin makes a hat for client with dick model :/

So you should change the Angles & Origins to a correct value.

Last edited by WatchDogs; 07-08-2017 at 10:54.
WatchDogs is offline
LaGgLs
Senior Member
Join Date: Apr 2015
Location: sweden
Old 07-08-2017 , 11:09   Re: [CSGO] !dick plugin fun plugin
Reply With Quote #16

I will try it out and se if it works
LaGgLs 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 21:43.


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