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

Knife model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
talents
Member
Join Date: Feb 2011
Location: Romania
Old 03-04-2011 , 12:41   Knife model
Reply With Quote #1

How can i put a new model for a knife.
I have a vip menu. And at the menu i have a super knife and i want it to put a model for it.

Help?
__________________


talents is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 03-04-2011 , 13:07   Re: Knife model
Reply With Quote #2

PHP Code:
set_pev(ownerpev_viewmodel2"models/v_knife_model"
lis_16 is offline
talents
Member
Join Date: Feb 2011
Location: Romania
Old 03-04-2011 , 13:54   Re: Knife model
Reply With Quote #3

HTML Code:
set_user_health(id, get_user_health(id) + 2000);
               set_user_armor(id, get_user_armor(id) + 2000);
                     set_user_maxspeed(id, fast_speed);
                     HasSpeed = true;
                     set_pev(owner, pev_viewmodel2, "models/chucky_knife")

1.some errors... what i did wrong?
2.how can i put gravity at a knife?
__________________


talents is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 03-05-2011 , 04:48   Re: Knife model
Reply With Quote #4

1. Did you include fakemeta?
2. Hook change weapoen (event curweapon), check if player have a knife, if yes:
http://www.amxmodx.org/funcwiki.php?go=func&id=125
lis_16 is offline
talents
Member
Join Date: Feb 2011
Location: Romania
Old 03-05-2011 , 10:13   Re: Knife model
Reply With Quote #5

Here is the plugin. Please help. I don;t know how to do.
Attached Files
File Type: sma Get Plugin or Get Source (BaseBuilder_Vip.sma - 612 views - 6.3 KB)
__________________


talents is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 03-05-2011 , 11:34   Re: Knife model
Reply With Quote #6

PHP Code:
/*
*    -----------------
*     Coded in 2011,
*     by anti-talent or talents
*     -----------------
*
*    .:: Description ::.
*
*     BaseBuilder VIP Menu.
*
*    .:: Contacts ::.
*
*    Email: [email protected]
*
*    Steam: pijele
*
*/
#pragma semicolon 1

#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>
#include <hamsandwich>
#include <fakemeta>

#define ADMIN_BBVIP ADMIN_LEVEL_H

// Define the Plugin Version
new const VERSION[] = { "1.0" };

// PREFIX
new const PREFIX[] = { "!g[ BaseBuilder ]!n" };

new 
VipUsed[33];
new 
HasSpeed;

new 
Float:fast_speed 400.0;
new 
Float:normal_speed 250.0;


public 
plugin_init()
{
    
register_plugin("BaseBuilder: VIP Menu"VERSION"anti-talent");

    
RegisterHam(Ham_Spawn"player""FwdHamSpawn_Post"1);
    
RegisterHam(Ham_Item_PreFrame"player""FwdPreFrame_Post"1);
        
register_event("CurWeapon","event_curweapon","b","1=1");


    
register_clcmd("say vmenu""cmdVmenu");
    
register_clcmd("say /vmenu""cmdVmenu");
    
register_clcmd("say_team vmenu""cmdVmenu");
    
register_clcmd("say_team /vmenu""cmdVmenu");
       
register_clcmd("say /buyvip""cmdBuyvip");
    
register_clcmd("say buyvip""cmdBuyvip");
    
register_clcmd("say_team buyvip""cmdBuyvip");
    
register_clcmd("say_team /buyvip""cmdBuyvip");
     

}

public 
event_curweapon(){
    new 
id=read_data(1);
    new 
weapon;
    
weapon=get_user_weapon(id);
    if(
weapon==CSW_KNIFE)
    
set_pev(idpev_viewmodel2"models/v_knife_model") ;
}

public 
FwdPreFrame_Post(id)
{
    if(!
is_user_alive(id))
    {
        return 
PLUGIN_HANDLED;
    }

    if(!
HasSpeed)
    {
        return 
PLUGIN_HANDLED;
    }

    else if(
HasSpeed)
    {
        
set_user_maxspeed(idfast_speed);
    }

    return 
PLUGIN_HANDLED;
}

public 
FwdHamSpawn_Post(id)
{
    if (!
is_user_alive(id))
        return 
PLUGIN_CONTINUE;

    
HasSpeed false;
    
VipUsed[id] = false;
    
set_user_maxspeed(idnormal_speed);
    
set_user_renderingid_000_);
    return 
PLUGIN_CONTINUE;
}  

public 
cmdVmenu(id)
{
    if(!(
get_user_flags(id) & ADMIN_BBVIP))
    {
        
client_printc(id"%s Only !gVIPs !tmay use the VIP Menu"PREFIX);

        return 
PLUGIN_HANDLED;
    }

    if(
VipUsed[id])
    {
        
client_printc(id"%s You already used !gVIP Menu!n this round. Please wait till next round"PREFIX);

        return 
PLUGIN_HANDLED;
    }

    switch(
cs_get_user_team(id))
    {
        case 
CS_TEAM_T:
            
VipTMenu(id);

        case 
CS_TEAM_CT:
            
VipCTMenu(id);
    }

    return 
PLUGIN_HANDLED;
}

