Raised This Month: $32 Target: $400
 8% 

Help with my plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gabrielx
Junior Member
Join Date: Jul 2015
Old 06-28-2016 , 06:59   Help with my plugin
Reply With Quote #1

How i can disable and enable a specific skin in menu, with CurWeapon

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <colorchat>


new bool:Model[32];

new 
newak[] = "models/PlayTeamBR/Golden.mdl";
new 
oldak[] = "models/v_ak47.mdl";

public 
plugin_init()
{
    
register_clcmd"say /skin","InvisMenu"ADMIN_KICK );
    
register_clcmd"say skin","InvisMenu"ADMIN_KICK );
    
    
    
}
public 
plugin_precache()
{
    
precache_model(newak)
}
public 
InvisMenu(id)
{
    if (!
is_user_alive(id))
    {
        
ColorChat(idNORMAL"^4[ ^3PlayTeamBR ^4] Voce precisa estar vivo para abrir o menu!");
        return 
PLUGIN_HANDLED;
    }
    new 
menu menu_create("\w[ \rPlayTeamBR \w] Menu variado^n\yFeito Por: \dGabriel x""menu_handler");
    new 
szTemp[500];
    
formatex(szTempcharsmax(szTemp), "Skin ak47: \w[ %s \w]"Model[id] ? "\rDisabled" "\yEnabled");
    
menu_additem(menuszTemp"1");
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
    
menu_display(idmenu0);
    
}
public 
menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    new 
data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);
    new 
key str_to_num(data);
    
    switch(
key
    {
        case 
1:
        {
            
set_pev(idpev_viewmodel2Model[id] ? oldak:newak// the skin baack to the nromal you can help?
            
ColorChat(idNORMALModel[id] ? "Your ak is normal now" "you take a new ak");
        }
        
    }


Last edited by Gabrielx; 06-28-2016 at 18:30.
Gabrielx is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-28-2016 , 07:35   Re: Help with my plugin
Reply With Quote #2

What are you talking about? Skin, noclip, model, gabriel, dafuq?
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Gabrielx
Junior Member
Join Date: Jul 2015
Old 06-28-2016 , 08:07   Re: Help with my plugin
Reply With Quote #3

model, disable or enable skin with this menu
enable or disable a custom skin
Gabrielx is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-28-2016 , 09:34   Re: Help with my plugin
Reply With Quote #4

What skins are you talking about? I don't see any skins in the code.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-28-2016 , 09:37   Re: Help with my plugin
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
What skins are you talking about? I don't see any skins in the code.
That's what i was thinking aswell lol. Nothing precached, nothing set, ...
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Gabrielx
Junior Member
Join Date: Jul 2015
Old 06-28-2016 , 18:31   Re: Help with my plugin
Reply With Quote #6

code updated check again and help me...
Gabrielx is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 06-28-2016 , 19:16   Re: Help with my plugin
Reply With Quote #7

Ta ae parça
Here's brother.

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

new bool:Model[33] = true

new newak[] = "models/PlayTeamBR/Golden.mdl"
new 
oldak[] = "models/v_ak47.mdl"

public 
plugin_init() 

    
register_plugin("New AK Skins","1.0","AlliedModders")
    
    
register_event("CurWeapon","EvChangeWeap","be","1=1")
    
    
register_clcmd"say /skin","InvisMenu"ADMIN_KICK ); 
    
register_clcmd"say skin","InvisMenu"ADMIN_KICK ); 

public 
plugin_precache() 

    
precache_model(newak

public 
EvChangeWeap(id)
{
    if(
read_data(2) == CSW_AK47)
    {
        if(!
Model[id])
        {
            
set_pev(id,pev_viewmodel2,newak)
        }
        else
            
set_pev(id,pev_viewmodel2,oldak)
    }
}
public 
InvisMenu(id

    if (
is_user_alive(id)) 
    { 
        new 
menu menu_create("\w[ \rPlayTeamBR \w] Menu variado^n\yFeito Por: \dGabriel x""menu_handler"); 
    
        
menu_additem(menuModel[id] ? "Skin AK47 \r[Desativado]" "Skin AK47 \y[Ativado]"); 
    
        
menu_display(idmenu); 
    }
    else
    {
        
ColorChat(id,"^4[ ^3PlayTeamBR ^4] Voce precisa estar vivo para abrir o menu!"); 
    } 
    return 
PLUGIN_HANDLED
    

public 
menu_handler(idmenuitem

    if( 
item == MENU_EXIT 
    { 
        
menu_destroy(menu); 
        return 
PLUGIN_HANDLED
    } 
    switch(
item)  
    { 
        case 
0
        { 
            switch(
Model[id])
            {
                case 
false:
                {
                    
Model[id] = true
                    ColorChat
(id"^4[ ^3PlayTeamBR ^4] Voce selecionou a skin da AK!"); 
                }
                case 
true:
                {
                    
Model[id] = false
                    ColorChat
(id"^4[ ^3PlayTeamBR ^4] Voce selecionou a skin normal da AK!"); 
                }
            }
            
InvisMenu(id
        } 
    } 
    return 
PLUGIN_HANDLED

stock ColorChatid, const szStr[], any:... ) 
{
    new 
szMsg191 ], iPlayers32 ], iCount 1;
    
    
vformatszMsgsizeof szMsg 1szStr);
    
    
replace_allszMsg190"!g""^4" );
    
replace_allszMsg190"!y""^1" );
    
replace_allszMsg190"!t""^3" );
    
    if( 
id )
    {
        
iPlayers] = id;
    } 
    else 
    {
        
get_playersiPlayersiCount"ch" );
    }
    
    for( new 
iCount i++ )
    {
        if( 
is_user_connectediPlayers] ) )
        {
            
message_beginMSG_ONE_UNRELIABLEget_user_msgid("SayText"), _iPlayers] );
            
write_byteiPlayers] );
            
write_stringszMsg );
            
message_end( );
        }
    }

__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx 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 04:01.


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