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

Defuse kit for vips and c4 skin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Apb hq
Senior Member
Join Date: Apr 2014
Old 05-31-2014 , 19:28   Defuse kit for vips and c4 skin
Reply With Quote #1

Hi everyone can someone make me two plugins first a plugin which will give every round a defuse kit to vips with flag t i tried two plugins that i findhere and they didn't work and the second the c4 bomb model replacement for p_ v_ and w_ model ( i want to change c4 model with my skins)
Thanks in advance sorry for bad english
Apb hq is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 05-31-2014 , 19:55   Re: Defuse kit for vips and c4 skin
Reply With Quote #2

The first one -
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>

#define PLUGIN "Give Defuse Kit"
#define VERSION "1.0"
#define AUTHOR "Flicker"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""Spawn"1)
}

public 
Spawn(id)
{
    if(!
is_user_alive(id))
        return
        
    if(
get_user_flags(id) & ADMIN_LEVEL_H)    
        
give_item(id"item_thighpack")

The second one-
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#include <engine>

#define PLUGIN "Replace Grenade Models"
#define VERSION "1.0"
#define AUTHOR "Flicker"

new OLDWMODEL[] = "models/w_c4.mdl"

new PMODEL[] = "models/p_c4_vip.mdl"
new VMODEL[] = "models/v_c4_vip.mdl"
new WMODEL[] = "models/w_c4_vip.mdl"

public plugin_precache()
{
    
precache_model(PMODEL)
    
precache_model(VMODEL)
    
precache_model(WMODEL)
}


public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Item_Deploy"weapon_c4""ChangeSkin"1)
    
register_forward(FM_SetModel"SetWModel")
}

public 
ChangeSkin(id)
{
    if(!
is_user_connected(id))
        return
        
    
set_pev(idpev_viewmodel2VMODEL)
    
set_pev(idpev_weaponmodel2PMODEL)
}

