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

Fixing a plugin


Post New Thread Reply   
 
Thread Tools Display Modes
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
quilhos
Veteran Member
Join Date: Jun 2010
Old 05-16-2013 , 10:08   Re: Fixing a plugin
Reply With Quote #2

Why dont you say what's wrong?
__________________
ELO RATING SYSTEM - SQL [COMPLETE]
Quote:
Originally Posted by Liverwiz View Post
DDDRRRRAAAAMMMMAAAAA!!!???

Put this shit on pause while i go get some popcorn!!
quilhos is offline
alicx
BANNED
Join Date: Mar 2013
Location: Tunisia
Old 05-16-2013 , 10:20   Re: Fixing a plugin
Reply With Quote #3

The error:
PHP Code:
/tmp/text8wZmsU.sma(18) : error 001expected token";"but found "new"
/tmp/text8wZmsU.sma(19) : error 001expected token";"but found "new"
/tmp/text8wZmsU.sma(20) : error 001expected token";"but found "new"
/tmp/text8wZmsU.sma(21) : error 001expected token";"but found "new"
/tmp/text8wZmsU.sma(22) : error 001expected token";"but found "new"
/tmp/text8wZmsU.sma(24) : error 001expected token";"but found "public"
/tmp/text8wZmsU.sma(28) : error 001expected token";"but found "public"
/tmp/text8wZmsU.sma(32) : error 001expected token";"but found "-identifier-"
/tmp/text8wZmsU.sma(34) : error 001expected token";"but found "-identifier-"
/tmp/text8wZmsU.sma(35) : error 001expected token";"but found "-identifier-"
/tmp/text8wZmsU.sma(36) : error 001expected token";"but found "-identifier-"
/tmp/text8wZmsU.sma(37) : error 001expected token";"but found "-identifier-"
/tmp/text8wZmsU.sma(39) : error 001expected token";"but found "-identifier-"
/tmp/text8wZmsU.sma(41) : error 001expected token";"but found "-identifier-"
/tmp/text8wZmsU.sma(42) : error 001expected token";"but found "}"
/tmp/text8wZmsU.sma(48) : error 001expected token";"but found "static"
/tmp/text8wZmsU.sma(49) : error 001expected token";"but found "-identifier-"
/tmp/text8wZmsU.sma(50) : error 001expected token";"but found "-identifier-"
/tmp/text8wZmsU.sma(51) : error 001expected token";"but found "-identifier-"
/tmp/text8wZmsU.sma(53) : error 001expected token";"but found "if"
/tmp/text8wZmsU.sma(60) : error 001expected token";"but found "-identifier-"
/tmp/text8wZmsU.sma(61) : error 001expected token";"but found "}"
/tmp/text8wZmsU.sma(67) : error 001expected token";"but found "-identifier-"
/tmp/text8wZmsU.sma(68) : error 001expected token";"but found "}"
/tmp/text8wZmsU.sma(73) : error 001expected token";"but found "}"
/tmp/text8wZmsU.sma(77) : error 001expected token";"but found "public"

Compilation aborted.
26 Errors
alicx is offline
Send a message via MSN to alicx Send a message via Skype™ to alicx
Erdener
Senior Member
Join Date: Apr 2010
Location: Turkey
Old 05-16-2013 , 10:39   Re: Fixing a plugin
Reply With Quote #4

PHP 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_ZoomDist33 ] = 0;
new 
cvar_zoom_type;

public 
plugin_precache()

    
engfunc(EngFunc_PrecacheModelmodel_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_VERSIONFCVAR_SERVER|FCVAR_SPONLY);
    
    
cvar_zoom_type register_cvar("goldendeagle_zoom_type""4");
}

public 
fwCmdStart(iduc_handleseed)
{
    if (!
gAlive[id]) return FMRES_IGNORED;

    static 
buttonoldbuttonsweapon;
    
button get_uc(uc_handleUC_Buttons);
    
oldbuttons pev(idpev_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_zoomidget_pcvar_numcvar_zoom_type ) );
            }
            else
            {
                if (
gZoom[id])
                {
                    
gZoom[id] = false;
                    
cs_set_user_zoomidCS_RESET_ZOOM);
                }
            }
        }
    }
    return 
