Raised This Month: $ Target: $400
 0% 

public event_round_start


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Samsoniq
Junior Member
Join Date: May 2010
Old 03-30-2011 , 12:16   public event_round_start
Reply With Quote #1

HTML Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>

new rbnumber[33]

public plugin_init()
{
    register_plugin("RedBull","1.0","*SAms0n_")
    register_clcmd("rb","aredbull")
    register_cvar("RBCost","10")
    register_cvar("RBLasts","30.0")      
        register_logevent("event_round_start", 2, "1=Round_Start")
}
public client_connect(id)
{
    rbnumber[id]=0
}

public client_disconnect(id)
{
    rbnumber[id]=0

}

public event_round_start(){
     remove_task(234)
     return PLUGIN_CONTINUE
 }   
 
public aredbull(id)
{
    if(cs_get_user_money(id)<get_cvar_num("RBCost"))
    {
        return PLUGIN_HANDLED
    }
    cs_set_user_money(id,cs_get_user_money(id) - get_cvar_num("RBCost"),1)
    rbnumber[id]=0
    set_task(0.0,"special",id)
    return PLUGIN_HANDLED
}



public special(id)
{

        
    if(floatcmp(float(rbnumber[id]),get_cvar_float("RBLasts"))==0.0 ||  floatcmp(float(rbnumber[id]),get_cvar_float("RBLasts"))==1)
    {
        
        rbnumber[id]=0
        set_user_gravity(id,1.0)
        set_user_maxspeed(id,320.0)
        return PLUGIN_HANDLED
    }
    set_user_gravity(id,0.6)
    set_user_maxspeed(id,0.0)
    rbnumber[id] = rbnumber[id] + 1
    set_task(1.0,"special",id,"234")
    set_user_health(id,1) 

  message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
   write_short(1<<10)
   write_short(1<<10)
   write_short(0x0000)
   write_byte(0)
   write_byte(0)
   write_byte(200)
   write_byte(75)
   message_end()



    return PLUGIN_HANDLED


      }





public costs(id,level,cid)
{
    if(!cmd_access(id,level,cid,2))
    {
        return PLUGIN_HANDLED
    }
    new arg1[32]
    read_argv(1,arg1,31)
    set_cvar_num("RBCosts",str_to_num(arg1))
    return PLUGIN_HANDLED

}
public event_round_start dont work
so in next round player has 1hp and others function

Last edited by Samsoniq; 03-30-2011 at 12:31.
Samsoniq is offline
Nyuszy
Senior Member
Join Date: Apr 2009
Old 03-30-2011 , 12:31   Re: public event_round_start
Reply With Quote #2

this is because the 4. param of set_task isn't the id, so you can't remove the task with id 234 because it doesn't exist, you must loop over the players and remove tasks by their ids
Nyuszy is offline
Samsoniq
Junior Member
Join Date: May 2010
Old 03-30-2011 , 12:47   Re: public event_round_start
Reply With Quote #3

Quote:
Originally Posted by Nyuszy View Post
this is because the 4. param of set_task isn't the id, so you can't remove the task with id 234 because it doesn't exist, you must loop over the players and remove tasks by their ids


so you can show me this?
Samsoniq is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 03-30-2011 , 14:03   Re: public event_round_start
Reply With Quote #4

When u set task: set_task(time, function, id+245) in fuction(idd) new id=idd-245. In event new round make a loop for and remove task for each players.
lis_16 is offline
Samsoniq
Junior Member
Join Date: May 2010
Old 03-30-2011 , 14:29   Re: public event_round_start
Reply With Quote #5

I do not understand fully
can you show this in script
Samsoniq is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 03-30-2011 , 16:10   Re: public event_round_start
Reply With Quote #6

PHP Code:
public function(idd){
new 
id=idd-254
client_print
(idprint_chat"sdasdsadawed")
}

public 
something(id){
set_task(1.0"function"id+254)
}

public 
new_round(){
for(new 
id=0id<=32id++){
if(
task_exsists(id+254remove_task(id+254))
}

I hope there are no mistakes.
lis_16 is offline
Samsoniq
Junior Member
Join Date: May 2010
Old 03-30-2011 , 16:41   Re: public event_round_start
Reply With Quote #7

I see sam mistakes )
but can't compile it
Samsoniq is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 03-30-2011 , 16:52   Re: public event_round_start
Reply With Quote #8

This is just an example. "function" is registered so it can be name of function.
lis_16 is offline
Samsoniq
Junior Member
Join Date: May 2010
Old 03-30-2011 , 18:05   Re: public event_round_start
Reply With Quote #9

Quote:
Originally Posted by lis_16 View Post
This is just an example. "function" is registered so it can be name of function.
I know , but can't do this in my script
Samsoniq is offline
Old 03-31-2011, 12:28
Samsoniq
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
Old 04-08-2011, 20:42
Samsoniq
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-08-2011 , 21:12   Re: public event_round_start
Reply With Quote #10

You have been warned too many times about bumping before 2 weeks have passed.

This thread is now locked for 2 weeks and all similar threads will be locked.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply


Thread Tools
Display Modes

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 14:30.


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