Raised This Month: $ Target: $400
 0% 

[INC] Fakemeta Utilities [last update: 2007/01/08]


Post New Thread Reply   
 
Thread Tools Display Modes
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 11-21-2008 , 07:23   Re: [INC] Fakemeta Utilities [last update: 2007/01/08]
Reply With Quote #161

It's almost the same thing, but you call them direcly, not through an .dll. Also open cstrike.h, get all the offest and make your own include, or ask connorr.

Hi connorr.
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 11-21-2008 , 10:41   Re: [INC] Fakemeta Utilities [last update: 2007/01/08]
Reply With Quote #162

i know that and i managed yet to convert all native i need on my own but could be nice to add those to fm_util

otherwise gogo connorr, pvdata_util.inc
__________________
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-21-2008 , 12:42   Re: [INC] Fakemeta Utilities [last update: 2007/01/08]
Reply With Quote #163

I have this, some stock may have to be improved.
This is just for information so people could know how to convert some code, like for cs_s/get_user_team, if you use it in your own plugin, you don't need to use those CsTeams things.
PHP Code:
#define EXTRAOFFSET_WEAPONS    4

#define OFFSET_ARMORTYPE            112 
#define OFFSET_TEAM                114 
#define OFFSET_CSMONEY                115 
#define OFFSET_PRIMARYWEAPON            116 
#define OFFSET_LASTACTIVITY            124 
#define OFFSET_INTERNALMODEL            126 
#define OFFSET_NVGOGGLES            129 
#define OFFSET_DEFUSE_PLANT            193 
#define OFFSET_VIP                209 
#define OFFSET_TK                216  // 040926
#define OFFSET_HOSTAGEKILLS            217 
#define OFFSET_MAPZONE                235 
#define OFFSET_ISDRIVING            350  // 040926
#define OFFSET_STATIONARY            362  // 040927 (363 works also!)
#define OFFSET_ZOOMTYPE                363 

#define OFFSET_AWM_AMMO                377  // 041029: All of these *_AMMO:s were changed -5
#define OFFSET_SCOUT_AMMO            378 
#define OFFSET_PARA_AMMO            379 
#define OFFSET_FAMAS_AMMO            380 
#define OFFSET_M3_AMMO                381 
#define OFFSET_USP_AMMO                382 
#define OFFSET_FIVESEVEN_AMMO            383 
#define OFFSET_DEAGLE_AMMO            384 
#define OFFSET_P228_AMMO            385 
#define OFFSET_GLOCK_AMMO            386 
#define OFFSET_FLASH_AMMO            387 
#define OFFSET_HE_AMMO                388 
#define OFFSET_SMOKE_AMMO            389 
#define OFFSET_C4_AMMO                390    

#define OFFSET_CSDEATHS                444  // 040926
#define OFFSET_SHIELD                510 

// "weapon_*" entities
#define OFFSET_WEAPONTYPE        43
#define OFFSET_CLIPAMMO            51
#define OFFSET_SILENCER_FIREMODE    74

// "hostage_entity" entities
#define OFFSET_HOSTAGEFOLLOW        86 
#define OFFSET_HOSTAGE_NEXTUSE        100 
#define OFFSET_HOSTAGE_LASTUSE        483 
#define OFFSET_HOSTAGEID        487 

// "armoury_entity"
#define OFFSET_ARMOURY_TYPE        34

// C4 offsets
#define OFFSET_C4_EXPLODE_TIME        100 
#define OFFSET_C4_DEFUSING        0x181

#define HAS_SHIELD      (1<<24)

#define M4A1_SILENCED                (1<<2)
#define M4A1_ATTACHSILENCEANIM            6
#define M4A1_DETACHSILENCEANIM            13
#define USP_SILENCED                (1<<0)
#define USP_ATTACHSILENCEANIM            7
#define USP_DETACHSILENCEANIM            15

#define GLOCK_SEMIAUTOMATIC                0
#define GLOCK_BURSTMODE                    2
#define FAMAS_AUTOMATIC                    0
#define FAMAS_BURSTMODE                    16

