Veteran Member
|
09-03-2012
, 19:53
[ZP] Candle Bomb Error en logs
|
#1
|
Bueno estoy utilizando el plugin llamado 'Candle Bomb', pero mire logs y me da unos errors, me podrian ayudar a areglarlo, gracis.
Candle Bomb
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx> #include <chatcolor> #include <cstrike> #include <engine> #include <fakemeta> #include <zombieplague>
#define VERSION "1.2"
new iTrailColor[ 3 ] = { 230, // R 230, // G 230 // B };
new g_iItemId;
new const szItemName[ ] = { "Candle Bomb" }; const szItemCost = 30;
new const szEnt_CandleBomb[ ] = "candle_bomb";
new g_iTrailSpr; new const szSprite_GrenadeTrail[ ] = "sprites/laserbeam.spr";
new g_iRedFlareSpr, g_iBlueFlareSpr; new const szSprite_RedFlare[ ] = "sprites/redflare2.spr"; new const szSprite_BlueFlare[ ] = "sprites/blueflare2.spr";
new g_iCandleAmmo[ 33 ] = 0;
public plugin_init( ) { register_plugin( "[ZP] Extra Item: Candle Bomb", VERSION, "Enigmaya" ); g_iItemId = zp_register_extra_item( szItemName, szItemCost, ZP_TEAM_HUMAN ); register_forward( FM_PlayerPreThink, "Fw_PlayerPreThink" ); register_event( "HLTV", "Ev_HLTV", "a", "1=0", "2=0" ); register_event( "ResetHUD", "Ev_ResetHUD", "b" ); register_touch( "", "", "TouchEntity" ); }
public plugin_precache( ) { precache_sound( "debris/beamstart15.wav" ); precache_sound( "weapons/rocketfire1.wav" ); precache_model( "models/rpgrocket.mdl" ); g_iRedFlareSpr = precache_model( szSprite_RedFlare ); g_iBlueFlareSpr = precache_model( szSprite_BlueFlare ); g_iTrailSpr = precache_model( szSprite_GrenadeTrail ); }
public client_connect( id ) g_iCandleAmmo[ id ] = 0;
public zp_extra_item_selected( id, iItemId ) { if( iItemId == g_iItemId ) { if( g_iCandleAmmo[ id ] ) ChatColor( id, DEFAULT, "^x04[ Candle Bomb ] ^x01Ya tienes una ^x04Candle Bomb^x01!!" ); else { g_iCandleAmmo[ id ] += 1; ChatColor( id, DEFAULT, "^x04[ Candle Bomb ] ^x01Has comprado una^x04 Candle Bomb^x01, pulsa ^x04MOUSE2 [+ATTACK2] ^x01para lanzarla!!" ); } } }
public zp_user_infected_post( id, iInfector ) { if( g_iCandleAmmo[ id ] ) g_iCandleAmmo[ id ] = false; }
public Fw_PlayerPreThink( id ) { new iButton = pev( id, pev_button ) new iOldButton = pev( id, pev_oldbuttons ) if( iOldButton & IN_ATTACK2 && !( iButton & IN_ATTACK2 ) ) CreateEntity( id ) return PLUGIN_CONTINUE; }
public CreateEntity( id ) { if( !is_user_alive( id ) || zp_get_user_zombie( id ) || !g_iCandleAmmo[ id ] ) return PLUGIN_HANDLED; if( get_user_weapon( id ) == CSW_KNIFE || get_user_weapon( id ) == CSW_FLASHBANG || get_user_weapon( id ) == CSW_HEGRENADE || get_user_weapon( id ) == CSW_SMOKEGRENADE || get_user_weapon( id ) == CSW_C4 ) return PLUGIN_HANDLED; entity_set_int( id, EV_INT_effects, 2 ); entity_set_int( id, EV_INT_light_level, 4 ); new Float: fAngle[ 3 ], iOrigin[ 3 ], Float: fPlayerOrigin[ 3 ], Float: fPlayerVelocity[ 3 ]; entity_get_vector( id, EV_VEC_origin, fPlayerOrigin ); get_user_origin( id, iOrigin, 1 ); velocity_by_aim( id, 16, fPlayerVelocity ) iOrigin[ 0 ] += floatround( fPlayerVelocity[ 0 ] ) iOrigin[ 1 ] += floatround( fPlayerVelocity[ 1 ] ) iOrigin[ 2 ] += floatround( fPlayerVelocity[ 2 ] ) ShootFire( iOrigin ) if( ViewContents( id ) == CONTENTS_SKY ) { new iCandleEnt = create_entity( "info_target" ); if( !is_valid_ent( iCandleEnt ) ) return PLUGIN_HANDLED; entity_set_string( iCandleEnt, EV_SZ_classname, szEnt_CandleBomb ); entity_set_model( iCandleEnt, "models/rpgrocket.mdl" ); entity_set_origin( iCandleEnt, fPlayerOrigin ); entity_set_int( iCandleEnt, EV_INT_solid, 2 ); entity_set_edict( iCandleEnt, EV_ENT_owner, id ); entity_set_int( iCandleEnt, EV_INT_movetype, 5 ); entity_set_int( iCandleEnt, EV_INT_effects, 4 ); VelocityByAim( id, 600, fPlayerVelocity ); vector_to_angle( fPlayerVelocity, fAngle ); entity_set_vector( iCandleEnt, EV_VEC_angles, fAngle ); entity_set_vector( iCandleEnt, EV_VEC_velocity, fPlayerVelocity ); message_begin( MSG_BROADCAST, SVC_TEMPENTITY ) write_byte( 22 ) write_short( iCandleEnt ) write_short( g_iTrailSpr ) write_byte( 5 ) write_byte( 5 ) write_byte( iTrailColor[ 0 ] ) // R write_byte( iTrailColor[ 1 ] ) // G write_byte( iTrailColor[ 2 ] ) // B write_byte( 128 ) // Brightness. message_end( ) emit_sound( id,CHAN_BODY, "weapons/rocketfire1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM ); } else { new iSlowLight = create_entity( "info_target" ); if( !is_valid_ent( iSlowLight ) ) return PLUGIN_HANDLED; entity_set_string( iSlowLight, EV_SZ_classname, "slow_light" ); entity_set_model( iSlowLight, "models/rpgrocket.mdl" ); entity_set_origin( iSlowLight, fPlayerOrigin ); entity_set_int( iSlowLight,EV_INT_solid, 2 ); entity_set_edict( iSlowLight,EV_ENT_owner, id ); entity_set_int( iSlowLight, EV_INT_movetype, 5 ); entity_set_int( iSlowLight, EV_INT_effects, 4 ); VelocityByAim( id, 200, fPlayerVelocity ); if( fPlayerVelocity[ 2 ]<=-100.0 ) RemoveEntity( iSlowLight ); fPlayerVelocity[ 2 ] = 0.0; vector_to_angle( fPlayerVelocity, fAngle ); entity_set_vector( iSlowLight, EV_VEC_angles, fAngle ); entity_set_vector( iSlowLight, EV_VEC_velocity, fPlayerVelocity ); emit_sound( id, CHAN_BODY, "debris/beamstart15.wav", 1.0, ATTN_NORM, 0, PITCH_NORM ); set_task( 30.0,"RemoveEntity", iSlowLight ); } g_iCandleAmmo[ id ] = 0; return PLUGIN_HANDLED; }
ShootFire( iOrigin[ 3 ] ) { iOrigin[ 0 ]+=10; iOrigin[ 1 ]+=10; Msg( iOrigin ) iOrigin[ 0 ]-=10; iOrigin[ 1 ]-=10; Msg( iOrigin ) iOrigin[ 0 ]+=10; iOrigin[ 1 ]-=10; Msg( iOrigin ) iOrigin[ 0 ]-=10; iOrigin[ 1 ]+=10; Msg( iOrigin ) }
Msg( iOrigin[ 3 ] ) { message_begin( MSG_BROADCAST,SVC_TEMPENTITY ); write_byte( 9 ); write_coord( iOrigin[ 0 ] ); write_coord( iOrigin[ 1 ] ); write_coord( iOrigin[ 2 ] ); message_end( ); }
public RemoveEntity( iEnt ) { if( is_valid_ent( iEnt ) ) remove_entity( iEnt ); }
public Ev_HLTV( ) { for( new id; id <= 32; id++ ) g_iCandleAmmo[ id ] = false; }
public Ev_ResetHUD( id ) { if( !is_user_alive( id ) || zp_get_user_zombie( id ) ) return PLUGIN_HANDLED; g_iCandleAmmo[ id ] = 1 return PLUGIN_HANDLED; }
public TouchEntity( iTouched, iToucher ) { new iClassName[ 32 ]; if( iToucher ) entity_get_string( iToucher, EV_SZ_classname, iClassName, charsmax( iClassName ) ); if( equal( iClassName, szEnt_CandleBomb ) ) { new Float: fFlashOrigin[ 3 ]; entity_get_vector( iToucher, EV_VEC_origin, fFlashOrigin ); remove_entity( iToucher ); new iSpr; if( random_num( 0, 1 ) ) iSpr = g_iRedFlareSpr; else iSpr = g_iBlueFlareSpr; message_begin( MSG_BROADCAST, SVC_TEMPENTITY ); write_byte( 4 ); write_coord( floatround( fFlashOrigin[ 0 ] ) ); write_coord( floatround( fFlashOrigin[ 1 ] ) ); write_coord( floatround( fFlashOrigin[ 2 ] ) ); message_end( ); message_begin( MSG_BROADCAST, SVC_TEMPENTITY ); write_byte( 15 ); write_coord( floatround( fFlashOrigin[ 0 ] ) ); write_coord( floatround( fFlashOrigin[ 1 ] ) ); write_coord( floatround( fFlashOrigin[ 2 ] ) -5 ); write_coord( floatround( fFlashOrigin[ 0 ] ) ); write_coord( floatround( fFlashOrigin[ 1 ] ) ); write_coord( floatround( fFlashOrigin[ 2 ] ) ); write_short( iSpr ); write_byte( 2 ); write_byte( 55 ); write_byte( 100 ); write_byte( 0 ); write_byte( 0 ); message_end( ); message_begin( MSG_BROADCAST, SVC_TEMPENTITY ); write_byte( 27 ); write_coord( floatround( fFlashOrigin[ 0 ] ) ); write_coord( floatround( fFlashOrigin[ 1 ] ) ); write_coord( floatround( fFlashOrigin[ 2 ] ) ); write_byte( 200 ); write_byte( 230 ); write_byte( 230 ); write_byte( 230 ); write_byte( 100 ); write_byte( 10 ); message_end( ); } else if( equal( iClassName, "slow_light" ) ) remove_entity( iToucher ); }
public client_disconnect( id ) g_iCandleAmmo[ id ] = 0;
__________________
Last edited by leonard19941; 09-03-2012 at 19:58.
|
|