Guide how to remake zombie class for vips or admins only.
First what we need is depend witch mode are you using.
If MODE 1 is enabled (also MODE 3 enables MODE 1 too) plugin has itself authentication, so lets start:
Zombie Plague 5.x tutorial below.
Zombie Plague 4.3:
1. Find a function "
zp_register_zombie_class" in file. It should look something like this:
PHP Code:
public plugin_precache()
{
g_zclass_crow = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}
Take a variable
g_zclass_crow (sure it's name will be different).
2. Add this function to your zombie class plugin:
PHP Code:
#include <zmvip>
public zp_user_infected_pre(id) {
if(zv_get_user_flags(id) == 0) {
if(zp_get_user_next_class(id) == g_zclass_crow) {
zp_set_user_zombie_class(id, 0)
client_print(id, print_center, "Your selected class in only for *VIP* members")
client_print(id, print_chat, "Your selected class in only for *VIP* members. Changed to default zombie class.")
}
}
}
3. g_zclass_crow have to be the same variable witch you found in #1 step.
(if(zp_get_user_zombie_class(id) ==
g_zclass_crow))
If you want to let the player have a class with a specific flag do like this:
Code:
if(zv_get_user_flags(id) & ZV_MAIN)
if(zv_get_user_flags(id) & ZV_MULTI)
...
Code:
#define ZV_MAIN "a"
#define ZV_MULTI "b"
#define ZV_UNLIMITED "c"
#define ZV_DAMAGE "d"
Now if you are using default amx authentication (MODE 0 or 2) do like this:
1. Find a function "
zp_register_zombie_class" in file. It should look something like this:
PHP Code:
public plugin_precache()
{
g_zclass_crow = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}
Take a variable
g_zclass_crow (sure it's name will be different).
2. Add this code:
PHP Code:
public zp_user_infected_pre(id) {
if(!(get_user_flags(id) & ADMIN_LEVEL_H)) {
if (zp_get_user_next_class(id) == g_zclass_crow) {
zp_set_user_zombie_class(id, 0)
client_print(id, print_center, "Your selected class in only for *VIP* members")
client_print(id, print_chat, "Your selected class in only for *VIP* members. Changed to default zombie class.")
}
}
}
3. g_zclass_crow have to be the same variable witch you found in #1 step.
(if(zp_get_user_zombie_class(id) ==
g_zclass_crow))
ADMIN_LEVEL_H is default
t flag in users.ini file. It mostly using for vip plugins. Sure you can set this flag to what you want. If you want to make it for admins only, write
ADMIN_IMMUNITY instead of
ADMIN_LEVEL_H
Zombie Plague 5.x:
1. Find a function "
zp_class_zombie_register" in file. It should look something like this:
PHP Code:
public plugin_precache()
{
g_ZombieClassID = zp_class_zombie_register(zombieclass4_name, zombieclass4_info, zombieclass4_health, zombieclass4_speed, zombieclass4_gravity)
}
Take a variable
g_ZombieClassID (sure it's name will be different).
2. Add this function to your zombie class plugin:
PHP Code:
#include <zmvip>
public zp_fw_class_zombie_select_pre(id, classid) {
if (classid == g_ZombieClassID) {
if (zv_get_user_flags(id) == 0) {
zp_class_zombie_menu_text_add("*VIP* only!")
return ZP_CLASS_NOT_AVAILABLE;
}
else {
zp_class_zombie_menu_text_add("*VIP*")
return ZP_CLASS_AVAILABLE;
}
}
return ZP_CLASS_AVAILABLE;
}
3.
g_ZombieClassID have to be the
same variable witch you found in #1 step.
(if (classid ==
g_ZombieClassID))
If you want to let the player have a class with a specific flag do like this:
Code:
if(zv_get_user_flags(id) & ZV_MAIN)
if(zv_get_user_flags(id) & ZV_MULTI)
...
Code:
#define ZV_MAIN "a"
#define ZV_MULTI "b"
#define ZV_UNLIMITED "c"
#define ZV_DAMAGE "d"
Now if you are using default amx authentication (MODE 0 or 2) do like this:
1. Find a function "
zp_class_zombie_register" in file. It should look something like this:
PHP Code:
public plugin_precache()
{
g_ZombieClassID = zp_class_zombie_register(zombieclass4_name, zombieclass4_info, zombieclass4_health, zombieclass4_speed, zombieclass4_gravity)
}
Take a variable
g_ZombieClassID (sure it's name will be different).
2. Add this function to your zombie class plugin:
PHP Code:
public zp_fw_class_zombie_select_pre(id, classid) {
if (classid == g_ZombieClassID) {
if (!(get_user_flags(id) & ADMIN_LEVEL_H)) {
zp_class_zombie_menu_text_add("*VIP* only!")
return ZP_CLASS_NOT_AVAILABLE;
}
else {
zp_class_zombie_menu_text_add("*VIP*")
return ZP_CLASS_AVAILABLE;
}
}
return ZP_CLASS_AVAILABLE;
}
3.
g_ZombieClassID have to be the
same variable witch you found in #1 step.
(if (classid ==
g_ZombieClassID))
ADMIN_LEVEL_H is default
t flag in users.ini file. It mostly using for vip plugins. Sure you can set this flag to what you want. If you want to make it for admins only, write
ADMIN_IMMUNITY instead of
ADMIN_LEVEL_H
Then compile plugin and add it to server.
__________________