#define PLAYER_IS_VIP                    (1<<8)

#define PLAYER_IN_BUYZONE                (1<<0)

#define CS_MAPZONE_BUY             (1<<0)
#define CS_MAPZONE_BOMBTARGET         (1<<1)
#define CS_MAPZONE_HOSTAGE_RESCUE     (1<<2)
#define CS_MAPZONE_ESCAPE        (1<<3)
#define CS_MAPZONE_VIP_SAFETY         (1<<4)

/*#define TEAM_UNASSIGNED                    0
*#define TEAM_T                        1
*#define TEAM_CT                        2
*#define TEAM_SPECTATOR                    3*/

#define CAN_PLANT_BOMB                    (1<<8) // 256
#define HAS_DEFUSE_KIT                    (1<<16) // 65536

#define DEFUSER_COLOUR_R                0
#define DEFUSER_COLOUR_G                160
#define DEFUSER_COLOUR_B                0

#define HAS_NVGOGGLES                    (1<<0)

#define SCOREATTRIB_NOTHING                0
#define SCOREATTRIB_DEAD                1
#define SCOREATTRIB_BOMB                2 // t only
#define SCOREATTRIB_VIP                    4

/*#define CS_ARMOR_NONE                0
#define CS_ARMOR_KEVLAR                1*/
#define CS_ARMOR_ASSAULTSUIT            2

#define CS_FIRST_ZOOM                0x28
#define CS_SECOND_AWP_ZOOM            0xA
#define CS_SECOND_NONAWP_ZOOM            0xF
#define CS_AUGSG552_ZOOM            0x37
#define CS_NO_ZOOM                0x5A

#define cs_get_user_buyzone(%1)    (get_pdata_int(%1,OFFSET_MAPZONE)&PLAYER_IN_BUYZONE)
#define cs_get_user_hasprim(%1) get_pdata_int(%1,OFFSET_PRIMARYWEAPON)
#define cs_get_user_mapzones(%1)    get_pdata_int(%1,OFFSET_MAPZONE)
#define cs_get_user_plant(%1)    (get_pdata_int(%1,OFFSET_DEFUSE_PLANT)&CAN_PLANT_BOMB)
#define cs_get_user_tked(%1)    get_pdata_int(%1,OFFSET_TK)
#define cs_get_user_deaths(%1)    get_pdata_int(%1,OFFSET_CSDEATHS)
#define cs_get_user_defuse(%1)    (get_pdata_int(%1,OFFSET_DEFUSE_PLANT)&HAS_DEFUSE_KIT)
#define cs_get_user_driving(%1)    get_pdata_int(%1, OFFSET_ISDRIVING)
#define cs_get_user_money(%1)        get_pdata_int(%1,OFFSET_CSMONEY)
#define cs_get_user_nvg(%1)    (get_pdata_int(%1,OFFSET_NVGOGGLES) & HAS_NVGOGGLES)
#define cs_get_user_shield(%1)    (get_pdata_int(%1,OFFSET_SHIELD)&HAS_SHIELD)
#define cs_get_user_stationary(%1)    get_pdata_int(%1,OFFSET_STATIONARY)
#define cs_get_user_vip(%1) (get_pdata_int(id, OFFSET_VIP) & PLAYER_IS_VIP)

#define cs_get_weapon_id(%1) get_pdata_int(%1,OFFSET_WEAPONTYPE,EXTRAOFFSET_WEAPONS)
#define cs_get_weapon_ammo(%1)    get_pdata_int(%1,OFFSET_CLIPAMMO,EXTRAOFFSET_WEAPONS)
#define cs_set_weapon_ammo(%1,%2)    set_pdata_int(%1,OFFSET_CLIPAMMO,%2,EXTRAOFFSET_WEAPONS)

enum CsTeams {
    
CS_TEAM_UNASSIGNED,
    
CS_TEAM_T,
    
CS_TEAM_CT,
    
CS_TEAM_SPECTATOR
};

