Raised This Month: $ Target: $400
 0% 

offset for grenades, fakemeta


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 03-11-2009 , 07:21   offset for grenades, fakemeta
Reply With Quote #1

PHP Code:
#define OFFSET_AMMO_338MAGNUM 377
#define OFFSET_AMMO_762NATO 378
#define OFFSET_AMMO_556NATOBOX 379
#define OFFSET_AMMO_556NATO 380
#define OFFSET_AMMO_BUCKSHOT 381
#define OFFSET_AMMO_45ACP 382
#define OFFSET_AMMO_57MM 383
#define OFFSET_AMMO_50AE 384
#define OFFSET_AMMO_357SIG 385
#define OFFSET_AMMO_9MM 386
 
#define fm_set_weapon_ammo(%1,%2) set_pdata_int(%1, OFFSET_CLIPAMMO, %2, 4) 
what's the offset for grenades ? :}
__________________
Hunter-Digital is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 03-11-2009 , 07:28   Re: offset for grenades, fakemeta
Reply With Quote #2

Code:
#define OFFSET_FLASH_AMMO            387
#define OFFSET_HE_AMMO                388
#define OFFSET_SMOKE_AMMO            389
__________________

anakin_cstrike is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 03-11-2009 , 08:08   Re: offset for grenades, fakemeta
Reply With Quote #3

thanks
but where did you get it from ? :-?
__________________
Hunter-Digital is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-11-2009 , 08:13   Re: offset for grenades, fakemeta
Reply With Quote #4

cstrike.h
Arkshine is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 03-11-2009 , 17:39   Re: offset for grenades, fakemeta
Reply With Quote #5

Quote:
Originally Posted by Hunter-Digital View Post
thanks
but where did you get it from ? :-?
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;

__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 03-11-2009 , 17:54   Re: offset for grenades, fakemeta
Reply With Quote #6

what file is that tuty ? I can't find such defines and functions in my include files :-?
__________________
Hunter-Digital is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 03-11-2009 , 17:57   Re: offset for grenades, fakemeta
Reply With Quote #7

Quote:
Originally Posted by tuty View Post
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;

Are you serious?

A. You could've just tell him in what plugin(s) can he find the offsets.

B. What arkshine posted is more than enough.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-11-2009 , 19:42   Re: offset for grenades, fakemeta
Reply With Quote #8

Quote:
Originally Posted by Hunter-Digital View Post
what file is that tuty ? I can't find such defines and functions in my include files :-?
Quote:
Originally Posted by arkshine View Post
It's the same file as arkshine posted.
__________________
fysiks is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 03-12-2009 , 00:48   Re: offset for grenades, fakemeta
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
It's the same file as arkshine posted.
Um, no it's not.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 03-12-2009 , 01:15   Re: offset for grenades, fakemeta
Reply With Quote #10

Quote:
Originally Posted by arkshine View Post
uh... *slaps forehead*

I guess I've been living in a cave ;_;
__________________
stupok 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 08:56.


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