Raised This Month: $ Target: $400
 0% 

trying to make new items for TTT


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
need help quickly
Junior Member
Join Date: Jan 2016
Old 07-02-2016 , 05:55   trying to make new items for TTT
Reply With Quote #1

well i was trying to make a new item for TTT 2.5.2 from gusKis and i start to make one from the existing item AWP but i dont know why when i compile this .sma i its take me error
PHP Code:
#include <amxmodx>
#include <engine>
#include <cs_weapons_api>
#include <amx_settings_api>
#include <ttt>

#define WEAPON_CSWID CSW_M4A1
#define WEAPON_NAME "weapon_m4a1"

new g_iItemID;
new 
g_szModels[3][TTT_FILELENGHT];
new 
cvar_weapon_damagecvar_weapon_speedcvar_weapon_ammocvar_weapon_clipcvar_weapon_pricecvar_weapon_reloadcvar_weapon_recoil;

public 
plugin_precache()
{
    if(!
amx_load_setting_string(TTT_SETTINGSFILE"M4A1""MODEL_V"g_szModels[0], charsmax(g_szModels[])))
    {
        
g_szModels[0] = "models/v_m4a1.mdl";
        
amx_save_setting_string(TTT_SETTINGSFILE"M4A1""MODEL_V"g_szModels[0]);
    }
    
precache_model(g_szModels[0]);

    if(!
amx_load_setting_string(TTT_SETTINGSFILE"M4A1""MODEL_P"g_szModels[1], charsmax(g_szModels[])))
    {
        
g_szModels[1] = "models/p_m4a1.mdl";
        
amx_save_setting_string(TTT_SETTINGSFILE"M4A1""MODEL_P"g_szModels[1]);
    }
    
precache_model(g_szModels[1]);

    if(!
amx_load_setting_string(TTT_SETTINGSFILE"M4A1""MODEL_W"g_szModels[2], charsmax(g_szModels[])))
    {
        
g_szModels[2] = "models/w_m4a1.mdl";
        
amx_save_setting_string(TTT_SETTINGSFILE"M4A1""MODEL_W"g_szModels[2]);
    }
    
precache_model(g_szModels[2]);
}

public 
plugin_init()
{
    
register_plugin("[TTT] Item: M4A1"TTT_VERSIONTTT_AUTHOR);

    
cvar_weapon_clip    my_register_cvar("ttt_awp_clip",        "30",    "AWP clip ammo. (Default: 1)");
    
cvar_weapon_ammo    my_register_cvar("ttt_awp_ammo",        "30",    "AWP backpack ammo. (Default: 15)");
    
cvar_weapon_speed    my_register_cvar("ttt_awp_speed",        "1",    "AWP attack speed delay. (Default: 0.0)");
    
cvar_weapon_damage    my_register_cvar("ttt_awp_damage",    "1.0",    "AWP damage multiplier. (Default: 1.0)");
    
cvar_weapon_reload    my_register_cvar("ttt_awp_reload",    "0.0",    "AWP reloadspeed delay. (Default: 0.0)");
    
cvar_weapon_recoil    my_register_cvar("ttt_awp_recoil",    "0.0",    "AWP recoil multiplier. (Default: 0.0)");
    
cvar_weapon_price    my_register_cvar("ttt_price_awp",        "1",    "AWP price. (Default: 1)");
}

public 
ttt_plugin_cfg()
{
    new 
name[TTT_ITEMLENGHT];
    
formatex(namecharsmax(name), "%L"LANG_PLAYER"TTT_ITEM_ID16");
    
g_iItemID ttt_buymenu_add(nameget_pcvar_num(cvar_weapon_price), PC_DETECTIVE);
}

public 
ttt_item_selected(iditemname[], price)
{
    if(
g_iItemID == item)
    {
        if(
user_has_weapon(idWEAPON_CSWID))
            
engclient_cmd(id"drop"WEAPON_NAME);

        static 
data[STOREABLE_STRUCTURE];
        if(!
data[STRUCT_CSWA_CSW])
        {
            
data[STRUCT_CSWA_ITEMID] = g_iItemID;
            
data[STRUCT_CSWA_CSW] = WEAPON_CSWID;
            
data[STRUCT_CSWA_CLIP] = get_pcvar_num(cvar_weapon_clip);
            
data[STRUCT_CSWA_MAXCLIP] = get_pcvar_num(cvar_weapon_clip);
            
data[STRUCT_CSWA_AMMO] = get_pcvar_num(cvar_weapon_ammo);
            
data[STRUCT_CSWA_STACKABLE] = true;
            
data[STRUCT_CSWA_SILENCED] = -1;
            
data[STRUCT_CSWA_SPEEDDELAY] = _:get_pcvar_float(cvar_weapon_speed);
            
data[STRUCT_CSWA_DAMAGE] = _:get_pcvar_float(cvar_weapon_damage);
            
data[STRUCT_CSWA_RELOADTIME] = _:get_pcvar_float(cvar_weapon_reload);
            
data[STRUCT_CSWA_RECOIL] = _:get_pcvar_float(cvar_weapon_recoil);
            
data[STRUCT_CSWA_MODEL_V] = g_szModels[0];
            
data[STRUCT_CSWA_MODEL_P] = g_szModels[1];
            
data[STRUCT_CSWA_MODEL_W] = g_szModels[2];
        }

        
cswa_give_specific(iddata);

        
client_print_color(idprint_team_default"%s %L"TTT_TAGid"TTT_ITEM2"nameid"TTT_ITEM5");
        return 
PLUGIN_HANDLED;
    }

    return 
PLUGIN_CONTINUE;


Last edited by need help quickly; 07-02-2016 at 07:13.
need help quickly is offline
 



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 11:17.


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