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

Help with napalm nades


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wEEk
Senior Member
Join Date: Sep 2012
Old 04-27-2016 , 09:51   Help with napalm nades
Reply With Quote #1

Hello, i want you to help me when buy the Granada is the fire for use in a menu , without having to use natives

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <xs>

// Uncomment the following if you wish to set custom models for napalms
//#define USE_NAPALM_CUSTOM_MODELS

#if defined USE_NAPALM_CUSTOM_MODELS // Then set your custom models here
new const g_model_napalm_view[] = "models/v_smokegrenade"
new const g_model_napalm_player[] = "models/p_smokegrenade.mdl"
new const g_model_napalm_world[] = "models/w_smokegrenade.mdl"
#endif

// Explosion sounds
new const grenade_fire[][] = { "weapons/hegrenade-1.wav" }

// Player burning sounds
new const grenade_fire_player[][] = { "scientist/sci_fear8.wav""scientist/sci_pain1.wav""scientist/scream02.wav" }

// Grenade sprites
new const sprite_grenade_fire[] = "sprites/flame.spr"
new const sprite_grenade_smoke[] = "sprites/black_smoke3.spr"
new const sprite_grenade_trail[] = "sprites/laserbeam.spr"
new const sprite_grenade_ring[] = "sprites/shockwave.spr"

// Glow and trail colors (red, green, blue)
const NAPALM_R 200
const NAPALM_G 0
const NAPALM_B 0

// Burning task
const TASK_BURN 1000
#define ID_BURN (taskid - TASK_BURN)
#define BURN_DURATION args[0]
#define BURN_ATTACKER args[1]

// CS Player PData Offsets (win32)
const OFFSET_CSTEAMS 114
const OFFSET_CSMONEY 115
const OFFSET_MAPZONE 235
new const AFFECTED_BPAMMO_OFFSETS[] = { 388387389 }
const 
OFFSET_LINUX // offsets +5 in Linux builds

// CS Player CBase Offsets (win32)
const OFFSET_ACTIVE_ITEM 373

// CS Weapon PData Offsets (win32)
const OFFSET_WEAPONID 43
const OFFSET_LINUX_WEAPONS // weapon offsets are only 4 steps higher on Linux

// CS Weapon CBase Offsets (win32)
const OFFSET_WEAPONOWNER 41

// Some constants
const PLAYER_IN_BUYZONE = (1<<0)

// pev_ field used to store custom nade types and their values
const PEV_NADE_TYPE pev_flTimeStepSound
const NADE_TYPE_NAPALM 681856

// pev_ field used to store napalm's custom ammo
const PEV_NAPALM_AMMO pev_flSwimTime

// Weapons that can be napalms
new const AFFECTED_NAMES[][] = { "HE""FB""SG" }
new const 
AFFECTED_CLASSNAMES[][] = { "weapon_hegrenade""weapon_flashbang""weapon_smokegrenade" }
new const 
AFFECTED_MODELS[][] = { "w_he""w_fl""w_sm" }
new const 
AFFECTED_AMMOID[] = { 121113 }
#if defined USE_NAPALM_CUSTOM_MODELS
new const AFFECTED_WEAPONS[] = { CSW_HEGRENADECSW_FLASHBANGCSW_SMOKEGRENADE }
#endif

// CS Sounds
new const sound_buyammo[] = "items/9mmclip1.wav"

// Whether ham forwards are registered for CZ bots
new g_hamczbots

// Precached sprites indices
new g_flameSprg_smokeSprg_trailSprg_exploSpr

// Messages
new g_msgDamageg_msgAmmoPickup

// CVAR pointers
new cvar_radiuscvar_hitselfcvar_durationcvar_slowdowncvar_override,
cvar_damagecvar_ffcvar_cankillcvar_spreadcvar_botquota,
cvar_teamrestrictcvar_screamratecvar_keepexplosioncvar_affectcvar_carrylimit

// Cached stuff
new g_maxplayersg_affectg_overrideg_allowedteamg_keepexplosiong_spread,
g_ffg_durationg_carrylimitg_hitselfg_screamrateg_damage,
Float:g_slowdowng_cankillFloat:g_radius

