Raised This Month: $32 Target: $400
 8% 

ZP Human Fastshooter


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
F0RCE
Senior Member
Join Date: Oct 2010
Old 02-25-2017 , 21:07   ZP Human Fastshooter
Reply With Quote #1

Hello,

I tried to make human class in zombie mod, that can shot faster.
It is working, however there are errors spamming in console:

Code:
L 02/26/2017 - 03:03:23: [ZP] Invalid Player (1) L 02/26/2017 - 03:03:23: [AMXX] Displaying debug trace (plugin "zp_klasa_szybkostrzelny.amxx") L 02/26/2017 - 03:03:23: [AMXX] Run time error 10: native error (native "zp_core_is_zombie") L 02/26/2017 - 03:03:23: [AMXX]    [0] zp_klasa_szybkostrzelny.sma::eventCurWeapon (line 38)
Do you have any idea how to fix it?

Thank you sincerly.
Attached Files
File Type: sma Get Plugin or Get Source (zp_klasa_szybkostrzelny.sma - 509 views - 2.0 KB)
F0RCE is offline
F0RCE
Senior Member
Join Date: Oct 2010
Old 02-26-2017 , 04:53   Re: ZP Human Fastshooter
Reply With Quote #2

Anyone,

Please ;(?
F0RCE is offline
xTr3m3r
Member
Join Date: Feb 2010
Old 02-26-2017 , 05:10   Re: ZP Human Fastshooter
Reply With Quote #3

Try this
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[] = "Specjalista"
new const humanclass2_info[] = "Szybciej strzela z broni"
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")

    return 
PLUGIN_CONTINUE
}

public 
eventCurWeapon(id)
{
        if(!
is_user_connected(id) && !is_user_alive(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_namehumanclass2_infohumanclass2_healthhumanclass2_speedhumanclass2_gravity)
    new 
index
    
for (index 0index sizeof humanclass2_modelsindex++)
        
zp_class_human_register_model(g_HumanClassIDhumanclass2_models[index])

EDIT:

Can you upload these 2 includes

#include <zp50_class_human>
#include <zp50_core>

you can find them and YourCSFolder/cstrike/addons/amxmodx/scripting/include

Last edited by xTr3m3r; 02-26-2017 at 05:11.
xTr3m3r is offline
F0RCE
Senior Member
Join Date: Oct 2010
Old 02-26-2017 , 05:14   Re: ZP Human Fastshooter
Reply With Quote #4

Uploaded.


PS.

Errors are still appearing

Code:
L 02/26/2017 - 11:15:58: Invalid weapon id 0 L 02/26/2017 - 11:15:58: [AMXX] Displaying debug trace (plugin "zp_klasa_szybkostrzelny.amxx") L 02/26/2017 - 11:15:58: [AMXX] Run time error 10: native error (native "get_weaponname") L 02/26/2017 - 11:15:58: [AMXX]    [0] zp_klasa_szybkostrzelny.sma::eventCurWeapon (line 44)
Attached Files
File Type: sma Get Plugin or Get Source (zp50_class_human.sma - 393 views - 19.1 KB)
File Type: sma Get Plugin or Get Source (zp50_core.sma - 430 views - 10.6 KB)

Last edited by F0RCE; 02-26-2017 at 05:17.
F0RCE is offline
xTr3m3r
Member
Join Date: Feb 2010
Old 02-26-2017 , 05:15   Re: ZP Human Fastshooter
Reply With Quote #5

These are .sma files. I need the includes (.inc). They can be found in the path I mentioned above.
xTr3m3r is offline
F0RCE
Senior Member
Join Date: Oct 2010
Old 02-26-2017 , 05:27   Re: ZP Human Fastshooter
Reply With Quote #6

Sorry,

My bad.
Attached Files
File Type: inc zp50_core.inc (3.5 KB, 107 views)
File Type: inc zp50_class_human.inc (4.5 KB, 89 views)
F0RCE is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-26-2017 , 05:49   Re: ZP Human Fastshooter
Reply With Quote #7

Why would you use fakemeta_util? It's useless.

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 <engine> #include <fakemeta> // Raptor Human Attributes new const humanclass2_name[] = "Specjalista" new const humanclass2_info[] = "Szybciej strzela z broni" 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")     return PLUGIN_CONTINUE } public eventCurWeapon(id) {         new weapon = read_data(2)         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(weapon, szWeaponName, 63)                 new iEnt = find_ent_by_owner(-1, szWeaponName, id)                 if(!pev_valid(iEnt))         return PLUGIN_HANDLED;         set_pdata_float( iEnt, 46, ( get_pdata_float(iEnt, 46, 4) * fSpeedMultiplier), 4 );         set_pdata_float( iEnt, 47, ( get_pdata_float(iEnt, 47, 4) * fSpeedMultiplier), 4 );                 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_info, humanclass2_health, humanclass2_speed, humanclass2_gravity)     new index     for (index = 0; index < sizeof humanclass2_models; index++)         zp_class_human_register_model(g_HumanClassID, humanclass2_models[index]) }
__________________

Last edited by edon1337; 02-26-2017 at 05:50.
edon1337 is offline
F0RCE
Senior Member
Join Date: Oct 2010
Old 02-26-2017 , 06:09   Re: ZP Human Fastshooter
Reply With Quote #8

Still,

Code:
L 02/26/2017 - 12:08:32: Invalid weapon id 0 L 02/26/2017 - 12:08:32: [AMXX] Displaying debug trace (plugin "zp_klasa_szybkostrzelny.amxx") L 02/26/2017 - 12:08:32: [AMXX] Run time error 10: native error (native "get_weaponname") L 02/26/2017 - 12:08:32: [AMXX]    [0] zp_klasa_szybkostrzelny.sma::eventCurWeapon (line 47)
F0RCE is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-26-2017 , 06:21   Re: ZP Human Fastshooter
Reply With Quote #9

Then..
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 <engine> #include <fakemeta> // Raptor Human Attributes new const humanclass2_name[] = "Specjalista" new const humanclass2_info[] = "Szybciej strzela z broni" 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) {     new weapon = read_data(2)     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(weapon, szWeaponName, 63)         new iEnt = find_ent_by_owner(-1, szWeaponName, id)         if(!pev_valid(iEnt))     return PLUGIN_HANDLED;     if(iEnt > 0) {         set_pdata_float( iEnt, 46, ( get_pdata_float(iEnt, 46, 4) * fSpeedMultiplier), 4 );         set_pdata_float( iEnt, 47, ( get_pdata_float(iEnt, 47, 4) * fSpeedMultiplier), 4 );     }         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_info, humanclass2_health, humanclass2_speed, humanclass2_gravity)     new index     for (index = 0; index < sizeof humanclass2_models; index++)     zp_class_human_register_model(g_HumanClassID, humanclass2_models[index]) }
__________________
edon1337 is offline
F0RCE
Senior Member
Join Date: Oct 2010
Old 02-26-2017 , 06:56   Re: ZP Human Fastshooter
Reply With Quote #10

I guess that I should just delete this class...
Errors still appearing...

Code:
L 02/26/2017 - 12:54:46: Invalid weapon id 0 L 02/26/2017 - 12:54:46: [AMXX] Run time error 10 (plugin "zp_klasa_szybkostrzelny.amxx") (native "get_weaponname") - debug not enabled! L 02/26/2017 - 12:54:46: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
Thanks for help anyway...
F0RCE is offline
Reply


Thread Tools
Display Modes

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:38.


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