Hi, I am going to show you how to make a admin only class in ZP 5.0
First we make a simple class:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <zp50_class_zombie>
public plugin_precache()
{
register_plugin("Admin only class","1.0","Sp@jk")
zp_class_zombie_register("Admin Zombie","Only admins can use!",5000,300.0,0.5)
}
Then we add a class id
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <zp50_class_zombie>
new class_id
public plugin_precache()
{
register_plugin("Admin only class","1.0","Sp@jk")
class_id = zp_class_zombie_register("Admin Zombie","Only admins can use!",5000,300.0,0.5)
}
Now we add zp_fw_class_zombie_select_pre forward and check if user is admin
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <zp50_class_zombie>
new class_id
public plugin_precache()
{
register_plugin("Admin only class","1.0","Sp@jk")
class_id = zp_class_zombie_register("Admin Zombie","Only admins can use!",5000,300.0,0.5)
}
public zp_fw_class_zombie_select_pre(id,cid)
{
if(cid==class_id)
{
if(!is_user_admin(id))
return ZP_CLASS_NOT_AVAILABLE
}
return ZP_CLASS_AVAILABLE
}
And now we have a class than only admin can use