Existing user? Sign in
Sign up
Games
Servers
Useful
User
Pass
2FA
[Problema] M16 si m4a1 gold
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
Author
Message
1381
NeQ.
[Owner ZP]
Status: Offline
(since 02-06-2016 13:05)
Joined: 18 Feb 2012
Posts: 180
,
Topics: 16
Location:
Vaslui
Reputation:
120.2
Votes
: 4
Posted: 26-04-2016, 14:36:32
| Translate post to:
... (
Click for more languages
)
»
Nume
*: M16 si m4a1 gold
»
Descriere problema
*: Deci cum cumpara cineva aceste 2 iteme deodata, ele se unesc si creste
dmg
exagerat..un fel debug.
Credeti ca ati putea sa puneti o interdictie sau ceva, ca atunci cand cumpara una din ele, cealalta sa nu ii mai mearga..?
»Poze/Sma: Nu e nevoie..
M4a1 gold SMA:
Spoiler:
#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <zombieplague>
#define is_valid_player(%1) (1 <= %1 <= 32)
new M4_V_MODEL[64] = "models/zombie_plague/v_golden_m4a1_UP.mdl"
new M4_P_MODEL[64] = "models/zombie_plague/p_golden_m4a1_UP.mdl"
/* Pcvars */
new cvar_dmgmultiplier, cvar_goldbullets, cvar_custommodel, cvar_uclip
// Item ID
new g_itemid
new bool:g_HasM4[33]
new g_hasZoom[ 33 ]
new bullets[ 33 ]
// Sprite
new m_spriteTexture
const Wep_m4a1 = ((1<<CSW_M4A1))
public plugin_init()
{
/* CVARS */
cvar_dmgmultiplier = register_cvar("zp_goldenm4_dmg_multiplier", "12")
cvar_custommodel = register_cvar("zp_goldenm4_custom_model", "1")
cvar_goldbullets = register_cvar("zp_goldenm4_gold_bullets", "1")
cvar_uclip = register_cvar("zp_goldenm4_unlimited_clip", "1")
// Register The Plugin
register_plugin("[ZP] Extra: Golden M4A1", "1.1", "Bill=Thailand=[UP]")
// Register Zombie Plague extra item
g_itemid = zp_register_extra_item("Golden M4A1", 20, ZP_TEAM_HUMAN)
// Death Msg
register_event("DeathMsg", "Death", "a")
// Weapon Pick Up
register_event("WeapPickup","checkModel","b","1=19")
// Current Weapon Event
register_event("CurWeapon","checkWeapon","be","1=1")
register_event("CurWeapon", "make_tracer", "be", "1=1", "3>0")
// Ham TakeDamage
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
register_forward( FM_CmdStart, "fw_CmdStart" )
RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)
}
public client_connect(id)
{
g_HasM4[id] = false
}
public client_disconnect(id)
{
g_HasM4[id] = false
}
public Death()
{
g_HasM4[read_data(2)] = false
}
public fwHamPlayerSpawnPost(id)
{
g_HasM4[id] = false
}
public plugin_precache()
{
precache_model(M4_V_MODEL)
precache_model(M4_P_MODEL)
m_spriteTexture = precache_model("sprites/dot.spr")
precache_sound("weapons/zoom.wav")
}
public zp_user_infected_post(id)
{
if (zp_get_user_zombie(id))
{
g_HasM4[id] = false
}
}
public checkModel(id)
{
if ( zp_get_user_zombie(id) )
return PLUGIN_HANDLED
new szWeapID = read_data(2)
if ( szWeapID == CSW_M4A1 && g_HasM4[id] == true && get_pcvar_num(cvar_custommodel) )
{
set_pev(id, pev_viewmodel2, M4_V_MODEL)
set_pev(id, pev_weaponmodel2, M4_P_MODEL)
}
return PLUGIN_HANDLED
}
public checkWeapon(id)
{
new plrClip, plrAmmo, plrWeap[32]
new plrWeapId
plrWeapId = get_user_weapon(id, plrClip , plrAmmo)
if (plrWeapId == CSW_M4A1 && g_HasM4[id])
{
checkModel(id)
}
else
{
return PLUGIN_CONTINUE
}
if (plrClip == 0 && get_pcvar_num(cvar_uclip))
{
// If the user is out of ammo..
get_weaponname(plrWeapId, plrWeap, 31)
// Get the name of their weapon
give_item(id, plrWeap)
engclient_cmd(id, plrWeap)
engclient_cmd(id, plrWeap)
engclient_cmd(id, plrWeap)
}
return PLUGIN_HANDLED
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
{
if ( is_valid_player( attacker ) && get_user_weapon(attacker) == CSW_M4A1 && g_HasM4[attacker] )
{
SetHamParamFloat(4, damage * get_pcvar_float( cvar_dmgmultiplier ) )
}
}
public fw_CmdStart( id, uc_handle, seed )
{
if( !is_user_alive( id ) )
return PLUGIN_HANDLED
if( ( get_uc( uc_handle, UC_Buttons ) & IN_ATTACK2 ) && !( pev( id, pev_oldbuttons ) & IN_ATTACK2 ) )
{
new szClip, szAmmo
new szWeapID = get_user_weapon( id, szClip, szAmmo )
if( szWeapID == CSW_M4A1 && g_HasM4[id] == true && !g_hasZoom[id] == true)
{
g_hasZoom[id] = true
cs_set_user_zoom( id, CS_SET_AUGSG552_ZOOM, 0 )
emit_sound( id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100 )
}
else if ( szWeapID == CSW_M4A1 && g_HasM4[id] == true && g_hasZoom[id])
{
g_hasZoom[ id ] = false
cs_set_user_zoom( id, CS_RESET_ZOOM, 0 )
}
}
return PLUGIN_HANDLED
}
public make_tracer(id)
{
if (get_pcvar_num(cvar_goldbullets))
{
new clip,ammo
new wpnid = get_user_weapon(id,clip,ammo)
new pteam[16]
get_user_team(id, pteam, 15)
if ((bullets[id] > clip) && (wpnid == CSW_M4A1) && g_HasM4[id])
{
new vec1[3], vec2[3]
get_user_origin(id, vec1, 1) // origin; your camera point.
get_user_origin(id, vec2, 4) // termina; where your bullet goes (4 is cs-only)
//BEAMENTPOINTS
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte (0) //TE_BEAMENTPOINTS 0
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_coord(vec2[0])
write_coord(vec2[1])
write_coord(vec2[2])
write_short( m_spriteTexture )
write_byte(1) // framestart
write_byte(5) // framerate
write_byte(2) // life
write_byte(10) // width
write_byte(0) // noise
write_byte( 255 ) // r, g, b
write_byte( 215 ) // r, g, b
write_byte( 0 ) // r, g, b
write_byte(200) // brightness
write_byte(150) // speed
message_end()
}
bullets[id] = clip
}
}
public zp_extra_item_selected(player, itemid)
{
if ( itemid == g_itemid )
{
if ( user_has_weapon(player, CSW_M4A1) )
{
drop_prim(player)
}
give_item(player, "weapon_m4a1")
client_print(player, print_chat, "[ZP] You bought Golden M4A1")
g_HasM4[player] = true;
}
}
stock drop_prim(id)
{
new weapons[32], num
get_user_weapons(id, weapons, num)
for (new i = 0; i < num; i++) {
if (Wep_m4a1 & (1<<weapons[i]))
{
static wname[32]
get_weaponname(weapons[i], wname, sizeof wname - 1)
engclient_cmd(id, "drop", wname)
}
}
}
M16 SMA:
Spoiler:
#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <engine>
#include <zombieplague>
#define is_valid_player(%1) (1 <= %1 <= 32)
// Maxplayers
#define MAXPLAYERS 32
// Weapon M16 Model
new M4A1_V_MODEL[64] = "models/zombie_plague/v_m16.mdl"
// Cvars ...
new cvar_m16_dmg, cvar_m16_oneround, cvar_m16_Model, cvar_m16_Clip
// Zoom Cvar...
new g_WepZoom[ 33 ]
// Has M16 Cvar
new bool:g_HasM16[33]
new bool:bIsAlive [ MAXPLAYERS+1 ]
//Const Weapon ...
const Wep_m4a1 = ((1<<CSW_M4A1))
// Global variables
new g_MaxPlayers, g_Restarted
// No Recoil Float
new Float:gPunchAngle[3] = { 0.0, 0.0, 0.0 }
// Register Name , Cost And Item Id ...
static const g_item_name[] = "Weapon M16";
const g_item_cost = 40;
new g_itemid;
public plugin_init()
{
// Register Plugin ...
register_plugin("[ZP] Extra Items : Weapon M16", "1.0", "Dare-Devil")
// Register Cvars ...
cvar_m16_Model = register_cvar("zp_m16_costom_model", "1")
cvar_m16_oneround = register_cvar("zp_m16_one_round", "0") // If 1 weapon will stay only One round
cvar_m16_dmg = register_cvar("zp_m16_extra_dmg", "3") // Damage Multiplier , If 2 damage are 2x
g_MaxPlayers = get_maxplayers ( ) // Do not touch!
cvar_m16_Clip = register_cvar("zp_m16_Clip", "1") //
// Register Extra Item ..
g_itemid = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_HUMAN);
// Reigister New Round Event ...
register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0")
// Weapon Event ...
register_event("WeapPickup","checkModel","b","1=19")
register_event("CurWeapon","checkWeapon","be","1=1")
// Register Ham TakeDamage ...
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
// Register Forward ( For Weapon Zoom ) ...
register_forward( FM_CmdStart, "fw_CmdStart" )
}
// Precache Sound And Model
public plugin_precache()
{
precache_model(M4A1_V_MODEL)
precache_sound("weapons/zoom.wav")
}
// Do Not Give Player Weapon M16 When He Connect
public client_connect(id)
{
g_HasM16[id] = false
bIsAlive [id] = false
}
// Check Crav zp_m16_oneround If 1 Revome Player Weapon M16
public Event_NewRound ( )
{
if ( g_Restarted )
{
arrayset ( g_HasM16, false, 33 )
}
g_Restarted = false
if ( get_pcvar_num ( cvar_m16_oneround ) >= 1 )
{
// Loop
for ( new i = 1; i < g_MaxPlayers; i++ )
{
g_HasM16 [ i ] = false
}
}
}
// Creck When Game Restarted ...
public Event_GameRestart ( )
{
g_Restarted = true
}
// Set M16 Model
public checkModel(id)
{
if ( zp_get_user_zombie(id) )
return PLUGIN_HANDLED
new szWeapID = read_data(2)
if ( szWeapID == CSW_M4A1 && g_HasM16[id] == true && get_pcvar_num(cvar_m16_Model) )
{
set_pev(id, pev_viewmodel2, M4A1_V_MODEL)
}
return PLUGIN_HANDLED
}
public checkWeapon(id)
{
new plrClip, plrAmmo, plrWeap[32]
new plrWeapId
plrWeapId = get_user_weapon(id, plrClip , plrAmmo)
if (plrWeapId == CSW_M4A1 && g_HasM16[id])
{
checkModel(id)
}
else
{
return PLUGIN_CONTINUE
}
if (plrClip == 0 && get_pcvar_num(cvar_m16_Clip))
{
// If the user is out of ammo..
get_weaponname(plrWeapId, plrWeap, 31)
// Get the name of their weapon
give_item(id, plrWeap)
engclient_cmd(id, plrWeap)
engclient_cmd(id, plrWeap)
engclient_cmd(id, plrWeap)
}
return PLUGIN_HANDLED
}
// Give Weapon M16 No Recoil...
public server_frame()
{
for ( new id = 1; id <= g_MaxPlayers; id++ )
{
if ( is_user_alive(id) && g_HasM16[id] )
set_pev(id, pev_punchangle, gPunchAngle);
}
}
// Give Zoom For Weapon M16
public fw_CmdStart( id, uc_handle, seed )
{
if( !is_user_alive( id ) )
return PLUGIN_HANDLED
if( ( get_uc( uc_handle, UC_Buttons ) & IN_USE ) && !( pev( id, pev_oldbuttons ) & IN_USE ) )
{
new szClip, szAmmo
new szWeapID = get_user_weapon( id, szClip, szAmmo )
if( szWeapID == CSW_M4A1 && g_HasM16[id] == true && !g_WepZoom[id] == true)
{
g_WepZoom[id] = true
cs_set_user_zoom( id, CS_SET_AUGSG552_ZOOM, 0 )
emit_sound( id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100 )
}
else if ( szWeapID == CSW_M4A1 && g_HasM16[id] == true && g_WepZoom[id])
{
g_WepZoom[ id ] = false
cs_set_user_zoom( id, CS_RESET_ZOOM, 0 )
}
}
return PLUGIN_HANDLED
}
// Check Cvar zp_m16_extra_dmg And Multipli Dmg ...
public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
{
if ( is_valid_player( attacker ) && get_user_weapon(attacker) == CSW_M4A1 && g_HasM16[attacker] )
{
SetHamParamFloat(4, damage * get_pcvar_float( cvar_m16_dmg ) )
}
}
// When Player Buy This Extra Items, Give Him Weapon And Show Message ...
public zp_extra_item_selected(player, itemid)
{
if ( itemid == g_itemid )
{
if ( user_has_weapon(player, CSW_M4A1) )
{
drop_prim(player)
}
give_item(player, "weapon_m4a1")
client_print(player, print_chat, "[ZP] You Got Weapon M16! Press E (Use) To Zoom ...")
g_HasM16[player] = true;
}
}
stock drop_prim(id)
{
new weapons[32], num
get_user_weapons(id, weapons, num)
for (new i = 0; i < num; i++) {
if (Wep_m4a1 & (1<<weapons[i]))
{
static wname[32]
get_weaponname(weapons[i], wname, sizeof wname - 1)
engclient_cmd(id, "drop", wname)
}
}
}
0
0
Back to top
Freakz*DuLceTeL
[S3X*p3rMaN3nTy; x ]
Status: Offline
(since 09-04-2022 10:29)
Joined: 27 Jun 2015
Posts: 15862
,
Topics: 2099
Location:
TG-Mures
Reputation:
964.9
Votes
: 668
Posted: 27-04-2016, 15:19:07
| Translate post to:
... (
Click for more languages
)
M16:
Spoiler:
#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <engine>
#include <zombieplague>
#define is_valid_player(%1) (1 <= %1 <= 32)
// Maxplayers
#define MAXPLAYERS 32
// Weapon M16 Model
new M4A1_V_MODEL[64] = "models/zombie_plague/v_m16.mdl"
// Cvars ...
new cvar_m16_dmg, cvar_m16_oneround, cvar_m16_Model, cvar_m16_Clip
// Zoom Cvar...
new g_WepZoom[ 33 ]
// Has M16 Cvar
new bool:g_HasM16[33]
new bool:bIsAlive [ MAXPLAYERS+1 ]
//Const Weapon ...
const Wep_m4a1 = ((1<<CSW_M4A1))
// Global variables
new g_MaxPlayers, g_Restarted
// No Recoil Float
new Float:gPunchAngle[3] = { 0.0, 0.0, 0.0 }
// Register Name , Cost And Item Id ...
static const g_item_name[] = "Weapon M16";
const g_item_cost = 40;
new g_itemid;
public plugin_init()
{
// Register Plugin ...
register_plugin("[ZP] Extra Items : Weapon M16", "1.0", "Dare-Devil")
// Register Cvars ...
cvar_m16_Model = register_cvar("zp_m16_costom_model", "1")
cvar_m16_oneround = register_cvar("zp_m16_one_round", "0") // If 1 weapon will stay only One round
cvar_m16_dmg = register_cvar("zp_m16_extra_dmg", "2") // Damage Multiplier , If 2 damage are 2x
g_MaxPlayers = get_maxplayers ( ) // Do not touch!
cvar_m16_Clip = register_cvar("zp_m16_Clip", "1") //
// Register Extra Item ..
g_itemid = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_HUMAN);
// Reigister New Round Event ...
register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0")
// Weapon Event ...
register_event("WeapPickup","checkModel","b","1=19")
register_event("CurWeapon","checkWeapon","be","1=1")
// Register Ham TakeDamage ...
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
// Register Forward ( For Weapon Zoom ) ...
register_forward( FM_CmdStart, "fw_CmdStart" )
}
// Precache Sound And Model
public plugin_precache()
{
precache_model(M4A1_V_MODEL)
precache_sound("weapons/zoom.wav")
}
// Do Not Give Player Weapon M16 When He Connect
public client_connect(id)
{
g_HasM16[id] = false
bIsAlive [id] = false
}
// Check Crav zp_m16_oneround If 1 Revome Player Weapon M16
public Event_NewRound ( )
{
if ( g_Restarted )
{
arrayset ( g_HasM16, false, 33 )
}
g_Restarted = false
if ( get_pcvar_num ( cvar_m16_oneround ) >= 1 )
{
// Loop
for ( new i = 1; i < g_MaxPlayers; i++ )
{
g_HasM16 [ i ] = false
}
}
}
// Creck When Game Restarted ...
public Event_GameRestart ( )
{
g_Restarted = true
}
// Set M16 Model
public checkModel(id)
{
if ( zp_get_user_zombie(id) )
return PLUGIN_HANDLED
new szWeapID = read_data(2)
if ( szWeapID == CSW_M4A1 && g_HasM16[id] == true && get_pcvar_num(cvar_m16_Model) )
{
set_pev(id, pev_viewmodel2, M4A1_V_MODEL)
}
return PLUGIN_HANDLED
}
public checkWeapon(id)
{
new plrClip, plrAmmo, plrWeap[32]
new plrWeapId
plrWeapId = get_user_weapon(id, plrClip , plrAmmo)
if (plrWeapId == CSW_M4A1 && g_HasM16[id])
{
checkModel(id)
}
else
{
return PLUGIN_CONTINUE
}
if (plrClip == 0 && get_pcvar_num(cvar_m16_Clip))
{
// If the user is out of ammo..
get_weaponname(plrWeapId, plrWeap, 31)
// Get the name of their weapon
give_item(id, plrWeap)
engclient_cmd(id, plrWeap)
engclient_cmd(id, plrWeap)
engclient_cmd(id, plrWeap)
}
return PLUGIN_HANDLED
}
// Give Weapon M16 No Recoil...
public server_frame()
{
for ( new id = 1; id <= g_MaxPlayers; id++ )
{
if ( is_user_alive(id) && g_HasM16[id] )
set_pev(id, pev_punchangle, gPunchAngle);
}
}
// Give Zoom For Weapon M16
public fw_CmdStart( id, uc_handle, seed )
{
if( !is_user_alive( id ) )
return PLUGIN_HANDLED
if( ( get_uc( uc_handle, UC_Buttons ) & IN_USE ) && !( pev( id, pev_oldbuttons ) & IN_USE ) )
{
new szClip, szAmmo
new szWeapID = get_user_weapon( id, szClip, szAmmo )
if( szWeapID == CSW_M4A1 && g_HasM16[id] == true && !g_WepZoom[id] == true)
{
g_WepZoom[id] = true
cs_set_user_zoom( id, CS_SET_AUGSG552_ZOOM, 0 )
emit_sound( id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100 )
}
else if ( szWeapID == CSW_M4A1 && g_HasM16[id] == true && g_WepZoom[id])
{
g_WepZoom[ id ] = false
cs_set_user_zoom( id, CS_RESET_ZOOM, 0 )
}
}
return PLUGIN_HANDLED
}
// Check Cvar zp_m16_extra_dmg And Multipli Dmg ...
public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
{
if ( is_valid_player( attacker ) && get_user_weapon(attacker) == CSW_M4A1 && g_HasM16[attacker] )
{
SetHamParamFloat(4, damage * get_pcvar_float( cvar_m16_dmg ) )
}
}
// When Player Buy This Extra Items, Give Him Weapon And Show Message ...
public zp_extra_item_selected(player, itemid)
{
if ( itemid == g_itemid )
{
if ( user_has_weapon(player, CSW_M4A1) )
{
drop_prim(player)
}
give_item(player, "weapon_m4a1")
client_print(player, print_chat, "[ZP] You Got Weapon M16! Press E (Use) To Zoom ...")
g_HasM16[player] = true;
}
}
stock drop_prim(id)
{
new weapons[32], num
get_user_weapons(id, weapons, num)
for (new i = 0; i < num; i++) {
if (Wep_m4a1 & (1<<weapons[i]))
{
static wname[32]
get_weaponname(weapons[i], wname, sizeof wname - 1)
engclient_cmd(id, "drop", wname)
}
}
}
M4a1 gold:
Spoiler:
#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <zombieplague>
#define is_valid_player(%1) (1 <= %1 <= 32)
new M4_V_MODEL[64] = "models/zombie_plague/v_golden_m4a1_UP.mdl"
new M4_P_MODEL[64] = "models/zombie_plague/p_golden_m4a1_UP.mdl"
/* Pcvars */
new cvar_dmgmultiplier, cvar_goldbullets, cvar_custommodel, cvar_uclip
// Item ID
new g_itemid
new bool:g_HasM4[33]
new g_hasZoom[ 33 ]
new bullets[ 33 ]
// Sprite
new m_spriteTexture
const Wep_m4a1 = ((1<<CSW_M4A1))
public plugin_init()
{
/* CVARS */
cvar_dmgmultiplier = register_cvar("zp_goldenm4_dmg_multiplier", "3")
cvar_custommodel = register_cvar("zp_goldenm4_custom_model", "1")
cvar_goldbullets = register_cvar("zp_goldenm4_gold_bullets", "1")
cvar_uclip = register_cvar("zp_goldenm4_unlimited_clip", "1")
// Register The Plugin
register_plugin("[ZP] Extra: Golden M4A1", "1.1", "Bill=Thailand=[UP]")
// Register Zombie Plague extra item
g_itemid = zp_register_extra_item("Golden M4A1", 20, ZP_TEAM_HUMAN)
// Death Msg
register_event("DeathMsg", "Death", "a")
// Weapon Pick Up
register_event("WeapPickup","checkModel","b","1=19")
// Current Weapon Event
register_event("CurWeapon","checkWeapon","be","1=1")
register_event("CurWeapon", "make_tracer", "be", "1=1", "3>0")
// Ham TakeDamage
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
register_forward( FM_CmdStart, "fw_CmdStart" )
RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)
}
public client_connect(id)
{
g_HasM4[id] = false
}
public client_disconnect(id)
{
g_HasM4[id] = false
}
public Death()
{
g_HasM4[read_data(2)] = false
}
public fwHamPlayerSpawnPost(id)
{
g_HasM4[id] = false
}
public plugin_precache()
{
precache_model(M4_V_MODEL)
precache_model(M4_P_MODEL)
m_spriteTexture = precache_model("sprites/dot.spr")
precache_sound("weapons/zoom.wav")
}
public zp_user_infected_post(id)
{
if (zp_get_user_zombie(id))
{
g_HasM4[id] = false
}
}
public checkModel(id)
{
if ( zp_get_user_zombie(id) )
return PLUGIN_HANDLED
new szWeapID = read_data(2)
if ( szWeapID == CSW_M4A1 && g_HasM4[id] == true && get_pcvar_num(cvar_custommodel) )
{
set_pev(id, pev_viewmodel2, M4_V_MODEL)
set_pev(id, pev_weaponmodel2, M4_P_MODEL)
}
return PLUGIN_HANDLED
}
public checkWeapon(id)
{
new plrClip, plrAmmo, plrWeap[32]
new plrWeapId
plrWeapId = get_user_weapon(id, plrClip , plrAmmo)
if (plrWeapId == CSW_M4A1 && g_HasM4[id])
{
checkModel(id)
}
else
{
return PLUGIN_CONTINUE
}
if (plrClip == 0 && get_pcvar_num(cvar_uclip))
{
// If the user is out of ammo..
get_weaponname(plrWeapId, plrWeap, 31)
// Get the name of their weapon
give_item(id, plrWeap)
engclient_cmd(id, plrWeap)
engclient_cmd(id, plrWeap)
engclient_cmd(id, plrWeap)
}
return PLUGIN_HANDLED
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
{
if ( is_valid_player( attacker ) && get_user_weapon(attacker) == CSW_M4A1 && g_HasM4[attacker] )
{
SetHamParamFloat(4, damage * get_pcvar_float( cvar_dmgmultiplier ) )
}
}
public fw_CmdStart( id, uc_handle, seed )
{
if( !is_user_alive( id ) )
return PLUGIN_HANDLED
if( ( get_uc( uc_handle, UC_Buttons ) & IN_ATTACK2 ) && !( pev( id, pev_oldbuttons ) & IN_ATTACK2 ) )
{
new szClip, szAmmo
new szWeapID = get_user_weapon( id, szClip, szAmmo )
if( szWeapID == CSW_M4A1 && g_HasM4[id] == true && !g_hasZoom[id] == true)
{
g_hasZoom[id] = true
cs_set_user_zoom( id, CS_SET_AUGSG552_ZOOM, 0 )
emit_sound( id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100 )
}
else if ( szWeapID == CSW_M4A1 && g_HasM4[id] == true && g_hasZoom[id])
{
g_hasZoom[ id ] = false
cs_set_user_zoom( id, CS_RESET_ZOOM, 0 )
}
}
return PLUGIN_HANDLED
}
public make_tracer(id)
{
if (get_pcvar_num(cvar_goldbullets))
{
new clip,ammo
new wpnid = get_user_weapon(id,clip,ammo)
new pteam[16]
get_user_team(id, pteam, 15)
if ((bullets[id] > clip) && (wpnid == CSW_M4A1) && g_HasM4[id])
{
new vec1[3], vec2[3]
get_user_origin(id, vec1, 1) // origin; your camera point.
get_user_origin(id, vec2, 4) // termina; where your bullet goes (4 is cs-only)
//BEAMENTPOINTS
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte (0) //TE_BEAMENTPOINTS 0
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_coord(vec2[0])
write_coord(vec2[1])
write_coord(vec2[2])
write_short( m_spriteTexture )
write_byte(1) // framestart
write_byte(5) // framerate
write_byte(2) // life
write_byte(10) // width
write_byte(0) // noise
write_byte( 255 ) // r, g, b
write_byte( 215 ) // r, g, b
write_byte( 0 ) // r, g, b
write_byte(200) // brightness
write_byte(150) // speed
message_end()
}
bullets[id] = clip
}
}
public zp_extra_item_selected(player, itemid)
{
if ( itemid == g_itemid )
{
if ( user_has_weapon(player, CSW_M4A1) )
{
drop_prim(player)
}
give_item(player, "weapon_m4a1")
client_print(player, print_chat, "[ZP] You bought Golden M4A1")
g_HasM4[player] = true;
}
}
stock drop_prim(id)
{
new weapons[32], num
get_user_weapons(id, weapons, num)
for (new i = 0; i < num; i++) {
if (Wep_m4a1 & (1<<weapons[i]))
{
static wname[32]
get_weaponname(weapons[i], wname, sizeof wname - 1)
engclient_cmd(id, "drop", wname)
}
}
}
Incearca vezi.
0
0
Back to top
NeQ.
[Owner ZP]
Status: Offline
(since 02-06-2016 13:05)
Joined: 18 Feb 2012
Posts: 180
,
Topics: 16
Location:
Vaslui
Reputation:
120.2
Votes
: 4
Posted: 28-04-2016, 13:00:14
| Translate post to:
... (
Click for more languages
)
Nu merge.
Altcineva..?
0
0
Back to top
GoguSM
[.: ZMGO.FREAKZ.RO :.]
Status: Offline
(since 16-03-2022 00:38)
Joined: 24 Aug 2013
Posts: 1516
,
Topics: 71
Location:
Brasov
Reputation:
1144
Votes
: 95
Posted: 28-04-2016, 13:26:51
| Translate post to:
... (
Click for more languages
)
Aici trb facute niste native, prin care sa definitiveze ca are itemu. O sa te ajut mai pe seara, cu un edit.
1
0
Back to top
NeQ.
[Owner ZP]
Status: Offline
(since 02-06-2016 13:05)
Joined: 18 Feb 2012
Posts: 180
,
Topics: 16
Location:
Vaslui
Reputation:
120.2
Votes
: 4
Posted: 29-04-2016, 22:48:13
| Translate post to:
... (
Click for more languages
)
TheVipera wrote:
Aici trb facute niste native, prin care sa definitiveze ca are itemu. O sa te ajut mai pe seara, cu un edit.
Au trecut 2 seri.
Stie cineva sau nu .. ?
0
0
Back to top
destroi112
[DEV]
Status: Offline
(since 12-03-2020 22:13)
Joined: 24 May 2014
Posts: 4042
,
Topics: 119
Location:
---------
Reputation:
515.9
Votes
: 118
Posted: 02-05-2016, 19:02:02
| Translate post to:
... (
Click for more languages
)
Adaugi in primul plugin asta :
si la inceput :
native remove_m4g(id);
si inlocuiesti publicul asta public zp_extra_item_selected(player, itemid) cu ce e aici :
Spoiler:
public zp_extra_item_selected(player, itemid)
{
if ( itemid == g_itemid )
{
if ( user_has_weapon(player, CSW_M4A1) )
{
drop_prim(player)
}
remove_m4g(id);
give_item(player, "weapon_m4a1")
client_print(player, print_chat, "[ZP] You Got Weapon M16! Press E (Use) To Zoom ...")
g_HasM16[player] = true;
}
}
public plugin_natives()
{
register_native("remove_m16", "remove_native", 1)
}
public remove_native(id)
{
g_HasM16 [ id ] = false
}
La al 2-lea e precum primul doar ca modifici nativul din remove_m4g(id) in remove_m16(id);
Sper ca ai inteles.
Adaugi asta pentru nativ la al 2-lea plugin :
si modifici cum ti-am zis si la primul .
public plugin_natives()
{
register_native("remove_m4g", "remove_native", 1)
}
public remove_native(id)
{
g_HasM4[id] = false
}
Retired from Amxmodx
0
0
Back to top
Topic locked
Topic is closed, you cannot post any messages in it anymore
Locked by
destroi112
, 04 June 2016 06:16
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
The time now is 02-12-2024, 05:16:18
Copyright info
Based on phpBB
ro
/
com
B
Login
I forgot my password
World of Warcraft
Login for more...
Download WoW 7.3.5
Misc
eSports
Achievements
Buy reputation with votes
Reputation trades
Forum rules
Ban list
Members list
User guide (FAQ)
World of Warcraft
View details