Raised This Month: $ Target: $400
 0% 

Subplugin Submission [ZP] Extra Item : Invisible || Updated v1.4.3 [26/12/2009]


Post New Thread Reply   
 
Thread Tools Display Modes
BeAfraid
Senior Member
Join Date: Jun 2008
Location: Poland
Old 02-04-2009 , 15:05   Re: [ZP] Extra Item : Invisible || Updated v1.3.6
Reply With Quote #51

Code:
/*
/
/
/                [ZP] Extra Item : Invisible
/                  (ability for Humans and Zombies)
/
/                    by The_Thing
/
/    
/
/    Description :
/    
/            Have You ever wanted that if there are so many zombies around You and then You can't escape from them? 
/            Now You can just buy this ability and You will be invisible untill You will be dead.
/            Same for zombies. If there are so many Humans around You and can't hide from them then now You can, just buy this ability.
/
/
/
/    Cvars :
/
/            zp_invisible <1|0>         - Default is 1
/            zp_invisible_cost "55"         - How much this ability will cost to You 
/            zp_invisble_amount "55"        - Amount of invisible
/            zp_invisible_long "15.0"    - How long you will have invisibility
/
/
/    Command :
/
/            say /invis to buy invisibility or say it in team chat, 
/            say_team /invis
/
/
/
/    Credits :
/
/            Antibots - For little helping
/
/
/
/    Changelog :
/
/            19/10/2008 - v1.0 - First release
/            19/10/2008 - v1.1 - fixed invisibility and removed unnecessary cvar.
/            19/10/2008 - v1.1.1 - changed to lower render that at least someone could notice invisible person.
/            19/10/2008 - v1.1.2 - changed plugin name
/            19/10/2008 - v1.2 - removed unnecessary code and fun module, added some new one and using fakemeta instead. (Thanks for Antibots)
/            19/10/2008 - v1.2.1 - changed render stuff
/            24/10/2008 - v1.3 - rewrited plugin, added some cvars and commands.
/            25/10/2008 - v1.3.1 - fixed small typo. (Thanks to Mlk27)
/            22/11/2008 - v1.3.2 - added cvar for invisible amount
/            04/12/2008 - v1.3.4 - fixed invisible was working all the time, added cvar for after how long time invisibility will end.
/            05/12/2008 - v1.3.6 - corrected chat messages, added message when invisibility are over, changed glow shell cuz that was possibly for player glowing.
/
*/    

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

#define PLUGIN "[ZP] Extra Item : Invisible"
#define VERSION "1.3.6"
#define AUTHOR "The_Thing"


new g_item_name[] = { "Invisible" }
new g_itemid_invisible, invisible_toggle, invisible_amount, invisible_cost, invisible_long
new bool:g_hasInvisible[33]

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR)

    invisible_toggle = register_cvar("zp_invisible", "1")
    invisible_cost = register_cvar("zp_invisible_cost", "55")
    invisible_amount = register_cvar("zp_invisble_amount", "55")
    invisible_long = register_cvar("zp_invisible_long", "15.0")
    
    register_clcmd("say /invis", "buy_invisible")
    register_clcmd("say_team /invis", "buy_invisible")
    
    register_event("DeathMsg", "Death", "a")
    register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
    
    g_itemid_invisible = zp_register_extra_item(g_item_name, get_pcvar_num(invisible_cost), ZP_TEAM_HUMAN & ZP_TEAM_ZOMBIE)
}

public client_connect(id)
{
    g_hasInvisible[id] = false
    fm_set_rendering(id, kRenderFxNone, 0,0,0,kRenderNormal, 255)
}

public client_disconnect(id)
{
    g_hasInvisible[id] = false
    fm_set_rendering(id, kRenderFxNone, 0,0,0,kRenderNormal, 255)
}

public Death()
{
    g_hasInvisible[read_data(2)] = false
}

public event_round_start()
{
    for (new i = 1; i <= 32; i++)
    {
        g_hasInvisible[i] = false
        fm_set_rendering(i, kRenderFxNone, 0,0,0,kRenderNormal, 255)
    }

}

public zp_extra_item_selected(player, itemid)
{
    if (itemid == g_itemid_invisible)
    {
        g_hasInvisible[player] = true
        
        fm_set_rendering(player,kRenderFxGlowShell,0,0,0,kRenderTransAlpha, get_pcvar_num(invisible_amount))
        set_task(get_pcvar_float(invisible_long), "invisible_over", player)
        client_print(player, print_chat, "[ZP] You are now invisible, have fun to hunt.")
    }
}

