Raised This Month: $ Target: $400
 0% 

Solved merge tasks (?)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 06-11-2021 , 10:47   merge tasks (?)
Reply With Quote #1

is there some simple way to merge multiple tasks into one?
i want to merge three tasks and have one callable function instead of three that i have
here is nothing complex, but i just wonder if it possible

PHP Code:
#include <amxmodx>
#include <fun>
#include <csx>

public plugin_init()
    
register_plugin("infinite_grenades""latest""kww")

public 
grenade_throw(idgidwid) {
    switch(
wid) {
        case 
CSW_HEGRENADE:
            
set_task(0.1"call_he"id)
        case 
CSW_FLASHBANG:
            
set_task(0.1"call_fb"id)
        case 
CSW_SMOKEGRENADE:
            
set_task(0.1"call_sg"id)
    }
    
    return 
PLUGIN_CONTINUE
}

public 
call_he(idgive_item(id"weapon_hegrenade")
public 
call_fb(idgive_item(id"weapon_flashbang")
public 
call_sg(idgive_item(id"weapon_smokegrenade"

Last edited by kww; 06-12-2021 at 03:09.
kww 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 02:31.


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