Raised This Month: $ Target: $400
 0% 

Fixing a plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
alicx
BANNED
Join Date: Mar 2013
Location: Tunisia
Old 05-16-2013 , 09:38   Fixing a plugin
Reply With Quote #1

olease fix this
Code:
/*================================================================================     Deagle Sniper     Copyright (C) 2009 by fezh =================================================================================*/ #include <amxmodx> #include <fakemeta> #include <hamsandwich> #include <cstrike> #define PLUGIN_VERSION "0.1.3" const m_iFOV = 363 const m_iPlayer = 41 const m_iClipAmmo = 51 const m_iExtraOffsetLinux = 4 const m_iExtraOffsetWindows = 0 #pragma semicolon 1 new model_deagle_sniper[] = "models/v_deagle_new.mdl" new gAlive[33] new gZoom[33] new gReloading[33] new g_ZoomDist[ 33 ] = 0 new cvar_zoom_type public plugin_precache()     engfunc(EngFunc_PrecacheModel, model_deagle_sniper)     public plugin_init() {     register_plugin("Deagle Sniper", PLUGIN_VERSION, "fezh")     register_forward(FM_CmdStart, "fwCmdStart")     RegisterHam(Ham_Spawn, "player", "fwPlayerSpawnPost", 1)     RegisterHam(Ham_Killed, "player", "fwPlayerKilled")     RegisterHam(Ham_Weapon_Reload, "weapon_deagle", "fwWeaponReload")     RegisterHam(Ham_Item_Deploy, "weapon_deagle", "fwItemDeployPost", 1)     register_cvar("deagle_sniper", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY)         cvar_zoom_type = register_cvar("goldendeagle_zoom_type", "4") } public fwCmdStart(id, uc_handle, seed) {     if (!gAlive[id]) return FMRES_IGNORED     static button, oldbuttons, weapon     button = get_uc(uc_handle, UC_Buttons)     oldbuttons = pev(id, pev_oldbuttons)     weapon = get_user_weapon(id)     if ((button & IN_ATTACK2) && !(oldbuttons & IN_ATTACK2))     {         if (weapon == CSW_DEAGLE)         {             if (!gZoom[id] && !gReloading[id])             {                 gZoom[id] = true                 deagle_zoom( id, get_pcvar_num( cvar_zoom_type ) )             }             else             {                 if (gZoom[id])                 {                     gZoom[id] = false                     cs_set_user_zoom( id, CS_RESET_ZOOM, 1 )                 }             }         }     }     return FMRES_IGNORED } public fwPlayerSpawnPost(id) if (is_user_alive(id)) gAlive[id] = true public fwPlayerKilled(victim, attacker, shouldgib) gAlive[victim] = false public fwWeaponReload(weapon) {     if (fm_get_weapon_ammo(weapon) != 7)     {         static id         id = get_pdata_cbase(weapon, m_iPlayer, 4)         set_pdata_int(id, m_iFOV, 90, 5)         gReloading[id] = true         set_task(2.3, "taskWeaponReloaded", id)     } } public taskWeaponReloaded(id)     gReloading[id] = false public fwItemDeployPost(weapon) {     static id     id = get_pdata_cbase(weapon, m_iPlayer, 4)     set_pev(id, pev_viewmodel2, model_deagle_sniper) } // cs_to_fm stock fm_get_weapon_ammo(weapon)     return get_pdata_int(weapon, m_iClipAmmo, is_linux_server() ? m_iExtraOffsetLinux : m_iExtraOffsetWindows)         stock deagle_zoom( id, type ) {     gZoom[ id ] = true     switch( type )     {         case 0: cs_set_user_zoom( id, CS_RESET_ZOOM, 1 )         case 1: cs_set_user_zoom( id, CS_SET_AUGSG552_ZOOM, 1 )         case 2:         {             cs_set_user_zoom( id, CS_SET_FIRST_ZOOM, 1 )             emit_sound( id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100 )         }         case 3:         {             cs_set_user_zoom( id, CS_SET_SECOND_ZOOM, 1 )             emit_sound( id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100 )         }         case 4:         {             g_ZoomDist[ id ]++             gZoom[ id ] = false             switch( g_ZoomDist[ id ] )             {                 case 1: cs_set_user_zoom( id, CS_SET_AUGSG552_ZOOM, 1 )                 case 2:                 {                     cs_set_user_zoom( id, CS_SET_FIRST_ZOOM, 1 )                     emit_sound( id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100 )                 }                 case 3:                 {                     cs_set_user_zoom( id, CS_SET_SECOND_ZOOM, 1 )                     emit_sound( id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100 )                 }                 case 4:                 {                     g_ZoomDist[ id ] = 0                     cs_set_user_zoom( id, CS_RESET_ZOOM, 1 )                 }             }         }     } }
alicx is offline
Send a message via MSN to alicx Send a message via Skype™ to alicx
 



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 07:54.


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