Raised This Month: $ Target: $400
 0% 

Faster Shooting on class


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
F0RCE
Senior Member
Join Date: Oct 2010
Old 12-28-2012 , 20:08   Faster Shooting on class
Reply With Quote #1

Hello, I have a problem with this plugin :

PHP Code:
/*================================================================================
    
    ----------------------------------
    -*- [ZP] Class: Human: FastShoot -*-
    ----------------------------------
    
    This plugin is part of Zombie Plague Mod and is distributed under the
    terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
    
================================================================================*/


#include <amxmodx>
#include <zp50_class_human>
#include <zp50_core>
#include <fakemeta_util>

// Raptor Human Attributes
new const humanclass2_name[] = "Engineer"
new const humanclass2_info[] = "Shoot faster with every weapon"
new const humanclass2_models[][] = { "leet" }
const 
humanclass2_health 75
const Float:humanclass2_speed 1.0
const Float:humanclass2_gravity 1.2

new g_HumanClassID


public plugin_init()
{

    
register_event("CurWeapon","eventCurWeapon""b")
}

public 
eventCurWeapon(id)
{
        if(!
is_user_connected(id) && !is_user_alive(id)  && zp_core_is_zombie(id) &&  zp_class_human_get_current(id) != g_HumanClassID)
                return 
PLUGIN_CONTINUE
                
        
static Float:fSpeedMultiplier 0.8;
                
        new 
szWeaponName[64];
        
get_weaponname(read_data(2), szWeaponName63)
        
        new 
iEnt fm_find_ent_by_owner(-1szWeaponNameid)
        
        
set_pdata_floatiEnt46, ( get_pdata_float(iEnt464) * fSpeedMultiplier), );
        
set_pdata_floatiEnt47, ( get_pdata_float(iEnt474) * fSpeedMultiplier), );
        
        return 
PLUGIN_CONTINUE
}


public 
plugin_precache()
{
    
register_plugin("[ZP] Klasa Ludzi: Specjalista"ZP_VERSION_STRING"ZP Dev Team")
    
    
g_HumanClassID zp_class_human_register(humanclass2_name,  humanclass2_infohumanclass2_healthhumanclass2_speed,  humanclass2_gravity)
    new 
index
    
for (index 0index sizeof humanclass2_modelsindex++)
        
zp_class_human_register_model(g_HumanClassIDhumanclass2_models[index])

It throws errors all the time, and the server crash :

PHP Code:
L 12/26/2012 22:55:54Invalid weapon id 0
L 12
/26/2012 22:55:54: [AMXXDisplaying debug trace (plugin "zp_klasa_szybkostrzelny.amxx")
L 12/26/2012 22:55:54: [AMXXRun time error 10native error (native "get_weaponname")
L 12/26/2012 22:55:54: [AMXX]    [0zp_klasa_szybkostrzelny.sma::eventCurWeapon (line 50
I have created this human class myself, but can't fix it atm
Thanks for help.
F0RCE 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 13:41.


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