// Precache all custom stuff
public plugin_precache()
{
    new 
i
    
for (0sizeof grenade_firei++)
        
engfunc(EngFunc_PrecacheSoundgrenade_fire[i])
    for (
0sizeof grenade_fire_playeri++)
        
engfunc(EngFunc_PrecacheSoundgrenade_fire_player[i])
    
    
g_flameSpr engfunc(EngFunc_PrecacheModelsprite_grenade_fire)
    
g_smokeSpr engfunc(EngFunc_PrecacheModelsprite_grenade_smoke)
    
g_trailSpr engfunc(EngFunc_PrecacheModelsprite_grenade_trail)
    
g_exploSpr engfunc(EngFunc_PrecacheModelsprite_grenade_ring)
    
    
// CS sounds (just in case)
    
engfunc(EngFunc_PrecacheSoundsound_buyammo)
    
#if defined USE_NAPALM_CUSTOM_MODELS
    
engfunc(EngFunc_PrecacheModelg_model_napalm_view)
    
engfunc(EngFunc_PrecacheModelg_model_napalm_player)
    
engfunc(EngFunc_PrecacheModelg_model_napalm_world)
#endif
}

public 
plugin_init()
{
    
// Register plugin call
    
register_plugin("Napalm Nades""1.3a""MeRcyLeZZ")
    
    
// Events
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
    
// Forwards
    
register_forward(FM_SetModel"fw_SetModel")
    
RegisterHam(Ham_Think"grenade""fw_ThinkGrenade")
    
RegisterHam(Ham_Touch"player""fw_TouchPlayer")
#if defined USE_NAPALM_CUSTOM_MODELS
    
for (new 0sizeof AFFECTED_CLASSNAMESi++)
        
RegisterHam(Ham_Item_DeployAFFECTED_CLASSNAMES[i], "fw_Item_Deploy_Post"1)
#endif
    
    // CVARS
    
cvar_affect register_cvar("napalm_affect""3")
    
cvar_teamrestrict register_cvar("napalm_team""0")
    
cvar_override register_cvar("napalm_override""0")
    
cvar_carrylimit register_cvar("napalm_carrylimit""1")
    
    
cvar_radius register_cvar("napalm_radius""240")
    
cvar_hitself register_cvar("napalm_hitself""1")
    
cvar_ff register_cvar("napalm_ff""0")
    
cvar_spread register_cvar("napalm_spread""1")
    
cvar_keepexplosion register_cvar("napalm_keepexplosion""0")
    
    
cvar_duration register_cvar("napalm_duration""5")
    
cvar_damage register_cvar("napalm_damage""2")
    
cvar_cankill register_cvar("napalm_cankill""1")
    
cvar_slowdown register_cvar("napalm_slowdown""0.5")
    
cvar_screamrate register_cvar("napalm_screamrate""20")
    
    
cvar_botquota get_cvar_pointer("bot_quota")
    
g_maxplayers get_maxplayers()
    
    
// Message ids
    
g_msgDamage get_user_msgid("Damage")
    
g_msgAmmoPickup get_user_msgid("AmmoPickup")
}

public 
plugin_cfg()
{
    
// Cache CVARs after configs are loaded
    
set_task(0.5"event_round_start")
}

// Round Start Event
public event_round_start()
{
    
// Cache CVARs
    
g_affect get_pcvar_num(cvar_affect)
    
g_override get_pcvar_num(cvar_override)
    
g_allowedteam get_pcvar_num(cvar_teamrestrict)
    
g_keepexplosion get_pcvar_num(cvar_keepexplosion)
    
g_spread get_pcvar_num(cvar_spread)
    
g_ff get_pcvar_num(cvar_ff)
    
g_duration get_pcvar_num(cvar_duration)
    
g_carrylimit get_pcvar_num(cvar_carrylimit)
    
g_hitself get_pcvar_num(cvar_hitself)
    
g_screamrate get_pcvar_num(cvar_screamrate)
    
g_slowdown get_pcvar_float(cvar_slowdown)
    
g_damage floatround(get_pcvar_float(cvar_damage), floatround_ceil)
    
g_cankill get_pcvar_num(cvar_cankill)
    
g_radius get_pcvar_float(cvar_radius)
    
    
// Stop any burning tasks on players
    
for (new id 1id <= g_maxplayersid++)
        
remove_task(id+TASK_BURN);
}

// Client joins the game
public client_putinserver(id)
{
    
// CZ bots seem to use a different "classtype" for player entities
    // (or something like that) which needs to be hooked separately
    
if (!g_hamczbots && cvar_botquota && is_user_bot(id))
    {
        
// Set a task to let the private data initialize
        
set_task(0.1"register_ham_czbots"id)
    }
}

