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

access flags that have knifes


Post New Thread Reply   
 
Thread Tools Display Modes
itoxicreal
Senior Member
Join Date: Jun 2018
Old 06-05-2020 , 00:16   Re: access flags that have knifes
Reply With Quote #11

Quote:
Originally Posted by Supremache View Post
PHP Code:
/*-----------------------------------------------------------------------------------------------
 ___                ________________    ____                     ___________________
|   |        /|    |                |  |    |                   |                   |
|   |      /  |    |   __________   |  |    |                   |   _____________   |
|   |    /    |    |  |          |  |  |    |                   |  |             |  |
|   |  /      |    |  |          |  |  |    |                   |  |             |  |
|   |/       /     |  |          |  |  |    |                   |  |             |  |
|          /       |  |          |  |  |    |                   |  |             |  |
|        /         |  |__________|  |  |    |                   |  |             |  |
|       /          |  |          |  |  |    |                   |  |             |  |
|        \         |  |          |  |  |    |                   |  |             |  |
|          \       |  |          |  |  |    |                   |  |             |  |
|   |\       \     |  |          |  |  |    |                   |  |             |  |
|   |  \       \   |  |          |  |  |    |                   |  |             |  |
|   |    \      |  |  |          |  |  |    |____________       |  |             |  |
|   |      \    |  |  |          |  |  |                 |      |  |_____________|  |
|   |        \  |  |  |          |  |  |                 |      |                   |
|___|          \|  |__|          |__|  |_________________|      |___________________|

-------------------------------------------------------------------------------------------------*/
/*------------------------------------
Plugin Created By KaLo 
-------------------------------------*/
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>

#define PLUGIN "Admin Knife Model"
#define VERSION "1.0"
#define AUTHOR "KaLo"


new const v_Knife_Admin[64] = "models/v_knife_admin.mdl"
new const p_Knife_Admin[64] = "models/p_knife_admin.mdl"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event"CurWeapon""Event_CurWeapon""be""1=1" )
    
}

public 
plugin_precache( ) {
    
precache_modelv_Knife_Admin )
    
precache_modelp_Knife_Admin )
    
}

public 
Event_CurWeaponid ) {
    new 
Arma read_data)
    
    if( 
get_user_flagsid ) == ADMIN_LEVEL_H && Arma == CSW_KNIFE){
        
set_pevidpev_viewmodel2v_Knife_Admin )
        
set_pevidpev_weaponmodel2p_Knife_Admin )
        
    }
    
    

I dont see the desierd knife i want when i go to my knifes
itoxicreal is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-05-2020 , 02:03   Re: access flags that have knifes
Reply With Quote #12

Sorry for not seeing this post, I deleted my plugin, but I can redo it, I hope you don't need it like immediatly
supertrio17 is offline
itoxicreal
Senior Member
Join Date: Jun 2018
Old 06-05-2020 , 02:32   Re: access flags that have knifes
Reply With Quote #13

Quote:
Originally Posted by supertrio17 View Post
Sorry for not seeing this post, I deleted my plugin, but I can redo it, I hope you don't need it like immediatly
Its fine i can wait
itoxicreal is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-05-2020 , 03:49   Re: access flags that have knifes
Reply With Quote #14

Quote:
Originally Posted by itoxicreal View Post
Its fine i can wait
Thanks for waiting, it's tested and working, hope it works for you

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Flag Knife Model"
#define VERSION "1.1"
#define AUTHOR "Mr. Boopsy"

#define FLAG_HERE "t" //you change needed flag here
#define V_KNIFE "models/knife_t.mdl" //you change your path to model here

public plugin_precache() 
{
    
precache_model(V_KNIFE)
}

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_event("CurWeapon""knife""be""1=1")
}

public 
knife(id)
{
    new 
is_knife read_data(2)
    if(
has_flag(idFLAG_HERE))
    {
        if(
is_knife == CSW_KNIFE)
        {
            
set_pev(idpev_viewmodel2V_KNIFE);
            
//set_pev(id, pev_weaponmodel2, V_KNIFE); //remove first "//" if you use weapon model, its a model that other players see
        
}
    }

supertrio17 is offline
itoxicreal
Senior Member
Join Date: Jun 2018
Old 06-05-2020 , 05:36   Re: access flags that have knifes
Reply With Quote #15

Quote:
Originally Posted by supertrio17 View Post
Thanks for waiting, it's tested and working, hope it works for you

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Flag Knife Model"
#define VERSION "1.1"
#define AUTHOR "Mr. Boopsy"

#define FLAG_HERE "t" //you change needed flag here
#define V_KNIFE "models/knife_t.mdl" //you change your path to model here

public plugin_precache() 
{
    
precache_model(V_KNIFE)
}

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_event("CurWeapon""knife""be""1=1")
}