public 
SetWModel(entitymodel[])
{
    if(!
is_valid_ent(entity) || !equali(modelOLDWMODEL))
        return 
FMRES_IGNORED
    
    
new className[33]
    
entity_get_string(entityEV_SZ_classnameclassName32)
    
    if(
equal(className"weaponbox") || equal(className"armoury_entity") || equal(className"grenade"))
    {
        
engfunc(EngFunc_SetModelentityWMODEL)
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED

I know there will be some mistakes, will fix them tomorrow. Didn't have time to test, but decided to post it, so someone could improve it for you if there is something. Don't hate.
__________________

Last edited by Flick3rR; 05-31-2014 at 19:55.
Flick3rR is offline
Send a message via Skype™ to Flick3rR
Apb hq
Senior Member
Join Date: Apr 2014
Old 05-31-2014 , 20:36   Re: Defuse kit for vips and c4 skin
Reply With Quote #3

I have tested the c4 plugin it change the model only when i plant the bomb
Can someone fix this and another think can somebody add to this code to change also the ledglow.spr

Last edited by Apb hq; 05-31-2014 at 20:46.
Apb hq is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 06-01-2014 , 05:48   Re: Defuse kit for vips and c4 skin
Reply With Quote #4

First one seems okay.
Second one not going to work though - the param is item entity index on Deploy() not player index. Also not a good way to detect the bomb there.

Try this for the second:
Code:
#include <amxmodx> #include <fakemeta> enum {     v,     p,     w,     x } new const g_szMdlC4[][] = {     "V_MODEL",     "P_MODEL",     "W_MODEL",     "PLANTED_MODEL" } new _pfnSetModel; public plugin_precache() {     for( new i ; i < 4 ; i ++ )         precache_model( g_szMdlC4[ i ] ); } public plugin_init() {     register_plugin( "C4 Skins", "0.0.1", "hornet" );         register_event( "CurWeapon", "Event_CurWeapon", "be", "1=1", "2=6" );         register_logevent( "LogEvent_DroppedTheBomb", 3, "2=Dropped_The_Bomb" );     register_logevent( "LogEvent_PlantedTheBomb", 3, "2=Planted_The_Bomb" ); } public Event_CurWeapon( id ) {     set_pev( id, pev_viewmodel2, g_szMdlC4[ v ] );     set_pev( id, pev_weaponmodel2, g_szMdlC4[ p ] ); } public LogEvent_DroppedTheBomb() {     _pfnSetModel = register_forward( FM_SetModel, "pfnSetModel", 1 ); } public LogEvent_PlantedTheBomb() {     engfunc( EngFunc_SetModel, engfunc( EngFunc_FindEntityByString, -1, "model", "models/w_c4.mdl" ), g_szMdlC4[ x ] ); } public pfnSetModel( iEnt, szModel[] ) {     if( pev_valid( iEnt ) && equal( szModel, "models/w_backpack.mdl" ) )     {         engfunc( EngFunc_SetModel, iEnt, g_szMdlC4[ w ] );         unregister_forward( FM_SetModel, _pfnSetModel, 1 );     } }
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 06-01-2014 at 06:44.
hornet is offline
Apb hq
Senior Member
Join Date: Apr 2014
Old 06-01-2014 , 06:32   Re: Defuse kit for vips and c4 skin
Reply With Quote #5

Hornet man thanks it's working but when i plant it the model stays the same it doesn't change it can you help me?
Apb hq is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 06-01-2014 , 06:36   Re: Defuse kit for vips and c4 skin
Reply With Quote #6

you have the correct keywords in your own post:
  • to replace weapon models: weapon model replacement.
  • to replace almost everything: Content Replacer.
  • to find such plugins use this keyword replace* (if you don't understand it, read the search tutorial).
__________________

Last edited by ANTICHRISTUS; 06-01-2014 at 06:37.
ANTICHRISTUS is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 06-01-2014 , 06:46   Re: Defuse kit for vips and c4 skin
Reply With Quote #7

Quote:
Originally Posted by Apb hq View Post
Hornet man thanks it's working but when i plant it the model stays the same it doesn't change it can you help me?
That wasn't part of your original request, but I've updated my post nonetheless.

Quote:
Originally Posted by ANTICHRISTUS View Post
you have the correct keywords in your own post:
  • to replace weapon models: weapon model replacement.
  • to replace almost everything: Content Replacer.
  • to find such plugins use this keyword replace* (if you don't understand it, read the search tutorial).
Weapon Model Replacement is not a good plugin ( in comparison to the discovered methods we use today ). Please don't encourage it.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 06-01-2014 , 07:03   Re: Defuse kit for vips and c4 skin
Reply With Quote #8

ok sir, I'll try to avoid it. and we hope to see another replacement plugin.
__________________
ANTICHRISTUS is offline
EthicalHacker007
Veteran Member
Join Date: May 2014
Old 06-01-2014 , 07:44   Re: Defuse kit for vips and c4 skin
Reply With Quote #9

@Hornet

Any other alternative for weapon model replacement? And if its not a good plugin, it should be unapproved now?
__________________
EthicalHacker007 is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 06-01-2014 , 08:01   Re: Defuse kit for vips and c4 skin
Reply With Quote #10

Quote:
Originally Posted by EthicalHacker007 View Post
@Hornet

Any other alternative for weapon model replacement? And if its not a good plugin, it should be unapproved now?
The aim is to only remove plugins from the Approved section if:
  • The plugin's morale is no longer supported.
  • It's features have been blocked by Valve.
  • A more suitable plugin has taken its place.
  • The author has been banned & plugin requires fixes.
  • The plugin is broken and no one has updated it.

A much more desirable plugin could be written with Orpheu ( since strings in the memory can be directly replaced ), or another alternative is with Hamsandwich, as oppose to the infamous CurWeapon event.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet 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 00:52.


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