NOTE: You need to have
RZ VIP Plugin installed on your server.
I will be showing how to do this inside my
Gas Mask plugin extra item,
every other extra item that is for zombie plague 5.0 can be set to be VIP
extra item.
1. Adding the include file
First we open "zp50_gas_mask.sma" inside we can find INCLUDE files.
We need to add RZ VIP plugin include so we find this:
Code:
#include < amxmodx >
#include < hamsandwich >
#include < engine >
#include <zp50_core>
#include <zp50_items>
#include <zp50_ammopacks>
And now we add our RZ VIP include
Code:
#include < amxmodx >
#include < hamsandwich >
#include < engine >
#include <zp50_core>
#include <zp50_items>
#include <zp50_ammopacks>
#include <rz_vip_core>
2. Forward For Extra Items
Every extra item has forward that checks who can buy item you can find it easy it looks like this:
Code:
public zp_fw_items_select_pre
NOTE: There is "pre" and there is "post" DON'T MAKE MISTAKE! We are looking for "pre".
Now inside we will find check if this is the item that we are using it checks if ID of item is really "Gas Mask item" To help you look at it here is the code:
Code:
if (itemid == g_itemid_buyremoverh) {
"g_itemid_buyremoverh" This is diffrent for every item because Item ID is diffrent.
Inside of this check we will add our line that is needed:
Code:
public zp_fw_items_select_pre(id, itemid) {
if (itemid == g_itemid_buyremoverh) {
if (zp_core_is_zombie(id))
return ZP_ITEM_DONT_SHOW;
// This is what we add.
if(!rz_is_user_vip(id))
return ZP_ITEM_NOT_AVAILABLE;
static text[32]
formatex ( text , charsmax ( text ) , "[%d/%d]" , g_Limit , get_pcvar_num ( _pcvar_limit ) )
zp_items_menu_text_add ( text )
if ( g_Limit >= get_pcvar_num ( _pcvar_limit ) )
return ZP_ITEM_NOT_AVAILABLE;
return ZP_ITEM_AVAILABLE;
}
return ZP_ITEM_AVAILABLE;
}
This will be hard because every code is diffrent so you need to be able to read this forward to know what to do. I will tell you that there is a problem with ITEM AVAILABLE and NOT AVAILABLE so in the line i added i checked if user is not (!) VIP that item is NOT AVAILABLE
3. You Need To Know
You need to know what to set in case that ID check ends with return ZP_ITEM_AVAILABLE
Like this here:
Code:
public zp_fw_items_select_pre(id, itemid) {
if (itemid == g_itemid_buyremoverh) {
if (zp_core_is_zombie(id))
return ZP_ITEM_DONT_SHOW;
// This is what we add.
if(!rz_is_user_vip(id))
return ZP_ITEM_NOT_AVAILABLE;
static text[32]
formatex ( text , charsmax ( text ) , "[%d/%d]" , g_Limit , get_pcvar_num ( _pcvar_limit ) )
zp_items_menu_text_add ( text )
if ( g_Limit >= get_pcvar_num ( _pcvar_limit ) )
return ZP_ITEM_NOT_AVAILABLE;
return ZP_ITEM_AVAILABLE;
}
return ZP_ITEM_AVAILABLE;
}
we add it like this:
Code:
// This is what we add.
if(!rz_is_user_vip(id))
return ZP_ITEM_NOT_AVAILABLE;
in case that it ends like this:
Code:
public zp_fw_items_select_pre(id, itemid) {
if (itemid == g_itemid_buyremoverh) {
if (!zp_core_is_zombie(id))
return ZP_ITEM_DONT_SHOW;
// This is what we add.
if(rz_is_user_vip(id))
return ZP_ITEM_AVAILABLE;
static text[32]
formatex ( text , charsmax ( text ) , "[%d/%d]" , g_Limit , get_pcvar_num ( _pcvar_limit ) )
zp_items_menu_text_add ( text )
if ( g_Limit >= get_pcvar_num ( _pcvar_limit ) )
return ZP_ITEM_NOT_AVAILABLE;
return ZP_ITEM_NOT_AVAILABLE;
}
return ZP_ITEM_AVAILABLE;
}
We add it like this:
Code:
// This is what we add.
if(rz_is_user_vip(id))
return ZP_ITEM_AVAILABLE;
4. Add VIP [TAG]
To add a tag [VIP] you just need to add this line here:
Code:
static text2[32]
formatex ( text2 , charsmax ( text2 ) , "[VIP]" )
zp_items_menu_text_add ( text2 )
So in the end the forward looks like this:
Code:
public zp_fw_items_select_pre(id, itemid) {
if (itemid == g_itemid_buyremoverh) {
if (zp_core_is_zombie(id))
return ZP_ITEM_DONT_SHOW;
// This is what we add.
if(!rz_is_user_vip(id))
return ZP_ITEM_NOT_AVAILABLE;
static text[32]
formatex ( text , charsmax ( text ) , "[%d/%d]" , g_Limit , get_pcvar_num ( _pcvar_limit ) )
zp_items_menu_text_add ( text )
static text2[32]
formatex ( text2 , charsmax ( text2 ) , "[VIP]" )
zp_items_menu_text_add ( text2 )
if ( g_Limit >= get_pcvar_num ( _pcvar_limit ) )
return ZP_ITEM_NOT_AVAILABLE;
return ZP_ITEM_AVAILABLE;
}
return ZP_ITEM_AVAILABLE;
}
That is the end compile locally. Sma is inside this thread.