enum CS_Internal_Models {
    
CS_DONTCHANGE 0,
    
CS_CT_URBAN 1,
    
CS_T_TERROR 2,
    
CS_T_LEET 3,
    
CS_T_ARCTIC 4,
    
CS_CT_GSG9 5,
    
CS_CT_GIGN 6,
    
CS_CT_SAS 7,
    
CS_T_GUERILLA 8,
    
CS_CT_VIP 9,
    
CZ_T_MILITIA 10,
    
CZ_CT_SPETSNAZ 11
};

enum
{
    
CS_RESET_ZOOM 0,
    
CS_SET_NO_ZOOM,
    
CS_SET_FIRST_ZOOM,
    
CS_SET_SECOND_ZOOM,
    
CS_SET_AUGSG552_ZOOM,
};

enum CsArmorType {
    
CS_ARMOR_NONE 0// no armor
    
CS_ARMOR_KEVLAR 1// armor
    
CS_ARMOR_VESTHELM // armor and helmet
};

stock cs_get_user_armor(id, &CsArmorType:iArmorType)
{
    new 
Float:flArmorValue;
    
pev(idpev_armorvalueflArmorValue);

    
iArmorType CsArmorType:get_pdata_int(idOFFSET_ARMORTYPE);

    return 
floatround(flArmorValue);
}

stock cs_set_user_armor(idiArmorValueCsArmorType:iArmorType)
{
    
set_pdata_int(id OFFSET_ARMORTYPE_:iArmorType);
    
set_pev(idpev_armorvaluefloat(_:iArmorValue));

    if ( 
iArmorType )
    {
        static 
iMsgArmorType;
        if( !
iMsgArmorType )
        {
            
iMsgArmorType get_user_msgid("ArmorType");
        }
        
message_beginMSG_ONE_UNRELIABLE iMsgArmorType id );
        
write_byteiArmorType == CS_ARMOR_VESTHELM );
        
message_end();
    }
}

stock cs_get_user_bpammo(idiWeapon)
{
    new 
iOffset;
    switch(
iWeapon)
    {
        case 
CSW_AWPiOffset OFFSET_AWM_AMMO;
        case 
CSW_SCOUTCSW_AK47CSW_G3SG1iOffset OFFSET_SCOUT_AMMO;
        case 
CSW_M249iOffset OFFSET_PARA_AMMO;
        case 
CSW_FAMASCSW_M4A1CSW_AUGCSW_SG550CSW_GALICSW_SG552iOffset OFFSET_FAMAS_AMMO;
        case 
CSW_M3CSW_XM1014iOffset OFFSET_M3_AMMO;
        case 
CSW_USPCSW_UMP45CSW_MAC10iOffset OFFSET_USP_AMMO;
        case 
CSW_FIVESEVENCSW_P90iOffset OFFSET_FIVESEVEN_AMMO;
        case 
CSW_DEAGLEiOffset OFFSET_DEAGLE_AMMO;
        case 
CSW_P228iOffset OFFSET_P228_AMMO;
        case 
CSW_GLOCK18CSW_MP5NAVYCSW_TMPCSW_ELITEiOffset OFFSET_GLOCK_AMMO;
        case 
CSW_FLASHBANGiOffset OFFSET_FLASH_AMMO;
        case 
CSW_HEGRENADEiOffset OFFSET_HE_AMMO;
        case 
CSW_SMOKEGRENADEiOffset OFFSET_SMOKE_AMMO;
        case 
CSW_C4iOffset OFFSET_C4_AMMO;
        default:return 
0;
    }
    return 
get_pdata_int(idiOffset);
}

