Raised This Month: $ Target: $400
 0% 

cant compile simple code ..


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 09-03-2012 , 18:51   Re: cant compile simple code ..
Reply With Quote #2

I changed it a bit
Code:
#include < amxmodx >    #include < hamsandwich > #include < fakemeta >   new const oldknife_sounds[][] = {     "weapons/knife_deploy1.wav",    // Deploy Sound     "weapons/knife_hit1.wav",   // Hit 1     "weapons/knife_hit2.wav",   // Hit 2     "weapons/knife_hit3.wav",   // Hit 3     "weapons/knife_hit4.wav",   // Hit 4     "weapons/knife_hitwall1.wav",   // Hit Wall     "weapons/knife_slash1.wav", // Slash 1     "weapons/knife_slash2.wav", // Slash 2     "weapons/knife_stab.wav",     "common/wpn_select.wav"   } const m_pPlayer =    41 new Trie:g_tSounds     public plugin_init( ) {     register_plugin( "Defibrilator", "1.0", "skype lemishev" )         register_event( "CurWeapon", "switchweapon", "be", "1=1", "2!29" )      register_forward( FM_EmitSound, "forward_EmitSound" )         RegisterHam( Ham_Weapon_PrimaryAttack, "weapon_knife", "fw_Knife_PrimaryAttack_Post", true )     RegisterHam( Ham_Weapon_SecondaryAttack, "weapon_knife", "fw_Knife_SecondaryAttack_Post", true )         for( new i = 0; i < sizeof oldknife_sounds; i++ )         TrieSetCell( g_tSounds, oldknife_sounds[ i ], 1 ); } public plugin_precache( ) {     precache_model( "models/knf_new2.mdl" )           precache_sound( "defibrilator/knife_hit1.wav" )             precache_sound( "defibrilator/knife_slash1.wav" )     precache_sound( "defibrilator/knife_deploy1.wav" )   } public switchweapon( id ) {       if( read_data( 2 ) == CSW_KNIFE )     {         set_pev( id, pev_viewmodel2, "models/knf_new2.mdl" )           client_cmd( id, "speak defibrilator/knife_deploy1.wav" )        } } public forward_EmitSound( id, iChannel, const szSound[ ], Float:flVol, Float:flAttn, iFlags, iPitch ) {     if( TrieKeyExists( g_tSounds, szSound ) )     {         if( is_user_alive( id ) )             return FMRES_SUPERCEDE     }     return FMRES_IGNORED; } public fw_Knife_PrimaryAttack_Post( iKnife ) {         static id     id = get_pdata_cbase( iKnife, m_pPlayer, 4 )                if( is_user_connected( id ) )         emit_sound( id, CHAN_WEAPON, "defibrilator/knife_hit1", VOL_NORM, ATTN_NORM, 0, PITCH_NORM )            } public fw_Knife_SecondaryAttack_Post( iKnife ) {     static id     id = get_pdata_cbase( iKnife, m_pPlayer, 4 )     if( is_user_connected( id ) )         emit_sound( id, CHAN_WEAPON, "defibrilator/knife_slash1", VOL_NORM, ATTN_NORM, 0, PITCH_NORM )      }

Anyway your mistake was in
switchweapon(id)
You are missing some }
OvidiuS is offline
Send a message via Skype™ to OvidiuS
 



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 08:17.


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