public 
VipCTMenu(id)
{
    new 
menu menu_create("\yBaseBuilder VIP Menu:^n\r""VipCTMenu_handler");

    
menu_additem(menu"\w+150 viata si +100 armura""1"0);
    
menu_additem(menu"\wViteza mai mare""2"0);
       
menu_additem(menu"\wM249 si Deagle""3"0);
       
menu_additem(menu"\wInviere""4"0);


    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
}

public 
VipCTMenu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);

    new 
key str_to_num(data);

    switch(
key)
    {
        case 
1:
        {
            
set_user_health(idget_user_health(id) + 150);
            
set_user_armor(idget_user_armor(id) + 100);
            
VipUsed[id] = true;

            
client_printc(id"%s Tocmai ai primit !g150 Viata!n si !g100 Armura!n"PREFIX);
        }
        case 
2:
        {
            
VipUsed[id] = true;
            
HasSpeed true;

            
set_user_maxspeed(idfast_speed);

            
client_printc(id"%s Tocmai ai primit !gViteza"PREFIX);
           }
              case 
3:
        {
            
give_item(id"weapon_m249");
            
give_item(id"weapon_deagle");
            
cs_set_user_bpammo(idCSW_M249200);
            
cs_set_user_bpammo(idCSW_DEAGLE100);
                     
             
VipUsed[id] = true;
                   

            
client_printc(id"%s Tocmai ai primit !gM249!n si !gDeagle!n"PREFIX);
        }
                 case 
4:
        {
              
           
ExecuteHamB(Ham_CS_RoundRespawnid);
 
        
VipUsed[id] = true;

        
client_printc(id"%s Tocmai ai fost !ginviat"PREFIX);
        }

    }

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public 
VipTMenu(id)
{
    new 
menu menu_create("\yBaeBuilder VIP Menu:^n\r""VipTMenu_handler");

    
menu_additem(menu"\wViteza mai mare""1"0);
    
menu_additem(menu"\w+5000 viata si +5000 armura""2"0);
       
menu_additem(menu"\wSuperCutit""3"0);

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
}

public 
VipTMenu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);

    new 
key str_to_num(data);

    switch(
key)
    {

        case 
1:
        {
            
VipUsed[id] = true;
            
HasSpeed true;

            
set_user_maxspeed(idfast_speed);

            
client_printc(id"%s Tocmai ai primit !gViteza"PREFIX);
        }

        case 
2:
        {
            
set_user_health(idget_user_health(id) + 5000);
            
set_user_armor(idget_user_armor(id) + 5000);
            
VipUsed[id] = true;

            
client_printc(id"%s Tocmai ai primit !g5000 Viata!n and !g5000 Armura!n"PREFIX);
        }
              case 
3:
        {
            
set_user_health(idget_user_health(id) + 2000);
               
set_user_armor(idget_user_armor(id) + 2000);
                     
set_user_maxspeed(idfast_speed);
                     
HasSpeed true;
                     
set_pev(idpev_viewmodel2"models/chucky_knife.mdl");
                     



            
VipUsed[id] = true;

            
client_printc(id"%s Tocmai ai primit un !gSuperCutit"PREFIX);
        }

    }

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}


public 
cmdBuyvip(id)
{
show_motd(id"vip.txt""VIP");
}  
public 
PrintText(id)
{
      
client_print(idprint_chat"!g[VIP] !tWrite !g/buyvip !tand u will see how get !gVIP !tand !gVIP privilegies.");
}




// Colour Chat
stock client_printc(const id, const input[], any:...)
{
    new 
count 1players[32];
    static 
msg[191];
    
vformat(msg190input3);

    
replace_all(msg190"!g""^x04"); // Green Color
    
replace_all(msg190"!n""^x01"); // Default Color
    
replace_all(msg190"!t""^x03"); // Team Color

    
if (idplayers[0] = id; else get_players(playerscount"ch");
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]);
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }

Try it.
lis_16 is offline
talents
Member
Join Date: Feb 2011
Location: Romania
Old 03-05-2011 , 13:30   Re: Knife model
Reply With Quote #7

I don't what it have.
When i choose SuperCutit(knife) my server is blocking and i must restart it. I have some warnings with loose idention.
When i enter on the server, the knife.mdl it;s not downloading.


Any help please?

PS: Can yo put small gravity at knife? I don't know how to make it... please
__________________


talents is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 03-05-2011 , 15:19   Re: Knife model
Reply With Quote #8

Replace old code with this:
PHP Code:
public event_curweapon(){
    new 
id=read_data(1);
    new 
weapon;
    
weapon=get_user_weapon(id);
    if(
weapon==CSW_KNIFE){
    
set_pev(idpev_viewmodel2"models/v_knife_model") ;
set_user_gravity(id0.5);

And add this:
PHP Code:
public plugin_precache(){
precache_model("models/v_knife_model");

lis_16 is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 03-05-2011 , 16:10   Re: Knife model
Reply With Quote #9

try this:
Attached Files
File Type: sma Get Plugin or Get Source (test.sma - 635 views - 6.4 KB)
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
talents
Member
Join Date: Feb 2011
Location: Romania
Old 03-06-2011 , 02:26   Re: Knife model
Reply With Quote #10

Thx drekes... but one problem:
i want to have chucky_knife when i choose SuperCutit(Knife). Can you do this?


thx
__________________


talents 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 18:49.


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