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

trying to make new items for TTT


Post New Thread Reply   
 
Thread Tools Display Modes
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
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-02-2016 , 06:55   Re: trying to make new items for TTT
Reply With Quote #2

1. Tell us what the error is.
2. Make that code readable by putting it in [php] tags.
__________________

Last edited by OciXCrom; 07-02-2016 at 16:15.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
need help quickly
Junior Member
Join Date: Jan 2016
Old 07-02-2016 , 07:15   Re: trying to make new items for TTT
Reply With Quote #3

screenshot is better than nothing ^^ here is the screen "http://imgur.com/a/U0tLL"
need help quickly is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-02-2016 , 15:16   Re: trying to make new items for TTT
Reply With Quote #4

The errors are not in that code. They are in amx_settings_api.inc. Download that file from here.
__________________

Last edited by OciXCrom; 07-02-2016 at 16:14.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
need help quickly
Junior Member
Join Date: Jan 2016
Old 07-03-2016 , 04:31   Re: trying to make new items for TTT
Reply With Quote #5

ty a lot bro. works ^^
need help quickly 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 03:38.


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