Raised This Month: $ Target: $400
 0% 

Thunder, more than 1 use


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 11-16-2011 , 15:09   Thunder, more than 1 use
Reply With Quote #1

I already changed the havetk to other values ​​such as 3, but even so the use is limited to one use only.

PHP Code:
public zp_extra_item_selected(iditemid)
{
    if (
itemid == g_tknife)
    {
        
havetk[id] = 1
        client_print
(idprint_chat"[ZP] You got Thunder Knife! Slash a Zombie to kill him with thunder")
    }

thunder original plugin code by fiendshard
PHP Code:
#include <amxmodx>
#include <engine>
#include <zombieplague>

new havetk[33
new 
g_lightningg_smoke
new g_tknife

public plugin_init()
{
    
register_plugin"[ZP] Thunder Knife""0.1""fiendshard" );
    
register_event("Damage" "event_Damage" "b" "2>0");
    
g_tknife zp_register_extra_item("Thunder Knife (Once)"30ZP_TEAM_HUMAN
}
public 
plugin_precache()
{
    
g_lightning precache_model"sprites/lgtning.spr" );
    
g_smoke precache_model"sprites/steam1.spr" );
}

public 
zp_extra_item_selected(iditemid)
{
    if (
itemid == g_tknife)
    {
        
havetk[id] = 1
        client_print
(idprint_chat"[ZP] You got Thunder Knife! Slash a Zombie to kill him with thunder")
    }
}

public 
event_Damage(id)
{
    new 
weapon
    
new attacker get_user_attacker(id weapon);
    
    if(!
is_user_alive(attacker))
        return 
PLUGIN_CONTINUE;
    
    if       ((
zp_get_user_zombie(attacker)) ||
        (
zp_get_user_nemesis(attacker)) || 
        (
zp_get_user_survivor(attacker)))
    return 
PLUGIN_HANDLED;
    
    if(
weapon == CSW_KNIFE && havetk[attacker])
    {
        new 
vorigin], pos];
        
get_user_originidvorigin );
        
vorigin] -= 26;
        
pos] = vorigin] + 150;
        
pos] = vorigin] + 150;
        
pos] = vorigin] + 800;
        
        {
            if(
zp_get_user_nemesis(id))
            return 
PLUGIN_HANDLED;
        }
        
        
user_kill(id);
        
Thunderposvorigin );
        
Smokevorigin1010 );
        
        
havetk[attacker] = 0
        
return PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}
Thunderstart], end] )
{
message_beginMSG_BROADCASTSVC_TEMPENTITY ); 
write_byteTE_BEAMPOINTS ); 
write_coordstart] ); 
write_coordstart] ); 
write_coordstart] ); 
write_coordend] ); 
write_coordend] ); 
write_coordend] ); 
write_shortg_lightning ); 
write_byte);
write_byte);
write_byte);
write_byte150 );
write_byte30 );
write_byte200 ); 
write_byte200 );
write_byte200 );
write_byte200 );
write_byte200 );
message_end();

message_beginMSG_PVSSVC_TEMPENTITYend );
write_byteTE_SPARKS );
write_coordend]  );
write_coordend]);
write_coordend] );
message_end();
}

Smokeiorigin], scaleframerate )
{
message_beginMSG_BROADCASTSVC_TEMPENTITY );
write_byteTE_SMOKE );
write_coordiorigin] );
write_coordiorigin] );
write_coordiorigin] );
write_shortg_smoke );
write_bytescale );
write_byteframerate );
message_end();
}

public 
event_round_start()
{
    static 
imax_players
    
if (!max_playersmax_players get_maxplayers()

    for(
1<= max_playersi++)
        if (
is_user_connected(i)) havetk[i] = 0

Anyone know how to fix it?

Thanks.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM
rodrigo286 is offline
 



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


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