stock cs_set_user_bpammo(idiWeaponiAmount)
{
    new 
iOffset;
    switch(
iWeapon)
    {
        case 
CSW_AWPiOffset OFFSET_AWM_AMMO;
        case 
CSW_SCOUTCSW_AK47CSW_G3SG1iOffset OFFSET_SCOUT_AMMO;
        case 
CSW_M249iOffset OFFSET_PARA_AMMO;
        case 
CSW_FAMASCSW_M4A1CSW_AUGCSW_SG550CSW_GALICSW_SG552iOffset OFFSET_FAMAS_AMMO;
        case 
CSW_M3CSW_XM1014iOffset OFFSET_M3_AMMO;
        case 
CSW_USPCSW_UMP45CSW_MAC10iOffset OFFSET_USP_AMMO;
        case 
CSW_FIVESEVENCSW_P90iOffset OFFSET_FIVESEVEN_AMMO;
        case 
CSW_DEAGLEiOffset OFFSET_DEAGLE_AMMO;
        case 
CSW_P228iOffset OFFSET_P228_AMMO;
        case 
CSW_GLOCK18CSW_MP5NAVYCSW_TMPCSW_ELITEiOffset OFFSET_GLOCK_AMMO;
        case 
CSW_FLASHBANGiOffset OFFSET_FLASH_AMMO;
        case 
CSW_HEGRENADEiOffset OFFSET_HE_AMMO;
        case 
CSW_SMOKEGRENADEiOffset OFFSET_SMOKE_AMMO;
        case 
CSW_C4iOffset OFFSET_C4_AMMO;
        default:return;
    }
    
set_pdata_int(idiOffsetiAmount);
}

stock cs_set_user_plant(idplant 1showbombicon 1backpack 0)
{
    static 
iMsgStatusIcon;
    if( !
iMsgStatusIcon )
    {
        
iMsgStatusIcon get_user_msgid("StatusIcon");
    }

    if( 
plant )
    {
        if(
backpack)
        {
            
set_pev(idpev_body1);
        }

        
set_pdata_int(id,OFFSET_DEFUSE_PLANTcs_get_user_plant(id) | CAN_PLANT_BOMB);
        if( 
showbombicon )
        {
            
message_begin(MSG_ONE_UNRELIABLEiMsgStatusIcon_id);
            
write_byte(1);
            
write_string("c4");
            
write_byte(DEFUSER_COLOUR_R);
            
write_byte(DEFUSER_COLOUR_G);
            
write_byte(DEFUSER_COLOUR_B);
            
message_end();
        }
    }
    else
    {
        
set_pdata_int(id,OFFSET_DEFUSE_PLANTcs_get_user_plant(id) & ~CAN_PLANT_BOMB);
        
message_begin(MSG_ONE_UNRELIABLEiMsgStatusIcon_id);
        
write_byte(0);
        
write_string("c4");
        
message_end();

        if(
backpack)
        {
            
set_pev(idpev_body0);
        }
    }
}

stock cs_set_user_tked(idtk 1subtract 1)
{
    
set_pdata_int(idOFFSET_TKtk 0);

    if( 
substract )
    {
        static 
Float:flFrags;
        
pev(idpev_fragsflFrags);
        
flFrags -= float(subtract);
        
set_pev(idpev_fragsflFrags);

        static 
iMsgScoreInfo;
        if( 
iMsgScoreInfo || (iMsgScoreInfo get_user_msgid("ScoreInfo")) )
        {
            
message_begin(MSG_BROADCASTiMsgScoreInfo);
            
write_byte(id);
            
write_short(floatround(flFrags));
            
write_short(cs_get_user_deaths(%1));
            
write_short(0);
            
write_short(cs_get_user_team(id));
            
message_end();
        }
    }
}

stock cs_user_spawn(id)
{
    
set_pev(idpev_deadflagDEAD_RESPAWNABLE);
    
dllfunc(DLLFunc_Spawnid);
    
set_pev(idpev_iuser10);
}

stock cs_set_user_deaths(idiDeaths)
{
    
set_pdata_int(idOFFSET_CSDEATHSiDeaths);

    static 
iMsgScoreInfo;

    static 
Float:flFrags;
    
pev(idpev_healthflFrags);

    if( 
iMsgScoreInfo || (iMsgScoreInfo get_user_msgid("ScoreInfo")) )
    {
        
message_begin(MSG_BROADCASTiMsgScoreInfo);
        
write_byte(id);
        
write_short(floatround(flFrags));
        
write_short(iDeaths);
        
write_short(0);
        
write_short(_:cs_get_user_team(id));
        
message_end();
    }
}

