AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   HELP item extra set_task (https://forums.alliedmods.net/showthread.php?t=274553)

felipemilralze 11-09-2015 21:40

HELP item extra set_task
 
Not available item by task? Applying task on the menu? and not in the item?

PHP Code:


public Task(id)
{
        
set_task(30.0"Buy_item"id)
}

public 
Buy_item(id)
{
        
give_item(id"weapon_awp")
}

public 
zp_fw_items_select_pre(iditemidignorecost)
{
    
// This is not our item
    
if (itemid != g_ItemID)
        return 
ZP_ITEM_AVAILABLE;

        if(!
zp_core_is_zombie(id))
                return 
ZP_ITEM_DONT_SHOW;

}

public 
zp_fw_items_select_post(iditemidignorecost)
{
    
// This is not our item
    
if (itemid != g_ItemID)
        return

        
Task(id)



CrazY. 11-12-2015 06:38

Re: HELP item extra set_task
 
Code:
public zp_fw_items_select_pre(id, itemid) {     if(itemid != g_itemid) return ZP_ITEM_AVAILABLE;         if(zp_core_is_zombie(id)) return ZP_ITEM_DONT_SHOW;         if(g_has_name[id])     {         zp_items_menu_text_add("\r[Buyed]")         return ZP_ITEM_NOT_AVAILABLE;     }     return ZP_ITEM_AVAILABLE; } public zp_fw_items_select_post(player, itemid) {     if(itemid != g_itemid)         return;         g_has_name[player] = true;     give_item(player, "weapon_awp"); }

felipemilralze 11-12-2015 08:49

Re: HELP item extra set_task
 
I wanted to for a while so that the purchasing menu is available

felipemilralze 11-12-2015 09:01

Re: HELP item extra set_task
 
will it work?
PHP Code:

/* Script generated by Pawn Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <zp50_items>
#include <zp50_core>

#define PLUGIN    "New Plugin"
#define AUTHOR    "Unknown"
#define VERSION    "1.0"

new g_gas_name[33];
new 
g_itemid_awp;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
// Add your own code here
    
register_event("HLTV""event_round_start""a""1=0""2=0");
    
g_itemid_awp zp_items_register("AWP"10);
}

public 
event_round_start()
    
g_has_name[0] = false;

public 
zp_fw_items_select_pre(iditemid)
{
    if(
itemid != g_itemid_awp) return ZP_ITEM_AVAILABLE;
    
    if(
zp_core_is_zombie(id)) return ZP_ITEM_DONT_SHOW;
    
    if(
g_has_name[id])
    {
        
zp_items_menu_text_add("\r[Buyed]");
        return 
ZP_ITEM_NOT_AVAILABLE;
    }

    return 
ZP_ITEM_AVAILABLE;
}

public 
zp_fw_items_select_post(playeritemid)
{
    if(
itemid == g_itemid_awp)
    {
        
g_has_name[player] = false;
        
set_task(30.0"activated"player);
        
give_item(player"weapon_awp");
    } 
    return 
PLUGIN_HANDLED;
}

public 
activated(id)
{
    
g_has_name[id] = true;



CrazY. 11-12-2015 09:14

Re: HELP item extra set_task
 
I dont know, try test.

felipemilralze 11-12-2015 09:27

Re: HELP item extra set_task
 
not work

CrazY. 11-12-2015 09:41

Re: HELP item extra set_task
 
Code:
public zp_fw_items_select_pre(id, itemid) {     if(itemid != g_itemid) return ZP_ITEM_AVAILABLE;         if(zp_core_is_zombie(id)) return ZP_ITEM_DONT_SHOW;         if(g_has_name[id])     {         zp_items_menu_text_add("\r[Buyed]")         return ZP_ITEM_NOT_AVAILABLE;     }     return ZP_ITEM_AVAILABLE; } public zp_fw_items_select_post(player, itemid) {     if(itemid != g_itemid)         return;         set_task(30.0, "activated", player); } public activated(player) {     g_has_name[player] = true;     give_item(player, "weapon_awp"); }

felipemilralze 11-12-2015 10:04

Re: HELP item extra set_task
 
1 - This way you can buy the item and get in 30 seconds;
2 - I want to put 30 seconds on the menu and not the item you will receive;

example: given 30 seconds = item available.

CrazY. 11-12-2015 12:09

Re: HELP item extra set_task
 
Code:
public plugin_init() {     set_task(30.0, "show_item"); } public show_item() {     g_itemid_awp = zp_items_register("AWP", 10); } public zp_fw_items_select_pre(id, itemid) {     if(itemid != g_itemid) return ZP_ITEM_AVAILABLE;         if(zp_core_is_zombie(id)) return ZP_ITEM_DONT_SHOW;         if(g_has_name[id])     {         zp_items_menu_text_add("\r[Buyed]")         return ZP_ITEM_NOT_AVAILABLE;     }     return ZP_ITEM_AVAILABLE; } public zp_fw_items_select_post(player, itemid) {     if(itemid != g_itemid)         return;         g_has_name[player] = true;     give_item(player, "weapon_awp"); }

felipemilralze 11-12-2015 17:38

Re: HELP item extra set_task
 
no work


All times are GMT -4. The time now is 03:30.

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