// Set Model Forward
public fw_SetModel(entity, const model[])
{    
    
// Get damage time of grenade
    
static Float:dmgtime
    pev
(entitypev_dmgtimedmgtime)
    
    
// Grenade not yet thrown
    
if (dmgtime == 0.0)
        return 
FMRES_IGNORED;
    
    
// Not an affected grenade
    
if (!equal(model[7], AFFECTED_MODELS[g_affect-1], 4))
        return 
FMRES_IGNORED;
    
    
// Get owner of grenade and napalm weapon entity
    
static ownernapalm_weaponent
    owner 
pev(entitypev_owner)
    
napalm_weaponent fm_get_user_current_weapon_ent(owner)
    
    
// Not a napalm grenade (because the weapon entity of its owner doesn't have the flag set)
    
if (!g_override && pev(napalm_weaponentPEV_NADE_TYPE) != NADE_TYPE_NAPALM)
        return 
FMRES_IGNORED;
    
    
// Get owner's team
    
static owner_team
    owner_team 
fm_get_user_team(owner)
    
    
// Player is on a restricted team
    
if (g_allowedteam && g_allowedteam != owner_team)
        return 
FMRES_IGNORED;
    
    
// Give it a glow
    
fm_set_rendering(entitykRenderFxGlowShellNAPALM_RNAPALM_GNAPALM_BkRenderNormal16)
    
    
// And a colored trail
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMFOLLOW// TE id
    
write_short(entity// entity
    
write_short(g_trailSpr// sprite
    
write_byte(10// life
    
write_byte(10// width
    
write_byte(NAPALM_R// r
    
write_byte(NAPALM_G// g
    
write_byte(NAPALM_B// b
    
write_byte(200// brightness
    
message_end()
    
    
// Reduce napalm ammo
    
static napalm_ammo
    napalm_ammo 
pev(napalm_weaponentPEV_NAPALM_AMMO)
    
set_pev(napalm_weaponentPEV_NAPALM_AMMO, --napalm_ammo)
    
    
// Run out of napalms?
    
if (napalm_ammo 1)
    {
        
// Remove napalm flag from the owner's weapon entity
        
set_pev(napalm_weaponentPEV_NADE_TYPE0)
    }
    
    
// Set grenade type on the thrown grenade entity
    
set_pev(entityPEV_NADE_TYPENADE_TYPE_NAPALM)
    
    
// Set owner's team on the thrown grenade entity
    
set_pev(entitypev_teamowner_team)
    
#if defined USE_NAPALM_CUSTOM_MODELS
    // Set custom model and supercede the original forward
    
engfunc(EngFunc_SetModelentityg_model_napalm_world)
    return 
FMRES_SUPERCEDE;
#else
    
return FMRES_IGNORED;
#endif
}

// Grenade Think Forward
public fw_ThinkGrenade(entity)
{
    
// Invalid entity
    
if (!pev_valid(entity)) return HAM_IGNORED;
    
    
// Get damage time of grenade
    
static Float:dmgtime
    pev
(entitypev_dmgtimedmgtime)
    
    
// Check if it's time to go off
    
if (dmgtime get_gametime())
        return 
HAM_IGNORED;
    
    
// Not a napalm grenade
    
if (pev(entityPEV_NADE_TYPE) != NADE_TYPE_NAPALM)
        return 
HAM_IGNORED;
    
    
// Explode event
    
napalm_explode(entity)
    
    
// Keep the original explosion?
    
if (g_keepexplosion)
    {
        
set_pev(entityPEV_NADE_TYPE0)
        return 
HAM_IGNORED;
    }
    
    
// Get rid of the grenade
    
engfunc(EngFunc_RemoveEntityentity)
    return 
HAM_SUPERCEDE;
}

// Player Touch Forward
public fw_TouchPlayer(selfother)
{
    
// Spread cvar disabled or not touching a player
    
if (!g_spread || !is_user_alive(other))
        return;
    
    
// Toucher not on fire or touched player already on fire
    
if (!task_exists(self+TASK_BURN) || task_exists(other+TASK_BURN))
        return;
    
    
// Check if friendly fire is allowed
    
if (!g_ff && fm_get_user_team(self) == fm_get_user_team(other))
        return;
    
    
// Heat icon
    
message_begin(MSG_ONE_UNRELIABLEg_msgDamage_other)
    
write_byte(0// damage save
    
write_byte(0// damage take
    
write_long(DMG_BURN// damage type
    
write_coord(0// x
    
write_coord(0// y
    
write_coord(0// z
    
message_end()
    
    
// Our task params
    
static params[2]
    
params[0] = g_duration // duration (reduced a bit)
    
params[1] = self // attacker
    
    // Set burning task on victim
    
set_task(0.1"burning_flame"other+TASK_BURNparamssizeof params)
}

#if defined USE_NAPALM_CUSTOM_MODELS
// Ham Weapon Deploy Forward
public fw_Item_Deploy_Post(entity)
{    
    
// Not a napalm grenade (because the weapon entity of its owner doesn't have the flag set)
    
if (!g_override && pev(entityPEV_NADE_TYPE) != NADE_TYPE_NAPALM)
        return;
    
    
// Get weapon's id
    
static weaponid
    weaponid 
fm_get_weapon_ent_id(entity)
    
    
// Not an affected grenade
    
if (weaponid != AFFECTED_WEAPONS[g_affect-1])
        return;
    
    
// Get weapon's owner
    
static owner
    owner 
fm_get_weapon_ent_owner(entity)
    
    
// Player is on a restricted team
    
if (g_allowedteam && g_allowedteam != fm_get_user_team(owner))
        return;
    
    
// Replace models
    
set_pev(ownerpev_viewmodel2g_model_napalm_view)
    
set_pev(ownerpev_weaponmodel2g_model_napalm_player)
}
#endif

// Napalm purchase command
public buy_napalm(id)
{    
    
// Check if override setting is enabled instead
    
if (g_override)
    {
        
client_print(idprint_center"Just buy a %s grenade and get a napalm automatically!"AFFECTED_NAMES[g_affect-1])
        return 
PLUGIN_HANDLED;
    }
    
    
// Check if player is alive
    
if (!is_user_alive(id))
    {
        
client_print(idprint_center"You can't buy when you're dead!")
        return 
PLUGIN_HANDLED;
    }
    
    
// Check if the player is on a restricted team
    
if (g_allowedteam && g_allowedteam != fm_get_user_team(id))
    {
        
client_print(idprint_center"Your team cannot buy napalm nades!")
        return 
PLUGIN_HANDLED;
    }
    
    
// Get napalm weapon entity
    
static napalm_weaponent
    napalm_weaponent 
fm_get_napalm_entity(idg_affect)
    
    
// Does the player have a napalm already?
    
if (napalm_weaponent != 0)
    {
        
// Retrieve napalm ammo
        
static napalm_ammo
        napalm_ammo 
pev(napalm_weaponentPEV_NAPALM_AMMO)
        
        
// Check if allowed to have this many napalms
        
if (napalm_ammo g_carrylimit)
        {
            
// Increase napalm ammo
            
set_pev(napalm_weaponentPEV_NAPALM_AMMO, ++napalm_ammo)
            
            
// Increase player's backpack ammo
            
set_pdata_int(idAFFECTED_BPAMMO_OFFSETS[g_affect-1], get_pdata_int(idAFFECTED_BPAMMO_OFFSETS[g_affect-1]) + 1OFFSET_LINUX)
            
            
// Flash ammo in hud
            
message_begin(MSG_ONE_UNRELIABLEg_msgAmmoPickup_id)
            
write_byte(AFFECTED_AMMOID[g_affect-1]) // ammo id
            
write_byte(1// ammo amount
            
message_end()
            
            
// Play clip purchase sound
            
engfunc(EngFunc_EmitSoundidCHAN_ITEMsound_buyammo1.0ATTN_NORM0PITCH_NORM)
            
            
// Set napalm flag on the weapon entity (bugfix)
            
set_pev(napalm_weaponentPEV_NADE_TYPENADE_TYPE_NAPALM)
        }
        else
        {
            
client_print(idprint_center"You cannot carry any more napalms!")
            return 
PLUGIN_HANDLED;
        }
    }
    else
    {
        
// Give napalm
        
fm_give_item(idAFFECTED_CLASSNAMES[g_affect-1])
        
        
// Get napalm weapon entity now it exists
        
napalm_weaponent fm_get_napalm_entity(idg_affect)
        
        
// Set napalm flag on the weapon entity
        
set_pev(napalm_weaponentPEV_NADE_TYPENADE_TYPE_NAPALM)
        
        
// Set napalm ammo
        
set_pev(napalm_weaponentPEV_NAPALM_AMMO1)
    }
    
    return 
PLUGIN_HANDLED;
}

// Napalm Grenade Explosion
napalm_explode(ent)
{
    
// Get attacker and its team
    
static attackerattacker_team
    attacker 
pev(entpev_owner)
    
attacker_team pev(entpev_team)
    
    
// Get origin
    
static Float:originF[3]
    
pev(entpev_originoriginF)
    
    
// Custom explosion effect
    
create_blast2(originF)
    
    
// Napalm explosion sound
    
engfunc(EngFunc_EmitSoundentCHAN_WEAPONgrenade_fire[random_num(0sizeof grenade_fire 1)], 1.0ATTN_NORM0PITCH_NORM)
    
    
// Collisions
    
static victim
    victim 
= -1
    
    
while ((victim engfunc(EngFunc_FindEntityInSpherevictimoriginFg_radius)) != 0)
    {
        
// Only effect alive players
        
if (!is_user_alive(victim))
            continue;
        
        
// Check if myself is allowed
        
if (!g_hitself && victim == attacker)
            continue;
        
        
// Check if friendly fire is allowed
        
if (!g_ff && victim != attacker && attacker_team == fm_get_user_team(victim))
            continue;
        
        
// Heat icon
        
message_begin(MSG_ONE_UNRELIABLEg_msgDamage_victim)
        
write_byte(0// damage save
        
write_byte(0// damage take
        
write_long(DMG_BURN// damage type
        
write_coord(0// x
        
write_coord(0// y
        
write_coord(0// z
        
message_end()
        
        
// Our task params
        
static params[2]
        
params[0] = g_duration // duration
        
params[1] = attacker // attacker
        
        // Set burning task on victim
        
set_task(0.1"burning_flame"victim+TASK_BURNparamssizeof params)
    }
}

// Burning Task
public burning_flame(args[2], taskid)
{
    
// Player died/disconnected
    
if (!is_user_alive(ID_BURN))
        return;
    
    
// Get player origin and flags
    
static Float:originF[3], flags
    pev
(ID_BURNpev_originoriginF)
    
flags pev(ID_BURNpev_flags)
    
    
// In water or burning stopped
    
if ((flags FL_INWATER) || BURN_DURATION 1)
    {
        
// Smoke sprite
        
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
        
write_byte(TE_SMOKE// TE id
        
engfunc(EngFunc_WriteCoordoriginF[0]) // x
        
engfunc(EngFunc_WriteCoordoriginF[1]) // y
        
engfunc(EngFunc_WriteCoordoriginF[2]-50.0// z
        
write_short(g_smokeSpr// sprite
        
write_byte(random_num(1520)) // scale
        
write_byte(random_num(1020)) // framerate
        
message_end()
        
        return;
    }
    
    
// Randomly play burning sounds
    
if (g_screamrate && random_num(1g_screamrate) == 1)
        
engfunc(EngFunc_EmitSoundID_BURNCHAN_VOICEgrenade_fire_player[random_num(0sizeof grenade_fire_player 1)], 1.0ATTN_NORM0PITCH_NORM)
    
    
// Fire slow down
    
if (g_slowdown 0.0 && (flags FL_ONGROUND))
    {
        static 
Float:velocity[3]
        
pev(ID_BURNpev_velocityvelocity)
        
xs_vec_mul_scalar(velocityg_slowdownvelocity)
        
set_pev(ID_BURNpev_velocityvelocity)
    }
    
    
// Get victim's health
    
static health
    health 
pev(ID_BURNpev_health)
    
    
// Take damage from the fire
    
if (health g_damage 0)
        
set_pev(ID_BURNpev_healthfloat(health g_damage))
    else if (
g_cankill)
    {
        
// Kill victim
        
ExecuteHamB(Ham_KilledID_BURNBURN_ATTACKER0)
        
        
// Smoke sprite
        
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
        
write_byte(TE_SMOKE// TE id
        
engfunc(EngFunc_WriteCoordoriginF[0]) // x
        
engfunc(EngFunc_WriteCoordoriginF[1]) // y
        
engfunc(EngFunc_WriteCoordoriginF[2]-50.0// z
        
write_short(g_smokeSpr// sprite
        
write_byte(random_num(1520)) // scale
        
write_byte(random_num(1020)) // framerate
        
message_end()
        
        return;
    }
    
    
// Flame sprite
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_SPRITE// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]+random_float(-5.05.0)) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]+random_float(-5.05.0)) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]+random_float(-10.010.0)) // z
    
write_short(g_flameSpr// sprite
    
write_byte(random_num(510)) // scale
    
write_byte(200// brightness
    
message_end()
    
    
// Decrease task cycle count
    
BURN_DURATION -= 1;
    
    
// Keep sending flame messages
    
set_task(0.2"burning_flame"taskidargssizeof args)
}

// Napalm Grenade: Fire Blast (originally made by Avalanche in Frostnades)
create_blast2(const Float:originF[3])
{
    
// Smallest ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+385.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(200// red
    
write_byte(100// green
    
write_byte(0// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()
    
    
// Medium ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+470.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(200// red
    
write_byte(50// green
    
write_byte(0// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()
    
    
// Largest ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+555.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(200// red
    
write_byte(0// green
    
write_byte(0// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()
}

// Register Ham Forwards for CZ bots
public register_ham_czbots(id)
{
    
// Make sure it's a CZ bot and it's still connected
    
if (g_hamczbots || !get_pcvar_num(cvar_botquota) || !is_user_connected(id))
        return;
    
    
RegisterHamFromEntity(Ham_Touchid"fw_TouchPlayer")
    
    
// Ham forwards for CZ bots succesfully registered
    
g_hamczbots true;
}

// Set entity's rendering type (from fakemeta_util)
stock fm_set_rendering(entityfx kRenderFxNone255255255render kRenderNormalamount 16)
{
    static 
Float:color[3]
    
color[0] = float(r)
    
color[1] = float(g)
    
color[2] = float(b)
    
    
set_pev(entitypev_renderfxfx)
    
set_pev(entitypev_rendercolorcolor)
    
set_pev(entitypev_rendermoderender)
    
set_pev(entitypev_renderamtfloat(amount))
}

// Give an item to a player (from fakemeta_util)
stock fm_give_item(id, const item[])
{
    static 
ent
    ent 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocStringitem));
    if (!
pev_valid(ent)) return;
    
    static 
Float:originF[3]
    
pev(idpev_originoriginF);
    
set_pev(entpev_originoriginF);
    
set_pev(entpev_spawnflagspev(entpev_spawnflags) | SF_NORESPAWN);
    
dllfunc(DLLFunc_Spawnent);
    
    static 
save
    save 
pev(entpev_solid);
    
dllfunc(DLLFunc_Touchentid);
    if (
pev(entpev_solid) != save)
        return;
    
    
engfunc(EngFunc_RemoveEntityent);
}

stock fm_find_ent_by_owner(entity, const classname[], owner)
{
    while ((
entity engfunc(EngFunc_FindEntityByStringentity"classname"classname)) && pev(entitypev_owner) != owner) {}
    
    return 
entity;
}

stock fm_get_napalm_entity(idg_affect)
    return 
fm_find_ent_by_owner(-1AFFECTED_CLASSNAMES[g_affect-1], id);

stock fm_get_user_current_weapon_ent(id)
    return 
get_pdata_cbase(idOFFSET_ACTIVE_ITEMOFFSET_LINUX);

stock fm_get_weapon_ent_id(ent)
    return 
get_pdata_int(entOFFSET_WEAPONIDOFFSET_LINUX_WEAPONS);

stock fm_get_weapon_ent_owner(ent)
    return 
get_pdata_cbase(entOFFSET_WEAPONOWNEROFFSET_LINUX_WEAPONS);

stock fm_get_user_money(id)
    return 
get_pdata_int(idOFFSET_CSMONEYOFFSET_LINUX);

stock fm_set_user_money(idamount)
    
set_pdata_int(idOFFSET_CSMONEYamountOFFSET_LINUX);

stock fm_get_user_team(id)
    return 
get_pdata_int(idOFFSET_CSTEAMSOFFSET_LINUX);

stock fm_get_user_buyzone(id)
{
    if (
get_pdata_int(idOFFSET_MAPZONE) & PLAYER_IN_BUYZONE)
        return 
1;
    
    return 
0;

__________________
Aprendiendo de nadie
wEEk is offline
KaLoIaN
Senior Member
Join Date: Feb 2013
Old 04-27-2016 , 10:06   Re: Help with napalm nades
Reply With Quote #2

Why without natives?
natives are good..
natives are life ;)
KaLoIaN is offline
wEEk
Senior Member
Join Date: Sep 2012
Old 04-27-2016 , 10:28   Re: Help with napalm nades
Reply With Quote #3

Why not haha,

Other form ?
__________________
Aprendiendo de nadie
wEEk is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 04-29-2016 , 07:40   Re: Help with napalm nades
Reply With Quote #4

You want to give grenades to the user without using cstrike module?
siriusmd99 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 04-29-2016 , 17:07   Re: Help with napalm nades
Reply With Quote #5

Quote:
Originally Posted by wEEk View Post
Hello, i want you to help me when buy the Granada is the fire for use in a menu , without having to use natives
What?
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd 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 20:41.


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