stock cs_set_user_defuse(idiDefusekit 1iRed 0iGreen 160iBlue 0icon[] = "defuser"iFlash 0)
{
    static 
iMsgStatusIcon;
    if( 
iMsgStatusIcon || (iMsgStatusIcon get_user_msgid("StatusIcon")) )
    {

        if( 
iDefusekit )
        {
            
set_pev(idpev_body1);

            
set_pdata_int(idOFFSET_DEFUSE_PLANTget_pdata_int(idOFFSET_DEFUSE_PLANT) | HAS_DEFUSE_KIT);

            
message_begin(MSG_ONE_UNRELIABLEiMsgStatusIcon_id);
            
write_byte(iFlash 1);
            
write_string(icon);
            
write_byte(iRed);
            
write_byte(iGreen);
            
write_byte(iBlue);
            
message_end();
        }
        else
        {
            
set_pdata_int(idOFFSET_DEFUSE_PLANTget_pdata_int(idOFFSET_DEFUSE_PLANT) & ~HAS_DEFUSE_KIT);

            
message_begin(MSG_ONE_UNRELIABLEiMsgStatusIcon_id);
            
write_byte(0);
            
write_string(icon);
            
message_end();

            
set_pev(idpev_body0);
        }
    }
}

stock cs_set_user_money(idiMoneyiFlash 0)
{
    
set_pdata_int(id,OFFSET_CSMONEY,iMoney);

    static 
iMsgMoney;
    if( 
iMsgMoney || (iMsgMoney get_user_msgid("Money")) )
    {
        
message_begin(MSG_ONE_UNRELIABLEiMsgMoney_id);
        
write_long(iMoney);
        
write_byte(iFlash 0);
        
message_end();
    }
}

stock cs_set_user_nvg(idnvgoggles 1)
{
    if( 
nvgoggles )
    {
        
set_pdata_int(idOFFSET_NVGOGGLESget_pdata_int(id,OFFSET_NVGOGGLES) | HAS_NVGOGGLES);
    }
    else
    {
        
set_pdata_int(idOFFSET_NVGOGGLESget_pdata_int(id,OFFSET_NVGOGGLES) & ~HAS_NVGOGGLES);
    }
}

stock CsTeams:cs_get_user_team(id, &{CsInternalModel,_}:iModel CsInternalModel:CS_DONTCHANGE)
{
    
iModel CsInternalModel:get_pdata_int(idOFFSET_INTERNALMODEL);
    return 
CsTeams:get_pdata_int(idOFFSET_TEAM);
}

stock cs_set_user_team(id, {CsTeams,_}:iTeam, {CsInternalModel,_}:iModel CsInternalModel:CS_DONTCHANGE)
{
    if( 
iTeam CS_TEAM_SPECTATOR )
        return;

    
set_pdata_int(idOFFSET_TEAM_:iTeam);

    if( 
iModel )
    {
        
set_pdata_int(idOFFSET_INTERNALMODEL_:iModel);
    }

    
dllfunc(DLLFunc_ClientUserInfoChangedidengfunc(EngFunc_GetInfoKeyBufferid));

    static const 
szTeams[] = { "UNASSIGNED" "TERRORIST" "CT" "SPECTATOR" };

    static 
iMsgTeamInfo;
    if( 
iMsgTeamInfo || (iMsgTeamInfo get_user_msgid("TeamInfo")) )
    {
        
emessage_begin(MSG_ALLiMsgTeamInfo);
        
ewrite_byte(id);
        
ewrite_string(szTeams[_:iTeam]);
        
emessage_end();
    }
}

stock cs_get_weapon_silen(index)
{
    switch( 
cs_get_weapon_id(index) )
    {
        case 
CSW_M4A1:
        {
            return (
get_pdata_int(index,OFFSET_SILENCER_FIREMODE,EXTRAOFFSET_WEAPONS) & M4A1_SILENCED);
        }
        case 
CSW_USP:
        {
            return (
get_pdata_int(index,OFFSET_SILENCER_FIREMODE,EXTRAOFFSET_WEAPONS) & USP_SILENCED);
        }
    }
    return 
0;
}