public buy_invisible(id)
{
    if ( get_pcvar_num(invisible_toggle) == 0 )
    {
        client_print(id, print_chat, "[ZP] Invisibility are disabled.")
        return PLUGIN_HANDLED
    }
    
    if ( is_user_alive(id) && zp_get_user_zombie(id) )
    {
        client_print(id, print_chat, "[ZP] You have bought invisible ability.")
        return PLUGIN_CONTINUE
    }
    
    if ( !is_user_alive(id) )
    {
        client_print(id, print_chat, "[ZP] You are DEAD, you can't buy anything.")
        return PLUGIN_HANDLED
    }
    
    if ( g_hasInvisible[id] )
    {
        client_print(id, print_chat, "[ZP] You already bought this ability")
        return PLUGIN_HANDLED
    }
    
    new money = zp_get_user_ammo_packs(id)
    
    if ( money < get_pcvar_num(invisible_cost) )
    {
        client_print(id, print_chat, "[ZP] You don't have enough ammo packs to buy this ability")
        return PLUGIN_HANDLED
    }
    
    g_hasInvisible[id] = true
    
    fm_set_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha, get_pcvar_num(invisible_amount))
    set_task(get_pcvar_float(invisible_long), "invisible_over", id)
    client_print(id, print_chat, "[ZP] You are now invisible, have fun to hunt.")
    
    zp_set_user_ammo_packs(id, money - get_pcvar_num(invisible_cost))
    
    return PLUGIN_HANDLED
}

public invisible_over(id)
{
    g_hasInvisible[id] = false
    fm_set_rendering(id, kRenderFxNone, 0,0,0,kRenderNormal, 255)
    client_print(id, print_chat, "[ZP] Invisibility are over...")
}

stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16) 
{
    new Float:RenderColor[3];
    RenderColor[0] = float(r);
    RenderColor[1] = float(g);
    RenderColor[2] = float(b);

    set_pev(entity, pev_renderfx, fx);
    set_pev(entity, pev_rendercolor, RenderColor);
    set_pev(entity, pev_rendermode, render);
    set_pev(entity, pev_renderamt, float(amount));

    return 1;
}
Here you are.
Attached Files
File Type: sma Get Plugin or Get Source (zp_extra_invisible.sma - 655 views - 5.4 KB)
BeAfraid is offline
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 02-05-2009 , 11:38   Re: [ZP] Extra Item : Invisible || Updated v1.4.1 [05/02/2009]
Reply With Quote #52

New release v1.4.1, for more info read changelog.
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.
Fry! is offline
rzlqwerty
Member
Join Date: Nov 2008
Old 02-05-2009 , 12:53   Re: [ZP] Extra Item : Invisible || Updated v1.4.1 [05/02/2009]
Reply With Quote #53

make error with the textures[IMG]http://img7.**************/img7/171/zmtoronto0000sd5.png[/IMG]
rzlqwerty is offline
BeAfraid
Senior Member
Join Date: Jun 2008
Location: Poland
Old 02-05-2009 , 13:00   Re: [ZP] Extra Item : Invisible || Updated v1.4.1 [05/02/2009]
Reply With Quote #54

Fry! my problem will be removed ?
BeAfraid is offline
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 02-05-2009 , 13:20   Re: [ZP] Extra Item : Invisible || Updated v1.4.1 [05/02/2009]
Reply With Quote #55

@ rzlqwerty

What the hell? That isn't from my plugin lol. How come invisible which is meant for players can mess up Textures of the map?

@ BeAfraid

It should be cuz I fixed your problem...
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.
Fry! is offline
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 02-05-2009 , 14:45   Re: [ZP] Extra Item : Invisible || Updated v1.4.2 [05/02/2009]
Reply With Quote #56

New update v1.4.2, Fixed some minor stuff.
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.
Fry! is offline
lIIusion
BANNED
Join Date: Feb 2009
Old 02-06-2009 , 03:56   Re: [ZP] Extra Item : Invisible || Updated v1.4.2 [05/02/2009]
Reply With Quote #57

lol, thanks for the fix.
lIIusion is offline
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 12-26-2009 , 14:36   Re: [ZP] Extra Item : Invisible || Updated v1.4.3 [26/12/2009]
Reply With Quote #58

New updated release v1.4.3, for more info check main post!
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.
Fry! is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 12-26-2009 , 14:54   Re: [ZP] Extra Item : Invisible || Updated v1.4.3 [26/12/2009]
Reply With Quote #59

hmm using fm_set_rendering.I have feeling that if zombie will buy invisibility and then will be frozen - he will lost this ability.If this happens - you should use
Code:
register_forward ( FM_AddToFullPack, "fw_AddToFullPack" )
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 12-26-2009 , 15:00   Re: [ZP] Extra Item : Invisible || Updated v1.4.3 [26/12/2009]
Reply With Quote #60

Ok, thanks for advice!
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.
Fry! 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 01:12.


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