Raised This Month: $51 Target: $400
 12% 

Can someone teach me something ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 06-25-2009 , 04:26   Can someone teach me something ?
Reply With Quote #1

I have a plugin

PHP Code:
#include <amxmodx>
#include <zombieplague>
#include <fun>
 
new TechnoPack
new bool:Techno_Pack[33]
 
public 
plugin_init()
{
 
register_plugin("[ZP] Techno Pack""1.0""ƒa†es™")
 
TechnoPack zp_register_extra_item("Techno Pack ( Techno )"0ZP_TEAM_HUMAN)
 
register_event("HLTV""event_round_start""a""1=0""2=0")
}
 
public 
zp_extra_item_selected(iditemid)
{
 if (
itemid == TechnoPack)
 {      
             
Techno_Packid ] = true  
 
             Glows
id )
 
             
client_print(idprint_chat"[ZP] You have bought a Techno Pack")
 }
 
 else
 {
             
Techno_Packid ] = false
             remove_task
id
             
client_print(idprint_chat"[ZP] Techno Pack finish.")
  }
 
}       
 
public 
event_round_start()
{
 for (new 
idid <= 32id++)
 {
             
Techno_Packid ] = false
  
}

}
 
public 
Death()
{
 
Techno_Packread_data) ] = false
}
 
public 
Glowsid )
{
     
set_task(1.0"Glows"id)
     if( 
is_user_aliveid ) || Techno_Packid ] )
     {
             
set_user_rendering(idkRenderFxGlowShell,  random_num0,255 ),  random_num0,255 ),  random_num0,255 ), kRenderNormal16 )
     }

Anyone know how to remove_task from set_task(1.0, "Glows", id)

I want when Techno_Pack[ id ] = false

It will remove:

PHP Code:
             set_user_rendering(idkRenderFxGlowShell,  random_num0,255 ),  random_num0,255 ),  random_num0,255 ), kRenderNormal16 
The problem is when Techno_Pack[ id ] = false

The
PHP Code:
             set_user_rendering(idkRenderFxGlowShell,  random_num0,255 ),  random_num0,255 ),  random_num0,255 ), kRenderNormal16 
remain.. i want to remove it.
__________________

Last edited by ƒa†es™; 06-25-2009 at 04:28.
ƒa†es™ is offline
zacky
Senior Member
Join Date: Mar 2008
Location: Sweden
Old 06-25-2009 , 04:51   Re: Can someone teach me something ?
Reply With Quote #2

Do this when you set Techno_Pack to false:
PHP Code:
set_user_rendering(idkRenderFxNone,  255,  255,  255kRenderNormal16 
EDIT: Also do this when you set Techno_Pack to false:
PHP Code:
remove_task(id

Last edited by zacky; 06-25-2009 at 04:53.
zacky is offline
Send a message via Skype™ to zacky
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 06-25-2009 , 05:46   Re: Can someone teach me something ?
Reply With Quote #3

Quote:
Originally Posted by zacky View Post
Do this when you set Techno_Pack to false:
PHP Code:
set_user_rendering(idkRenderFxNone,  255,  255,  255kRenderNormal16 
EDIT: Also do this when you set Techno_Pack to false:
PHP Code:
remove_task(id
Doesn't work.

Or maybe i did wrong ?

Can you redo my codes ?
__________________

Last edited by ƒa†es™; 06-25-2009 at 06:00.
ƒa†es™ is offline
zacky
Senior Member
Join Date: Mar 2008
Location: Sweden
Old 06-25-2009 , 06:19   Re: Can someone teach me something ?
Reply With Quote #4

Try this:
PHP Code:
#include <amxmodx>
#include <zombieplague>
#include <fun>
 
new TechnoPack
new bool:Techno_Pack[33]
 
public 
plugin_init()
{
    
register_plugin("[ZP] Techno Pack""1.0""fates")
    
TechnoPack zp_register_extra_item("Techno Pack ( Techno )"0ZP_TEAM_HUMAN)
    
register_event("HLTV""event_new_round""a""1=0""2=0")
    
register_event("DeathMsg""event_DeathMsg""a""1>0")
}
 
public 
zp_extra_item_selected(iditemid)
{
    if (
itemid == TechnoPack)
    {      
        
Techno_Packid ] = true  
 
        Glows
id )
 
        
client_print(idprint_chat"[ZP] You have bought a Techno Pack")
    }
 
    else
    {
        
Techno_Packid ] = false
        remove_task
(id)
        
set_user_rendering(idkRenderFxNone,  255,  255,  255kRenderNormal16 )
        
client_print(idprint_chat"[ZP] Techno Pack finish.")
    }
}       
 
public 
event_new_round()
{
    for (new 
idid <= 32id++)
    {
        
Techno_Packid ] = false
        remove_task
(id)
        
set_user_rendering(idkRenderFxNone,  255,  255,  255kRenderNormal16 )
    }
}
 
public 
event_DeathMsg()
{
    new 
iVictim read_data(2)
    
Techno_Pack[iVictim] = false
    remove_task
(iVictim)
    
set_user_rendering(iVictimkRenderFxNone,  255,  255,  255kRenderNormal16 )
}
 
public 
Glowsid )
{
    if( 
is_user_aliveid ) || Techno_Packid ] )
    {
        
set_user_rendering(idkRenderFxGlowShell,  random_num0,255 ),  random_num0,255 ),  random_num0,255 ), kRenderNormal16 )
        
set_task(1.0"Glows"id)
    }

