Raised This Month: $ Target: $400
 0% 

I need help with 1 plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Marin Vojnic
Junior Member
Join Date: Jul 2010
Old 08-01-2015 , 09:17   I need help with 1 plugin
Reply With Quote #1

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

#define SKINS 11

new g_knife[33];
    
new const 
g_knifemodels[SKINS][64] = {
    
"models/v_apbknife.mdl"// The default model, don't touch
    
"models/knife_mod/v_daedric.mdl",
    
"models/knife_mod/v_dual_light_saber_pink.mdl",
    
"models/knife_mod/v_dualcombat.mdl",
    
"models/knife_mod/v_light_saber_blu.mdl",
    
"models/knife_mod/v_knife.mdl"
    
"models/knife_mod/v_light_saber_green.mdl",
    
"models/knife_mod/v_light_saber_red.mdl",
    
"models/knife_mod/v_wolverine_new.mdl"
    
"models/knife_mod/v_knife.mdl",
    
"models/knife_mod/v_knife.mdl"
}

new const 
g_knifenames [SKINS][32] = {
    
"Default Knife",
    
"Dorex Knife",
    
"Lightning Knife",
    
"Master Knife",
    
"Light Saber Blue",
    
"Ultimate Knife",
    
"Ice Knife",
    
"Bloody Knife",
    
"Evolution Knife",
    
"Simple Knife",
    
"Crool Knife"
}

new 
g_knifecosts[SKINS][] = {
    
"0",
    
"5",
    
"5",
    
"5",
    
"5",
    
"5",
    
"10",
    
"10",
    
"15",
    
"15",
    
"15"
}

new 
g_knifeflag[SKINS][] = {
    
"0",
    
"0",
    
"0",
    
"0",
    
"0",
    
"0",
    
"1",
    
"1",
    
"1",
    
"1",
    
"1"
}  

static const 
PORTAL    [ ] = "^4[APB-Knife]^1"
static const DIE    [ ] = "You can not open a shop, you must be alive !"
static const MONEY    [ ] = "You dont have money for this knife skin !"
static const BUY    [ ] = "You bought ^3"

#define PLUGIN "MultiShop - Knife server"
#define VERSION "1.0"
#define AUTHOR "SkillerkoS"

#define NAZEV_PORTALU "aNathrax-Team.eu"
#define VIP_FLAG ADMIN_LEVEL_H


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /knifeshop""cmd_knife")
    
register_clcmd("say /knife""cmd_knife")
    
    
register_event("CurWeapon","Event_CurWeapon","be","1=1");
}

public 
plugin_precache(){
    for (new 
i<= sizeof g_knifemodelsi++)
        
precache_model(g_knifemodels[i]);
}
    
public 
client_putinserver(client)
    
g_knife[client] = 0;

public 
Event_CurWeapon(client){
    
    if (
read_data(2) == CSW_KNIFE)
        
set_pev(client,pev_viewmodel2,g_knifemodels[g_knife[client]]);
    
}

public 
cmd_knife(id){
    new 
szSome[256];
    if(
is_user_alive(id))
    {
        new 
knife menu_create("Select your Knife""cmd_knife_h");
        new 
cb menu_makecallback("knife_callback");
        
        for (new 
i<= SKINS 1i++)
        {
            
formatex(szSome,255,"%s \r[%i$] \y%s",g_knifenames[i],str_to_num(g_knifecosts[i]),(str_to_num(g_knifeflag[i]) ? "[VIP]":""));  
            
menu_additem(knife,szSome,g_knifeflag[i],.callback=cb);
        }    
        
        
menu_display(id,knife);
    }
    
    else
        
ChatColor(id"%s %s"PORTAL, DIE);
}

public 
knife_callback(client,knife,item){
    new 
access,callback,szInfo[8],szName[32];
    
menu_item_getinfo(knife,item,access,szInfo,8,szName,32,callback);
    
    if (
str_to_num(szInfo) == && !(get_user_flags(client) & VIP_FLAG))
        return 
ITEM_DISABLED;
        
    return 
ITEM_ENABLED;
}
    
public 
cmd_knife_h(clientknifeitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(knife);
        return;
    }
    
    if (
cs_get_user_money(client) < str_to_num(g_knifecosts[item]))
    {
        
ChatColor(client,"%s %s",PORTAL,MONEY);
        return;
    }
    
    
cs_set_user_money(client,(cs_get_user_money(client) - str_to_num(g_knifecosts[item])),1);
    
g_knife[client] = item;
    
ChatColor(client,"%s %s%s",PORTAL,BUY,g_knifenames[g_knife[client]]);
}
    
stock ChatColor(const id, const input[], any:...) {
    new 
count 1players32 ]
    static 
msg191 ]
    
vformatmsg190input)
    
    
replace_allmsg190"!g""^4" )
    
replace_allmsg190"!y""^1" )
    
replace_allmsg190"!t""^3" )

    
    if(
idplayers] = id
    else 
get_playersplayerscount"ch" )
    
    for(new 
0counti++)
    {
        if( 
is_user_connectedplayers] ) )
        {
            
message_beginMSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players] )  
            
write_byteplayers] )
            
write_stringmsg )
            
message_end( )
        }
    }

This is my plugin for /knife but i need P_MODELS

HOW TO ADD THAT IN THIS PLUGIN? Somebody i need help for that?
Marin Vojnic is offline
Shiina.Mashiro
Senior Member
Join Date: Sep 2014
Location: Vietnam
Old 08-01-2015 , 12:44   Re: I need help with 1 plugin
Reply With Quote #2

PHP Code:
set_pev(indexpev_weaponmodelP_MODEL
btw I don't really like the way this plugin is made, so I can't help you fix it all.
__________________
Shiina.Mashiro is offline
Marin Vojnic
Junior Member
Join Date: Jul 2010
Old 08-02-2015 , 06:40   Re: I need help with 1 plugin
Reply With Quote #3

Quote:
Originally Posted by Shiina.Mashiro View Post
PHP Code:
set_pev(indexpev_weaponmodelP_MODEL
btw I don't really like the way this plugin is made, so I can't help you fix it all.

Yes, but is there a plugin like this will in itself have for ordinary players and VIPs knife mode?
Marin Vojnic 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 12:02.


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