Raised This Month: $ Target: $400
 0% 

Help here plzz (Timer) !!!


Post New Thread Reply   
 
Thread Tools Display Modes
kotinha
Senior Member
Join Date: Jun 2009
Location: Alentejo, Portugal :)
Old 12-02-2011 , 19:21   Re: Help here plzz (Timer) !!!
Reply With Quote #11

Quote:
Originally Posted by NiceGuyx View Post
Like this??

PHP Code:
#define TASK_ID 1337


public cmd_play(id)
{
        
set_task(5.0"cmd_weapon"TASK_ID);
}  

public 
cmd_weapon(id)
{
        
give_itemid"weapon_hegrenade" );
        
cs_set_user_bpammoidCSW_HEGRENADE100 );

That's it, but use id instead of TASK_ID
__________________
"If God exists, I hope he has a good excuse." - Woody Allen
kotinha is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 12-03-2011 , 06:55   Re: Help here plzz (Timer) !!!
Reply With Quote #12

You cannot gives 100 hegrenades.
Devil259 is offline
Snaker beatter
Veteran Member
Join Date: Sep 2011
Location: Manila, Philippines
Old 12-03-2011 , 07:17   Re: Help here plzz (Timer) !!!
Reply With Quote #13

He gives 100 hegrenades so try this + some chat infos:

PHP Code:
public cmd_play(id

        
client_print(idprint_chat"You have to wait 5 seconds to get a hegrenade")
        
set_task(5.0"cmd_weapon"id); 
}   

public 
cmd_weapon(id

        
client_print(idprint_chat"You now have hegrenade")
        
give_itemid"weapon_hegrenade" ); 
        
cs_set_user_bpammoidCSW_HEGRENADE); 

__________________
Snaker beatter is offline
kotinha
Senior Member
Join Date: Jun 2009
Location: Alentejo, Portugal :)
Old 12-03-2011 , 09:26   Re: Help here plzz (Timer) !!!
Reply With Quote #14

Quote:
Originally Posted by Devil259 View Post
You cannot gives 100 hegrenades.
I didn't know that, he said that he wanted to delay that plugin so I assumed that the plugin was working...

You could use a global variable with nades left for that player (starting at 100) and then use throw_grenade(id, grenadeId, wId) (from csx) forward to subtract one to the variable, if the variable is greater than 0 give the player another grenade. Example:
PHP Code:
new g_NadesLeft[33]

// (...)

public throw_grenade(idgreIdwId)
{
    if(
wId == CSW_HEGRENADE)
    {
        
g_NadesLeft[id]--;
        
        if(
g_NadesLeft)
            
give_item(id"weapon_hegrenade")
    }

__________________
"If God exists, I hope he has a good excuse." - Woody Allen
kotinha is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 12-03-2011 , 10:32   Re: Help here plzz (Timer) !!!
Reply With Quote #15

Why need to use hard way always?

PHP Code:
 
register_clcmd
("say /infgrenade""cmd_play")

public 
cmd_play(id)
{
        
set_task(5.0"give_nade"id)
}  
 
public 
give_nade
{
        
give_itemid"weapon_hegrenade" );
        
cs_set_user_bpammoidCSW_HEGRENADE100 );

.Dare Devil. is offline
Snaker beatter
Veteran Member
Join Date: Sep 2011
Location: Manila, Philippines
Old 12-03-2011 , 10:36   Re: Help here plzz (Timer) !!!
Reply With Quote #16

Quote:
Originally Posted by .Dare Devil. View Post
Why need to use hard way always?]

PHP Code:
        cs_set_user_bpammoidCSW_HEGRENADE100 ); 
Why still give 100
__________________
Snaker beatter is offline
kotinha
Senior Member
Join Date: Jun 2009
Location: Alentejo, Portugal :)
Old 12-03-2011 , 10:51   Re: Help here plzz (Timer) !!!
Reply With Quote #17

Quote:
Originally Posted by .Dare Devil. View Post
Why need to use hard way always?

PHP Code:
 
register_clcmd
("say /infgrenade""cmd_play")

public 
cmd_play(id)
{
        
set_task(5.0"give_nade"id)
}  
 
public 
give_nade
{
        
give_itemid"weapon_hegrenade" );
        
cs_set_user_bpammoidCSW_HEGRENADE100 );

Because someone said that it wouldn't give 100 grenades that way... That's how I told him to do the first time.

@Snaker beatter, maybe because, I don't know... NiceGuyx asked how to give 100? And not how to give 1?
__________________
"If God exists, I hope he has a good excuse." - Woody Allen
kotinha 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:27.


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