stock cs_set_weapon_silen(indexsilence 1draw_animation 1)
{
    switch(
cs_get_weapon_id(index))
    {
        case 
CSW_M4A1:
        {
            new 
silencemode get_pdata_int(index,OFFSET_SILENCER_FIREMODE,EXTRAOFFSET_WEAPONS);
            if(
silence)
            {
                if (!(
silencemode M4A1_SILENCED)) 
                {
                    
silencemode |= M4A1_SILENCED;
                    
set_pdata_int(index,OFFSET_SILENCER_FIREMODE,silencemode,EXTRAOFFSET_WEAPONS);

                    if (
draw_animation)
                    {
                        new 
id pev(indexpev_owner);
                        if( 
id )
                        {
                            
set_pev(idpev_weaponanimM4A1_ATTACHSILENCEANIM);
                        }
                    }
                }
            }
            else if(
silencemode M4A1_SILENCED)
            {
                
silencemode &= ~M4A1_SILENCED;
                
set_pdata_int(index,OFFSET_SILENCER_FIREMODE,silencemode,EXTRAOFFSET_WEAPONS);

                if (
draw_animation)
                {
                    new 
id pev(indexpev_owner);
                    if( 
id )
                    {
                        
set_pev(idpev_weaponanimM4A1_DETACHSILENCEANIM);
                    }
                }
            }
        }
        case 
CSW_USP:
        {
            new 
silencemode get_pdata_int(index,OFFSET_SILENCER_FIREMODE,EXTRAOFFSET_WEAPONS);
            if (
silence)
            {
                if (!(
silencemode USP_SILENCED))
                {
                    
silencemode |= USP_SILENCED;
                    
set_pdata_int(index,OFFSET_SILENCER_FIREMODE,silencemode,EXTRAOFFSET_WEAPONS);

                    if (
draw_animation)
                    {
                        new 
id pev(indexpev_owner);
                        if( 
id )
                        {
                            
set_pev(idpev_weaponanimUSP_ATTACHSILENCEANIM);
                        }
                    }
                }
            }
            else if (
silencemode USP_SILENCED)
            {
                
silencemode &= ~USP_SILENCED;
                
set_pdata_int(index,OFFSET_SILENCER_FIREMODE,silencemode,EXTRAOFFSET_WEAPONS);

                if (
draw_animation)
                {
                    new 
id pev(indexpev_owner);
                    if( 
id )
                    {
                        
set_pev(idpev_weaponanimUSP_DETACHSILENCEANIM);
                    }
                }
            }
        }
        default:return 
0;
    }

    return 
1;
}

stock cs_get_weapon_burstmode(index)
{
    switch(
cs_get_weapon_id(index))
    {
        case 
CSW_GLOCK18:
        {
            return (
get_pdata_int(index,OFFSET_SILENCER_FIREMODE,EXTRAOFFSET_WEAPONS) == GLOCK_BURSTMODE);
        }
        case 
CSW_FAMAS:
        {
            return (
get_pdata_int(index,OFFSET_SILENCER_FIREMODE,EXTRAOFFSET_WEAPONS) == FAMAS_BURSTMODE);
        }
    }
    return 
0;
}

