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

API Scripting Help [TUT][ZP Making extra item for ZP 5.0!!!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Snaker beatter
Veteran Member
Join Date: Sep 2011
Location: Manila, Philippines
Old 11-18-2011 , 01:45   [TUT][ZP Making extra item for ZP 5.0!!!
Reply With Quote #1

THIS IS A TUTORIAL FOR ZOMBIE PLAGUE 5.0:

1ST. Manage included files
PHP Code:
        #include <amxmodx>
        #include <zp50_core> // engine
        #include <zp50_items> // extra items
        #include <zp50_class_nemesis> // nemesis
        #include <zp50_class_survivor> // survivor 
2ND. Make an item's id and register it in plugin_precache()
PHP Code:
        new g_item_id

        
public plugin_prechache() 
        {
                
g_item_id zp_items_register("<name>", <cost>) // no more teams!
        

3RD. If you want the item for only one team(human/survivor/nemesis/zombie) the make make a forward (more here):
PHP Code:
        public zp_fw_items_select_pre(iditemidignorecost)
        {
                
//check our item id
                
if (itemid == g_item_id)
                {
                        
// if you want it for only nemesis use this:
                        
if (zp_core_is_zombie(id) && !zp_core_is_zombie(id) && zp_class_survivor_get(id))
                        {
                                
// Return values
                                
return ZP_ITEM_DONT_SHOW;
                        }
                }
                
// here the main extra item's return value (if you want it to exist or not)
                
return ZP_ITEM_AVAILABLE;
        } 
4Th. When i player was succesfully buyed a extra item
PHP Code:
        public zp_fw_items_select_post(iditemidignorecost)
        {
                
// check our extra item
                
if (itemid == g_item_id)
                {
                        
// do your command
                
}

                
// should always have a return value for sure
                
return ZP_ITEM_AVAILABLE;
        } 
Quote:
Any way in zp50's forwards if you are blocking use "return;" value
__________________

Last edited by Snaker beatter; 01-23-2012 at 21:31.
Snaker beatter 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 09:35.


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