public 
knife(id)
{
    new 
is_knife read_data(2)
    if(
has_flag(idFLAG_HERE))
    {
        if(
is_knife == CSW_KNIFE)
        {
            
set_pev(idpev_viewmodel2V_KNIFE);
            
//set_pev(id, pev_weaponmodel2, V_KNIFE); //remove first "//" if you use weapon model, its a model that other players see
        
}
    }

Thank you,Can you also make it for vip model? with access t
itoxicreal is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-05-2020 , 05:41   Re: access flags that have knifes
Reply With Quote #16

You mean like player model, yea, that one is easy
supertrio17 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-05-2020 , 13:20   Re: access flags that have knifes
Reply With Quote #17

Quote:
Originally Posted by itoxicreal View Post
Thank you,Can you also make it for vip model? with access t
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>

#define FLAG_HERE "t" //you change needed flag here
#define V_KNIFE "models/knife_t.mdl" //you change your path to model here

/***************************************/
enum _:ModelsInfo
{
    
Flag,
    
CTModel[32],
    
TModel[32]
}
new const 
g_eModels[][ModelsInfo] =
{
    { 
ADMIN_LEVEL_H"vip_ct""vip_t" }
}
new 
Trie:g_tModels

/***************************************/

public plugin_init() 
{
    
register_plugin("""""")
    
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawn"1)

    
register_event("CurWeapon""knife""be""1=1")
}


public 
plugin_end()
    
TrieDestroy(g_tModels)

public 
plugin_precache() 
{
    
precache_model(V_KNIFE)
    
    
g_tModels TrieCreate()
    
    for(new 
isizeof(g_eModels); i++)
    {
        
precache_player_model(g_eModels[i][CTModel])
    
precache_player_model(g_eModels[i][TModel])
    }
    
}


public 
knife(id)
{
    new 
is_knife read_data(2)
    if(
has_flag(idFLAG_HERE))
    {
        if(
is_knife == CSW_KNIFE)
        {
            
set_pev(idpev_viewmodel2V_KNIFE);
            
//set_pev(id, pev_weaponmodel2, V_KNIFE); //remove first "//" if you use weapon model, its a model that other players see
        
}
    }

/*****************************/
//        VIP Model          //
/*****************************/

public OnPlayerSpawn(id)
{
    if(
is_user_alive(id))
    {
        static 
bool:bMatchiFlagsi
        bMatch 
false
        
        
for(iFlags get_user_flags(id), 0sizeof(g_eModels); i++)
        {
            if(
iFlags g_eModels[i][Flag])
            {
                switch(
cs_get_user_team(id))
                {
                    case 
CS_TEAM_CTcs_set_user_model(idg_eModels[i][CTModel])
                    case 
CS_TEAM_Tcs_set_user_model(idg_eModels[i][TModel])
                }
                
                
bMatch true
                
break
            }
        }
        
        if(!
bMatch)
        {
            static 
szModel[32]
            
cs_get_user_model(idszModelcharsmax(szModel))
            
            if(
TrieKeyExists(g_tModelsszModel))
                
cs_reset_user_model(id)
        }
    }
}

precache_player_model(szModel[])
{
    
TrieSetCell(g_tModelsszModel1)
    
    static 
szFile[128]
    
formatex(szFilecharsmax(szFile), "models/player/%s/%s.mdl"szModelszModel)
    
precache_model(szFile)
    
replace(szFilecharsmax(szFile), ".mdl""T.mdl")
    
    if(
file_exists(szFile))
        
precache_model(szFile)

Supremache is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-05-2020 , 14:16   Re: access flags that have knifes
Reply With Quote #18

Quote:
Originally Posted by Supremache View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>

#define FLAG_HERE "t" //you change needed flag here
#define V_KNIFE "models/knife_t.mdl" //you change your path to model here

/***************************************/
enum _:ModelsInfo
{
    
Flag,
    
CTModel[32],
    
TModel[32]
}
new const 
g_eModels[][ModelsInfo] =
{
    { 
ADMIN_LEVEL_H"vip_ct""vip_t" }
}
new 
Trie:g_tModels

/***************************************/

public plugin_init() 
{
    
register_plugin("""""")
    
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawn"1)

    
register_event("CurWeapon""knife""be""1=1")
}


public 
plugin_end()
    
TrieDestroy(g_tModels)

public 
plugin_precache() 
{
    
precache_model(V_KNIFE)
    
    
g_tModels TrieCreate()
    
    for(new 
isizeof(g_eModels); i++)
    {
        
precache_player_model(g_eModels[i][CTModel])
    
precache_player_model(g_eModels[i][TModel])
    }
    
}


public 
knife(id)
{
    new 
is_knife read_data(2)
    if(
has_flag(idFLAG_HERE))
    {
        if(
is_knife == CSW_KNIFE)
        {
            
set_pev(idpev_viewmodel2V_KNIFE);
            
//set_pev(id, pev_weaponmodel2, V_KNIFE); //remove first "//" if you use weapon model, its a model that other players see
        
}
    }

/*****************************/
//        VIP Model          //
/*****************************/

public OnPlayerSpawn(id)
{
    if(
is_user_alive(id))
    {
        static 
bool:bMatchiFlagsi
        bMatch 
false
        
        
for(iFlags get_user_flags(id), 0sizeof(g_eModels); i++)
        {
            if(
iFlags g_eModels[i][Flag])
            {
                switch(
cs_get_user_team(id))
                {
                    case 
CS_TEAM_CTcs_set_user_model(idg_eModels[i][CTModel])
                    case 
CS_TEAM_Tcs_set_user_model(idg_eModels[i][TModel])
                }
                
                
bMatch true
                
break
            }
        }
        
        if(!
bMatch)
        {
            static 
szModel[32]
            
cs_get_user_model(idszModelcharsmax(szModel))
            
            if(
TrieKeyExists(g_tModelsszModel))
                
cs_reset_user_model(id)
        }
    }
}

precache_player_model(szModel[])
{
    
TrieSetCell(g_tModelsszModel1)
    
    static 
szFile[128]
    
formatex(szFilecharsmax(szFile), "models/player/%s/%s.mdl"szModelszModel)
    
precache_model(szFile)
    
replace(szFilecharsmax(szFile), ".mdl""T.mdl")
    
    if(
file_exists(szFile))
        
precache_model(szFile)

Please do not use this plugin, this guy is known for not knowing how to make plugins. There are too many unnecessary things.

And can you tell me why do you keep insisting on making plugins, and yet not knowing how. If you are trying to learn, you are learning wrong.

Why the f do you use enum in every plugin, you make so much mess of what is supposed to be very simple plugin. Please stop making plugins or just learn how!

I'm not great at pawning myself, I started pawning two weeks ago, yet I see your mistakes.
supertrio17 is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-05-2020 , 14:17   Re: access flags that have knifes
Reply With Quote #19

I will make you this plugin when I get home, but for now just don't use this.
supertrio17 is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-05-2020 , 14:42   Re: access flags that have knifes
Reply With Quote #20

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN "Flag Knife Model"
#define VERSION "1.2"
#define AUTHOR "Mr. Boopsy"

#define FLAG_HERE "t" //you change needed flag here
#define V_KNIFE "models/knife_t.mdl" //you change your path to model here
#define VIP_PLAYER_CT "models/player/vip_ct/vip_ct.mdl" //you change your path to model here
#define VIP_PLAYER_T "models/player/vip_tt/vip_tt.mdl" //you change your path to model here

public plugin_precache() 
{
    
precache_model(V_KNIFE)
    
precache_model(VIP_PLAYER_T)
    
precache_model(VIP_PLAYER_CT)
}

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_event("CurWeapon""knife""be""1=1")
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawn"1)
}

public 
OnPlayerSpawn(id)
{
    if(
has_flag(idFLAG_HERE))
    {
        if(
is_user_alive(id))
        {
            switch(
cs_get_user_team(id))
            {
                case 
CS_TEAM_CTcs_set_user_model(id"vip_ct")
                case 
CS_TEAM_Tcs_set_user_model(id"vip_tt")
            }
        }
    }
}

public 
knife(id)
{
    new 
is_knife read_data(2)
    if(
has_flag(idFLAG_HERE))
    {
        if(
is_knife == CSW_KNIFE)
        {
            
set_pev(idpev_viewmodel2V_KNIFE);
            
//set_pev(id, pev_weaponmodel2, V_KNIFE); //remove first "//" if you use weapon model, its a model that other players see
        
}
    }

I belive this is what you need, tell me if it is working, I made this with my phone, so sorry if it doesn't work, when I get home I will try it
supertrio17 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 06:42.


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