stock cs_set_weapon_burst(indexburstmode 1)
{
    switch (
cs_get_weapon_id(index))
    {
        case 
CSW_GLOCK18:
        {
            if (
burstmode)
            {
                if (
get_pdata_int(index,OFFSET_SILENCER_FIREMODE,EXTRAOFFSET_WEAPONS) != GLOCK_BURSTMODE)
                {
                    
set_pdata_int(index,OFFSET_SILENCER_FIREMODE,GLOCK_BURSTMODE,EXTRAOFFSET_WEAPONS);

                    new 
id pev(indexpev_owner);
                    if( 
id )
                    {
                        
client_print(idprint_center"#Switch_To_BurstFire");
                    }
                }
            }
            else if (
get_pdata_int(index,OFFSET_SILENCER_FIREMODE,EXTRAOFFSET_WEAPONS) != GLOCK_SEMIAUTOMATIC)
            {
                
set_pdata_int(index,OFFSET_SILENCER_FIREMODE,GLOCK_SEMIAUTOMATIC,EXTRAOFFSET_WEAPONS);

                new 
id pev(indexpev_owner);
                if( 
id )
                {
                    
client_print(idprint_center"#Switch_To_SemiAuto");
                }
            }
        }
        case 
CSW_FAMAS:
        {
            if (
burstmode)
            {
                if (
get_pdata_int(index,OFFSET_SILENCER_FIREMODE,EXTRAOFFSET_WEAPONS) != FAMAS_BURSTMODE)
                {
                    
set_pdata_int(index,OFFSET_SILENCER_FIREMODE,FAMAS_BURSTMODE,EXTRAOFFSET_WEAPONS);

                    new 
id pev(indexpev_owner);
                    if( 
id )
                    {
                        
client_print(idprint_center"#Switch_To_BurstFire");
                    }
                }
            }
            else if (
get_pdata_int(index,OFFSET_SILENCER_FIREMODE,EXTRAOFFSET_WEAPONS) != FAMAS_AUTOMATIC)
            {
                
set_pdata_int(index,OFFSET_SILENCER_FIREMODE,FAMAS_AUTOMATIC,EXTRAOFFSET_WEAPONS);

                new 
id pev(indexpev_owner);
                if( 
id )
                {
                    
client_print(idprint_center"#Switch_To_FullAuto");
                }
            }
        }
        default:
        {
            return 
0;
        }
    }

    return 
1;
}