zacky is offline
Send a message via Skype™ to zacky
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-25-2009 , 06:30   Re: Can someone teach me something ?
Reply With Quote #5

PHP Code:
if( is_user_aliveid ) || Techno_Packid ] )

// ->

if( is_user_aliveid ) && Techno_Packid ] ) 
PHP Code:
for (new idid <= 32id++) // very bad




new g_iMaxplayers;

// plugin init
g_iMaxplayers get_maxplayers( );

// then like this
for (new idid <= g_iMaxplayersid++) 

Since you removing pack on death then you need todo
PHP Code:
register_event("DeathMsg""event_DeathMsg""a""1>0")

// ->

register_event("DeathMsg""event_DeathMsg""a""2>0"// 2 is from read_data ;) 
__________________

Last edited by xPaw; 06-25-2009 at 06:32.
xPaw is offline
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 06-25-2009 , 06:40   Re: Can someone teach me something ?
Reply With Quote #6

Quote:
Originally Posted by xPaw View Post
PHP Code:
if( is_user_aliveid ) || Techno_Packid ] )
 
// ->
 
if( is_user_aliveid ) && Techno_Packid ] ) 
PHP Code:
for (new idid <= 32id++) // very bad
 
 
 
 
new g_iMaxplayers;
 
// plugin init
g_iMaxplayers get_maxplayers( );
 
// then like this
for (new idid <= g_iMaxplayersid++) 

Since you removing pack on death then you need todo
PHP Code:
register_event("DeathMsg""event_DeathMsg""a""1>0")
 
// ->
 
register_event("DeathMsg""event_DeathMsg""a""2>0"// 2 is from read_data ;) 
Can i ask something ?

what is the different with this || and &&
__________________
ƒa†es™ is offline
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 06-25-2009 , 06:45   Re: Can someone teach me something ?
Reply With Quote #7

|| = or
&& = and
__________________
minimiller is offline
Send a message via MSN to minimiller
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 06-25-2009 , 06:45   Re: Can someone teach me something ?
Reply With Quote #8

Quote:
Originally Posted by zacky View Post
Try this:
PHP Code:
#include <amxmodx>
#include <zombieplague>
#include <fun>
 
new TechnoPack
new bool:Techno_Pack[33]
 
public 
plugin_init()
{
    
register_plugin("[ZP] Techno Pack""1.0""fates")
    
TechnoPack zp_register_extra_item("Techno Pack ( Techno )"0ZP_TEAM_HUMAN)
    
register_event("HLTV""event_new_round""a""1=0""2=0")
    
register_event("DeathMsg""event_DeathMsg""a""1>0")
}
 
public 
zp_extra_item_selected(iditemid)
{
    if (
itemid == TechnoPack)
    {      
        
Techno_Packid ] = true  
 
        Glows
id )
 
        
client_print(idprint_chat"[ZP] You have bought a Techno Pack")
    }
 
    else
    {
        
Techno_Packid ] = false
        remove_task
(id)
        
set_user_rendering(idkRenderFxNone,  255,  255,  255kRenderNormal16 )
        
client_print(idprint_chat"[ZP] Techno Pack finish.")
    }
}       
 
public 
event_new_round()
{
    for (new 
idid <= 32id++)
    {
        
Techno_Packid ] = false
        remove_task
(id)
        
set_user_rendering(idkRenderFxNone,  255,  255,  255kRenderNormal16 )
    }
}
 
public 
event_DeathMsg()
{
    new 
iVictim read_data(2)
    
Techno_Pack[iVictim] = false
    remove_task
(iVictim)
    
set_user_rendering(iVictimkRenderFxNone,  255,  255,  255kRenderNormal16 )
}
 
public 
Glowsid )
{
    if( 
is_user_aliveid ) || Techno_Packid ] )
    {
        
set_user_rendering(idkRenderFxGlowShell,  random_num0,255 ),  random_num0,255 ),  random_num0,255 ), kRenderNormal16 )
        
set_task(1.0"Glows"id)
    }


Didn't work.

New round the Glow still remain.
__________________
ƒa†es™ is offline
zacky
Senior Member
Join Date: Mar 2008
Location: Sweden
Old 06-25-2009 , 06:55   Re: Can someone teach me something ?
Reply With Quote #9

It should work.

EDIT: Try this:
Remove new round event and instead add this:
PHP Code:
// plugin_init()
register_logevent("cmdRoundEnded"2"1=Round_End")

public 
cmdRoundEnded()
{
    for (new 
i<= 32i++)
    {
        if (
Techno_Pack[i]) {
            
Techno_Pack[i] = false
            remove_task
(i)
            
set_user_rendering(ikRenderFxNone,  255,  255,  255kRenderNormal16 )
        }
    }


Last edited by zacky; 06-25-2009 at 06:58.
zacky is offline
Send a message via Skype™ to zacky
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 06-25-2009 , 07:41   Re: Can someone teach me something ?
Reply With Quote #10

Quote:
Originally Posted by zacky View Post
It should work.

EDIT: Try this:
Remove new round event and instead add this:
PHP Code:
// plugin_init()
register_logevent("cmdRoundEnded"2"1=Round_End")
 
public 
cmdRoundEnded()
{
    for (new 
i<= 32i++)
    {
        if (
Techno_Pack[i]) {
            
Techno_Pack[i] = false
            remove_task
(i)
            
set_user_rendering(ikRenderFxNone,  255,  255,  255kRenderNormal16 )
        }
    }

Thanks Zacky it work
__________________
ƒa†es™ 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:24.


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