Raised This Month: $ Target: $400
 0% 

[Help] Don't camp near the bomb


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Mirk
Senior Member
Join Date: Nov 2012
Old 11-26-2015 , 03:54   [Help] Don't camp near the bomb
Reply With Quote #1

Hello guys,
Could you help me fix this plugin, please?

Writes that this error:
L 11/26/2015 - 09:48:41: [AMXX] [0] dont_bomb_camp.sma::PlayerPreThink (line 36)
L 11/26/2015 - 09:48:41: [ENGINE] Invalid entity 83
L 11/26/2015 - 09:48:41: [AMXX] Displaying debug trace (plugin "dont_bomb_camp.amxx")

- In the line 36 is code
HTML Code:
entity_get_vector(weapbox, EV_VEC_origin, fOrigin);
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <fakemeta_util>
#include <engine>

#define PLUGIN "Dont Bomb Camp"
#define VERSION "1.1"
#define AUTHOR "naven"

#define FADE_IN            (1<<0)
#define FADE_OUT        (1<<1)
#define FADE_HOLD        (1<<2)
#define FADE_LENGTH_PERM    (1<<0)

new g_msgFade;
new 
CvarDistance;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
g_msgFade get_user_msgid("ScreenFade");
    
    
register_forward(FM_PlayerPreThink"PlayerPreThink");
    
    
CvarDistance register_cvar("gb_distance""300.0")
}

public 
PlayerPreThink(id)
{
    new 
Float:fOrigin[3], FloatfPlayerOrigin[3];
    new 
weapboxbomb fm_find_ent_by_class(-1"weapon_c4");
    if(
bomb && (weapbox pev(bombpev_owner)) > get_maxplayers())
    {
        
entity_get_vector(weapboxEV_VEC_originfOrigin);
        
entity_get_vector(idEV_VEC_originfPlayerOrigin);
        
        if(
get_distance_f(fOriginfPlayerOrigin) < get_pcvar_float(CvarDistance))
        {
            new 
FloatpunishPercentage 1.0;
            new 
duration = (punishPercentage == 1.0) ? FADE_LENGTH_PERM 1<<12;
            new 
holdTime = (punishPercentage == 1.0) ? FADE_LENGTH_PERM 1<<8;
            new 
fadeType = (punishPercentage == 1.0) ? FADE_HOLD FADE_IN;
            new 
blindness 127 floatround(128.0 punishPercentage);
            
            
message_begin(MSG_ONEg_msgFade, {0,0,0}, id);
            
write_short(duration);
            
write_short(holdTime);
            
write_short(fadeType);
            
write_byte(0);
            
write_byte(0);
            
write_byte(0);
            
write_byte(blindness);
            
message_end();
            
            
set_hudmessage(25500, -1.00.2000.10.5__, -1);
            
show_hudmessage(id"Nekempi u bomby!");
        } else {
            
punish_blind_stop(id);
        }
    }
}

public 
punish_blind_stop(id)
{
    
message_begin(MSG_ONEg_msgFade, {0,0,0}, id);
    
write_short(0);
    
write_short(1<<8);
    
write_short(FADE_OUT);
    
write_byte(0);
    
write_byte(0);
    
write_byte(0);
    
write_byte(255);
    
message_end();

Mirk is offline
 



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 06:18.


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