stock cs_set_user_vip(indexvip 1updateModel 1updateScoreboard 1)
{
    if (
vip)
    {
        
set_pdata_int(id,OFFSET_VIPget_pdata_int(id,OFFSET_VIP)|PLAYER_IS_VIP);

        if (
updateModel)
        {
            
set_pdata_int(id,OFFSET_INTERNALMODEL_:CS_CT_VIP);
            
dllfunc(DLLFunc_ClientUserInfoChangedidengfunc(EngFunc_GetInfoKeyBufferid));
        }

        if (
updateScoreboard)
        {
            static 
iMsgScoreAttrib
            
if( iMsgScoreAttrib || (iMsgScoreAttrib get_user_msgid("ScoreAttrib")) )
            {
                
message_begin(MSG_BROADCASTiMsgScoreAttrib);
                
write_byte(id);
                
write_byte(SCOREATTRIB_VIP);
                
message_end();
            }
        }
    }
    else
    {
        
set_pdata_int(id,OFFSET_VIPget_pdata_int(id,OFFSET_VIP) &= ~PLAYER_IS_VIP);

        if (
updateModel)
        {
            
set_pdata_int(id,OFFSET_INTERNALMODEL_:CS_CT_GIGN); // hardcoded to gign model
            
dllfunc(DLLFunc_ClientUserInfoChangedidengfunc(EngFunc_GetInfoKeyBufferid));
        }

        if (
updateScoreboard)
        {
            static 
iMsgScoreAttrib
            
if( iMsgScoreAttrib || (iMsgScoreAttrib get_user_msgid("ScoreAttrib")) )
            {
                
message_begin(MSG_BROADCASTiMsgScoreAttrib);
                
write_byte(id);
                
write_byte(is_user_alive(id) ? SCOREATTRIB_NOTHING SCOREATTRIB_DEAD);
                
message_end();
            }
        }
    }

    return 
1;

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
AcidoX
Senior Member
Join Date: Oct 2007
Location: Vilnius
Old 01-26-2009 , 19:22   Re: [INC] Fakemeta Utilities [last update: 2007/01/08]
Reply With Quote #164

FM util updated.

Edit: Updated
Added cs.inc (Credits ConnorMcLeod)

Edit2: Update2
Added fakeengine.irc (Credits anakin_cstrike)
Added chr_engine.inc (Credits GHW_Chronic)
Attached Files
File Type: inc fakemeta_util.inc (25.1 KB, 262 views)
File Type: inc cs.inc (20.7 KB, 257 views)
File Type: inc fakeengine.inc (2.2 KB, 252 views)
File Type: inc chr_engine.inc (16.2 KB, 243 views)
__________________
Who need lockerz invite? Pm me.

Last edited by AcidoX; 01-29-2009 at 16:50.
AcidoX is offline
Send a message via Skype™ to AcidoX
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-26-2009 , 19:30   Re: [INC] Fakemeta Utilities [last update: 2007/01/08]
Reply With Quote #165

What did you change/add?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 01-27-2009 , 03:00   Re: [INC] Fakemeta Utilities [last update: 2007/01/08]
Reply With Quote #166

He added:
Code:
#define fm_set_lights(%1) engfunc(EngFunc_LghtStlye, 0, %1) 
/* stock fm_set_lights(const Lighting[])     return  engfunc(EngFunc_LightStyle, 0, Lighting) */
but it should be
Code:
#define fm_set_lights(%1) engfunc(EngFunc_LightStyle, 0, %1) 
/* stock fm_set_lights(const Lighting[])     return  engfunc(EngFunc_LightStyle, 0, Lighting) */
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
AcidoX
Senior Member
Join Date: Oct 2007
Location: Vilnius
Old 01-27-2009 , 06:52   Re: [INC] Fakemeta Utilities [last update: 2007/01/08]
Reply With Quote #167

Well, im adding FM util functions from the forum, because no one is updating it.

Updated my post on top.
__________________
Who need lockerz invite? Pm me.

Last edited by AcidoX; 01-29-2009 at 16:47.
AcidoX is offline
Send a message via Skype™ to AcidoX
karceWZROKIEM
Junior Member
Join Date: Sep 2008
Location: Poland
Old 10-26-2009 , 11:40   Re: [INC] Fakemeta Utilities ready to be the AMXX default!
Reply With Quote #168

Quote:
Originally Posted by VEN View Post
The function gets what weapon type (CSW_*) a "grenade" entity is.
"grenade" entity is either the throwed grenade or the planted C4.

Returns 0 on failure. Win32 only. Provided as is (no warranties).
It's similar to the cs_get_armoury_type which work for "armoury_entity".

This function are useful because the old model check method aren't practical.
1. The model could be changed to the custom one by the 3rd party addon.
2. There are the moments when the grenade doesn't have the model (on explosion).

You shouldn't use the offsets and it's values for altering the grenade type.
This is not the data which controls the actual type, neither i think it's possible
to alter the type that way.

I'm not including this to the fakemeta_util.inc at least because it's win32 only.
I do realise that there are probably the more evident way but at least this work.
If you think something is incorrect or needs to be improved, feel free to post.
Code:
stock fm_cs_get_grenade_type(index) { // you can comment/remove this // if you are sure that the entity // with the given index are valid if (!pev_valid(index)) return 0 // you can comment/remove this // if you are sure that the entity // with the given index are "grenade" new classname[9] pev(index, pev_classname, classname, 8) if (!equal(classname, "grenade")) return 0 if (get_pdata_int(index, 96) & (1<<8)) return CSW_C4

new bits = get_pdata_int(index, 114) if (bits & (1<<0)) return CSW_HEGRENADE
else if (bits & (1<<1)) return CSW_SMOKEGRENADE
else if (!bits) return CSW_FLASHBANG

return 0 }

for both get_pdata_int OFFSET should be 5 not (default) 4....
__________________
"Smoking" or Drinking - THE Choice is Yours
I don't drink
karceWZROKIEM is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-26-2009 , 11:48   Re: [INC] Fakemeta Utilities ready to be the AMXX default!
Reply With Quote #169

Quote:
Originally Posted by karceWZROKIEM View Post
for both get_pdata_int OFFSET should be 5 not (default) 4....
I would LOVE to see you prove VEN wrong.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-26-2009 , 12:02   Re: [INC] Fakemeta Utilities [last update: 2007/01/08]
Reply With Quote #170

By default get_pdata_int uses +5 as extra offset for linux.

Since this offset is related to the weapon, it would be +4.

Connor has tested and confirmed that it works fine with +4.
__________________
Arkshine 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 14:14.


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