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

help with set_task ... give_item


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 10-05-2008 , 12:00   help with set_task ... give_item
Reply With Quote #1

Hi,
i need to help me making a task

I need to make a task with 15 second, and at every 15 seconds to give a item to someone. Any sugestions?
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-05-2008 , 12:46   Re: help with set_task ... give_item
Reply With Quote #2

You could try this:

PHP Code:
#include <amxmodx>
#include <fakemeta_util>

new const g_szTaskClass[] = "func_task"

public plugin_init()
{
    
register_forward(FM_Think"Task_Handler")
}

public 
client_putinserver(id)
{
    
CreatePlayerTask(id15.0)
}

CreatePlayerTask(idFloat:flTime)
{
    new 
iEnt engfunc(EngFunc_CreateNamedEntityg_szTaskClass)

    if(
iEnt)
    {
        
set_pev(iEntpev_ownerid)
        
set_pev(iEntpev_fuser1flTime)
        
set_pev(iEntpev_nextthinkget_gametime() + flTime)
    }
}

public 
Task_Handler(iEnt)
{
    if( !
pev_valid(iEnt) )
        return

    static 
szClassname[11]
    
pev(iEntpev_classnameszClassname10)
    if( !
equal(szClassnameg_szTaskClass) )
        return

    static 
id
    id 
pev(iEntpev_owner)
    if( !
is_user_connected(id) )
    {
        
set_pev(iEntpev_flagsFL_KILLME)
        
dllfunc(DLLFunc_ThinkiEnt)
    }

    if( 
is_user_alive(id) )
    {
        
fm_give_item(id"weapon_hegrenade")
    }

    static 
Float:flTime
    pev
(iEntpev_fuser1flTime)
    
set_pev(iEntpev_nextthinkget_gametime() + flTime)

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-05-2008 , 12:52   Re: help with set_task ... give_item
Reply With Quote #3

Quote:
Originally Posted by tuty View Post
Hi,
i need to help me making a task

I need to make a task with 15 second, and at every 15 seconds to give a item to someone. Any sugestions?
set_task(15.0, "handle", taskid, param, paramsize, "b");
if you have the "b" flag enabled, remove it.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 10-05-2008 , 13:07   Re: help with set_task ... give_item
Reply With Quote #4

k 10x
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
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:19.


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