Raised This Month: $ Target: $400
 0% 

ShadowIdx, Whats the problem?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dogandcat
BANNED
Join Date: Jan 2009
Old 03-25-2009 , 21:47   ShadowIdx, Whats the problem?
Reply With Quote #1

Well, if you dont send my ask to the trash it will be better.i have foun nothing on the search, so y want to ask here!.

i cant put this to work, whats is the problem?:S

Code:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#include <hamsandwich>

// Zombie Attributes
new const zclass_name[] = { "Zombie Invisible" } // name
new const zclass_info[] = { "Totalmente Invisible" } // description
new const zclass_model[] = { "zombie_source" } // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" } // claw model
const zclass_health = 10 // health
const zclass_speed = 200 // speed
const Float:zclass_gravity = 0.92 // gravity
const Float:zclass_knockback = 3.0 // knockback

// Class IDs
new g_invisible
new g_has_invisibility[33]

//shadow message
new g_MsgShadow

// Zombie Classes MUST be registered on plugin_precache
public plugin_precache()
{
    g_invisible = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)    
}

public plugin_init()
{
    register_plugin("[ZP] Class: Invisible", "0.1", "MasI");
    g_MsgShadow = get_user_msgid ( "ShadowIdx" );
}
        
public fw_PlayerPreThink(player)
{
    if(!is_user_alive(player))
        return FMRES_IGNORED
        
    if(zp_get_user_zombie(player) && zp_get_user_zombie_class(player) == g_invisible)
        set_pev(player, pev_flTimeStepSound, 999)
        
    return FMRES_IGNORED
}


stock fm_set_user_footsteps(id, bool:set = true) 
{
    set_pev(id, pev_flTimeStepSound,set ? 999 : 400)
    has_silent[id] = set
    
    return 1
}    

public ShadowIdx(id)
{
    // Not alive
    if (!is_user_alive(id))
        return;
        
    if (zp_get_user_zombie_class(id) == g_invisible && zp_get_user_zombie(id) && !zp_get_user_nemesis(id) && is_user_connected(id)) 
    {
        message_begin ( MSG_ONE_UNRELIABLE, g_MsgShadow, _, id );
        write_long ( 0 );
        message_end ();
    }
}

Last edited by dogandcat; 03-26-2009 at 12:34. Reason: Added [CODE] tags.
dogandcat is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-25-2009 , 21:59   Re: ShadowIdx, how to use?Dont TRASH please !
Reply With Quote #2

1. Use [CODE], [PAWN], [SMALL], or [PHP] tags whenever you post code.

2. The function "ShadowIdx" is never called.

3. Try sending ShadowIdx message every time the player spawns.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 03-26-2009 , 07:11   Re: ShadowIdx, how to use?Dont TRASH please !
Reply With Quote #3

Backing up what Exolent said.

PHP Code:
g_MsgShadow get_user_msgid "ShadowIdx" ); 
That isn't calling the ShadowIdx function. You have nothing calling it. You probably meant to call it in the PlayerPreThink.
BOYSplayCS is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 03-26-2009 , 10:03   Re: ShadowIdx, how to use?Dont TRASH please !
Reply With Quote #4

Fix your topic title before you post again or I will trash this.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
dogandcat
BANNED
Join Date: Jan 2009
Old 03-26-2009 , 12:41   Re: ShadowIdx, Whats the problem?
Reply With Quote #5

so... whats the problem now?this dont work :S


Code:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#include <hamsandwich>

// Zombie Attributes
new const zclass_name[] = { "Zombie Invisible" } // name
new const zclass_info[] = { "Totalmente Invisible" } // description
new const zclass_model[] = { "zombie_source" } // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" } // claw model
const zclass_health = 10 // health
const zclass_speed = 200 // speed
const Float:zclass_gravity = 0.92 // gravity
const Float:zclass_knockback = 3.0 // knockback

// Class IDs
new g_invisible

//shadow message
new g_MsgShadow

// Zombie Classes MUST be registered on plugin_precache
public plugin_precache()
{
    g_invisible = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)    
}

public plugin_init()
{
    register_plugin("[ZP] Class: Invisible", "0.1", "MasI");
    g_MsgShadow = get_user_msgid ( "ShadowIdx" );
}

public zp_user_infected_post(id, infector)
{
    if (zp_get_user_zombie_class(id) == g_invisible)
    {
        invisible(id)
    }
}
        
public fw_PlayerPreThink(player)
{
    if(!is_user_alive(player))
        return FMRES_IGNORED
        
    if(zp_get_user_zombie(player) && zp_get_user_zombie_class(player) == g_invisible)
        set_pev(player, pev_flTimeStepSound, 999)
        
    return FMRES_IGNORED
}


stock fm_set_user_footsteps(id, bool:set = true) 
{
    set_pev(id, pev_flTimeStepSound,set ? 999 : 400)
    has_silent[id] = set
    
    return 1
}    

public ShadowIdx(id)
{
    // Not alive
    if (!is_user_alive(id))
        return;
        
    if (zp_get_user_zombie_class(id) == g_invisible && zp_get_user_zombie(id) && !zp_get_user_nemesis(id) && is_user_connected(id)) 
    {
        message_begin ( MSG_ONE_UNRELIABLE, g_MsgShadow, _, id );
        write_long ( 0 );
        message_end ();
    }
    set_task(0.1, "ShadowIdx", id)
}

public invisible(id)
{
    if (zp_get_user_zombie_class(id) == g_invisible && zp_get_user_zombie(id) && !zp_get_user_nemesis(id))
    {
        ShadowIdx(id)
    }
}
dogandcat is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-27-2009 , 09:00   Re: ShadowIdx, Whats the problem?
Reply With Quote #6

It should work. ( Calling one time is enough )
Arkshine is offline
dogandcat
BANNED
Join Date: Jan 2009
Old 03-27-2009 , 13:51   Re: ShadowIdx, Whats the problem?
Reply With Quote #7

Quote:
Originally Posted by arkshine View Post
It should work. ( Calling one time is enough )
it should, but it doesnt work T_T

i have tried with both forms, calling only one time and calling it every 0.1 sec.

:S

please help T_T
dogandcat is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-27-2009 , 13:57   Re: ShadowIdx, Whats the problem?
Reply With Quote #8

Try to debug. The syntax is right, so it means that the message is not called and thus there are problems with your checks.
Arkshine is offline
dogandcat
BANNED
Join Date: Jan 2009
Old 03-27-2009 , 14:28   Re: ShadowIdx, Whats the problem?
Reply With Quote #9

tried debuggin the plugin, nothing hapenned
dogandcat is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-27-2009 , 15:36   Re: ShadowIdx, Whats the problem?
Reply With Quote #10

No, he didn't mean add "debug" in the plugins.ini
He meant that you should make debug client_print() messages so you can see what is called and what isn't.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 08:59.


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