Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Wklejka 132585181712448 dodana przez Redux, 06.01.2012 13:10
Typ:


Grealius
132585181712448
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
/*
[WEGN] Extra Item: Silver M4A1
Team: Humans
 
	Copyrights 2009, Shuttle_Wave
 
--------------------------------------
Coded For Waves Extreme Gaming Network
--------------------------------------
 
------------------------
www.waves-gaming.info
------------------------
 
THIS MOD IS CURRENTLY USE IN [WEGN] Waves Extreme Gaming Network ZOMBIE-PLAGUE
 
///////////////////////
// Credits THANKS    //
///////////////////////
 
Exolent[jNr] : Helping with Silver Bullets and few bugs.
AlejandroSk : Orginal Golden AK47 Script
Alex Kim (Shadow_Wave) : Tester
 
////////////////// 
//Cvars:	//
//////////////////
 
- zp_silverm4_dmg_multiplier <5> - Damage Multiplier for Silver M4A1
- zp_silverm4_silver_bullets <1|0> - Silver bullets effect ?
- zp_silverm4_custom_model <1|0> - M4A1 Custom Model
- zp_silverm4_unlimited_clip <1|0> - M4A1 Unlimited Clip 
*/
 
///////////////////
// Includes	 //
///////////////////
#include <zmvip>
#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <zombieplague>
/////////////////
//Define       //
/////////////////
#define is_valid_player(%1) (1 <= %1 <= 32)
 
///////////////////////////////////////////////////
// ADD OUR OWN CUSTOM SILVER M4A1 MODELS HERE    //
///////////////////////////////////////////////////
 
new M4A1_V_MODEL[64] = "models/WEGN_Zombie/v_m4a1_silver.mdl"
new M4A1_P_MODEL[64] = "models/p_m4a1.mdl"
 
/* Pcvars */
new cvar_dmgmultiplier, cvar_silverbullets,  cvar_custommodel, cvar_uclip
 
// Item ID
new g_itemid
new bool:g_HasM4A1[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_silverm4_dmg_multiplier", "2")
 cvar_custommodel = register_cvar("zp_silverm4_custom_model", "1")
 cvar_silverbullets = register_cvar("zp_silverm4_silver_bullets", "1")
 cvar_uclip = register_cvar("zp_silverm4_unlimited_clip", "1")
 
 // Register The Plugin
 register_plugin("[WEGN] Extra: Silver M4A1", "2.0", "Shuttle_Wave")
 // Register Zombie Plague extra item
 g_itemid = zp_register_extra_item("Srebrne M4a1", 25, ZV_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_HasM4A1[id] = false
}
public client_disconnect(id)
{
 g_HasM4A1[id] = false
}
public Death()
{
 g_HasM4A1[read_data(2)] = false
}
public fwHamPlayerSpawnPost(id)
{
 g_HasM4A1[id] = false
}
public plugin_precache()
{
 precache_model(M4A1_V_MODEL)
 precache_model(M4A1_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_HasM4A1[id] = false
 }
}
public checkModel(id)
{
 if ( zp_get_user_zombie(id) )
  return PLUGIN_HANDLED
 
 new szWeapID = read_data(2)
 
 if ( szWeapID == CSW_M4A1 && g_HasM4A1[id] == true && get_pcvar_num(cvar_custommodel) )
 {
  set_pev(id, pev_viewmodel2, M4A1_V_MODEL)
  set_pev(id, pev_weaponmodel2, M4A1_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_HasM4A1[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_HasM4A1[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_HasM4A1[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_HasM4A1[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_silverbullets))
 {
  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_HasM4A1[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( 255 )       // r, g, b
   write_byte( 255 )       // r, g, b 
   write_byte(200) // brightness
   write_byte(150) // speed
   message_end()
  }
 
  bullets[id] = clip
 }
 
}
public zv_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, "[WEGN] Wlasnie kupiles srebrne M4A1(x2)")
  g_HasM4A1[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)
  }
 }
}
/* Shuttle_Wave Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
*/ 
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/