FMRES_IGNORED;
}

public 
fwPlayerSpawnPost(id) if (is_user_alive(id)) gAlive[id] = true;

public 
fwPlayerKilled(victimattackershouldgibgAlive[victim] = false;

public 
fwWeaponReload(weapon)
{
    if (
fm_get_weapon_ammo(weapon) != 7)
    {
        static 
id;
        
id get_pdata_cbase(weaponm_iPlayer4);

        
set_pdata_int(idm_iFOV905);

        
gReloading[id] = true;
        
set_task(2.3"taskWeaponReloaded"id);
    }
}

public 
taskWeaponReloaded(id)
    
gReloading[id] = false;

public 
fwItemDeployPost(weapon)
{
    static 
id;
    
id get_pdata_cbase(weaponm_iPlayer4);

    
set_pev(idpev_viewmodel2model_deagle_sniper);
}

// cs_to_fm
stock fm_get_weapon_ammo(weapon)
    return 
get_pdata_int(weaponm_iClipAmmois_linux_server() ? m_iExtraOffsetLinux m_iExtraOffsetWindows);
    
    
stock deagle_zoomidtype )
{
    
gZoomid ] = true;
    switch( 
type )
    {
        case 
0cs_set_user_zoomidCS_RESET_ZOOM);
        case 
1cs_set_user_zoomidCS_SET_AUGSG552_ZOOM);
        case 
2:
        {
            
cs_set_user_zoomidCS_SET_FIRST_ZOOM);
            
emit_soundidCHAN_ITEM"weapons/zoom.wav"0.202.400100 );
        }
        case 
3:
        {
            
cs_set_user_zoomidCS_SET_SECOND_ZOOM);
            
emit_soundidCHAN_ITEM"weapons/zoom.wav"0.202.400100 );
        }
        case 
4:
        {
            
g_ZoomDistid ]++;
            
gZoomid ] = false;
            switch( 
g_ZoomDistid ] )
            {
                case 
1cs_set_user_zoomidCS_SET_AUGSG552_ZOOM);
                case 
2
                {
                    
cs_set_user_zoomidCS_SET_FIRST_ZOOM);
                    
emit_soundidCHAN_ITEM"weapons/zoom.wav"0.202.400100 );
                }
                case 
3
                {
                    
cs_set_user_zoomidCS_SET_SECOND_ZOOM);
                    
emit_soundidCHAN_ITEM"weapons/zoom.wav"0.202.400100 );
                }
                case 
4
                {
                    
g_ZoomDistid ] = 0;
                    
cs_set_user_zoomidCS_RESET_ZOOM);
                }
            }
        }
    }

Erdener is offline
alicx
BANNED
Join Date: Mar 2013
Location: Tunisia
Old 05-16-2013 , 12:56   Re: Fixing a plugin
Reply With Quote #5

Thanks a lot
alicx is offline
Send a message via MSN to alicx Send a message via Skype™ to alicx
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 05-16-2013 , 13:05   Re: Fixing a plugin
Reply With Quote #6

Now that it is fixed, he will probably change the author name and release it...
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
wickedd
Veteran Member
Join Date: Nov 2009
Old 05-16-2013 , 13:24   Re: Fixing a plugin
Reply With Quote #7

Quote:
Originally Posted by joshknifer View Post
Now that it is fixed, he will probably change the author name and release it...
That's why I didn't help him.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 05-16-2013 , 13:28   Re: Fixing a plugin
Reply With Quote #8

Quote:
Originally Posted by wickedd View Post
That's why I didn't help him.
lol.
__________________
Kia is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 05-16-2013 , 13:33   Re: Fixing a plugin
Reply With Quote #9

Quote:
Originally Posted by joshknifer View Post
Now that it is fixed, he will probably change the author name and release it...
When did he do that?
EpicMonkey is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 05-16-2013 , 13:59   Re: Fixing a plugin
Reply With Quote #10

Quote:
Originally Posted by EpicMonkey View Post
When did he do that?
https://forums.alliedmods.net/showthread.php?t=216047
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
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 07:29.


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