Raised This Month: $ Target: $400
 0% 

Faster Shooting on class


Post New Thread Reply   
 
Thread Tools Display Modes
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
LAMMPARD8_PRO
Member
Join Date: Dec 2012
Old 12-28-2012 , 20:31   Re: Faster Shooting on class
Reply With Quote #2

from amxmodx.inc the native get_weaponname return u error. go to plugins-zplague.ini and add debug after the plugin's name. (e.g zp_humanclass_enginer.amxx debug)
also your ?changing weapon? function is interasting maded o.o
__________________
[IMG]http://img24.**************/img24/3333/92810204.png[/IMG]
LAMMPARD8_PRO is offline
LAMMPARD8_PRO
Member
Join Date: Dec 2012
Old 12-28-2012 , 20:38   Re: Faster Shooting on class
Reply With Quote #3

PHP Code:
get_weaponname(read_data(2), szWeaponName63)
//should be something like:
get_weaponname (CSW_AK47weaponidlen)
//the function get the weapon ak47 in that case and return u the copyed weapon lenght. 
__________________
[IMG]http://img24.**************/img24/3333/92810204.png[/IMG]
LAMMPARD8_PRO is offline
F0RCE
Senior Member
Join Date: Oct 2010
Old 12-29-2012 , 06:25   Re: Faster Shooting on class
Reply With Quote #4

Isn't there any easy way to set the speed of shooting with weapon?
F0RCE is offline
LAMMPARD8_PRO
Member
Join Date: Dec 2012
Old 12-29-2012 , 06:55   Re: Faster Shooting on class
Reply With Quote #5

ohmmwell.. w/o the speed hack .... i gues sooo...
u can make script that adds speed for 1 of the existing weapons..

u can use something like:

PHP Code:
        new    Ent get_weapon_ent(idweapon)    
        new 
Float:Speed
        
if(Ent)
            {
            
Speed 1.1
            
new Float:Delay get_pdata_floatEnt464) * Speed    
            
if (Delay 0.0){
                
set_pdata_floatEnt46Delay4)
}

__________________
[IMG]http://img24.**************/img24/3333/92810204.png[/IMG]

Last edited by LAMMPARD8_PRO; 12-29-2012 at 06:57.
LAMMPARD8_PRO is offline
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 13:40.


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