AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   ShadowIdx, Whats the problem? (https://forums.alliedmods.net/showthread.php?t=88518)

dogandcat 03-25-2009 21:47

ShadowIdx, Whats the problem?
 
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 ();
    }
}


Exolent[jNr] 03-25-2009 21:59

Re: ShadowIdx, how to use?Dont TRASH please !
 
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.

BOYSplayCS 03-26-2009 07:11

Re: ShadowIdx, how to use?Dont TRASH please !
 
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.

YamiKaitou 03-26-2009 10:03

Re: ShadowIdx, how to use?Dont TRASH please !
 
Fix your topic title before you post again or I will trash this.

dogandcat 03-26-2009 12:41

Re: ShadowIdx, Whats the problem?
 
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)
    }
}


Arkshine 03-27-2009 09:00

Re: ShadowIdx, Whats the problem?
 
It should work. ( Calling one time is enough )

dogandcat 03-27-2009 13:51

Re: ShadowIdx, Whats the problem?
 
Quote:

Originally Posted by arkshine (Post 790128)
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

Arkshine 03-27-2009 13:57

Re: ShadowIdx, Whats the problem?
 
Try to debug. The syntax is right, so it means that the message is not called and thus there are problems with your checks.

dogandcat 03-27-2009 14:28

Re: ShadowIdx, Whats the problem?
 
tried debuggin the plugin, nothing hapenned

Exolent[jNr] 03-27-2009 15:36

Re: ShadowIdx, Whats the problem?
 
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.


All times are GMT -4. The time now is 08:59.

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