Description:
This adds additional natives to help scripters to create more plugins.
This is not a plugin but a modified version of Zombie Plague 4.3 Fix 5a
Currently natives:
- zp_get_user_frozen(id)
- zp_set_user_frozen(id, bool:IsFrozen, Float:duration)
- zp_user_has_infect_nade(id)
- zp_get_user_burning(id)
- zp_set_user_burning(id, bool:IsBurning)
- zp_get_user_unlimited_clip(id)
- zp_set_user_unlimited_clip(id, bool:IsUnlimitedClip)
- zp_get_user_painshockfree(id)
- zp_set_user_painshockfree(id, bool:IsPainShockFree)
- zp_set_gamemode(gamemode)
Note: From the previous versions, you see some removal of natives in this newer version as they don't do much help.
Note 2: You also see changes at zp_set_user_frozen. It now supports duration of freeze.
Note 3: Natives are now changed to boolean(true/false) to add more readability to plugins.
To test the new natives:
PHP Code:
#include <amxmodx>
#include <zombieplague>
#include <zombieplague_newnatives>
public plugin_init()
{
register_plugin("[ZP] New Natives Test", "1.0", "eXcalibur.007")
register_clcmd("say /isfrozen", "return_isfrozen")
register_clcmd("say /setfrozen", "set_frozen")
register_clcmd("say /hasinfectnade", "return_hasinfectnade")
register_clcmd("say /isburning", "return_isburning")
register_clcmd("say /setburning", "set_burning")
register_clcmd("say /isunlimitedclip", "return_isunlimitedclip")
register_clcmd("say /setunlimitedcip", "set_unlimitedclip")
register_clcmd("say /ispainshockfree", "return_ispainshockfree")
register_clcmd("say /setpainshockfree", "set_painshockfree")
register_clcmd("say /setrandomgamemode", "set_randomgamemode")
}
public return_isfrozen(id)
{
if(!is_user_alive(id))
return
client_print(id, print_chat, "You are %s", zp_get_user_frozen(id) ? "frozen" : "not frozen")
}
public set_frozen(id)
{
if(!is_user_alive(id))
return
zp_set_user_frozen(id, true, 5.0)
}
public return_hasinfectnade(id)
{
if(!is_user_alive(id) || !zp_get_user_zombie(id))
return
client_print(id, print_chat, "You %s a infection nade", zp_user_has_infect_nade(id) ? "have" : "do not have")
}
public return_isburning(id)
{
if(!is_user_alive(id))
return
client_print(id, print_chat, "You are %s", zp_get_user_burning(id) ? "burning" : "not burning")
}
public set_burning(id)
{
if(!is_user_alive(id))
return
zp_set_user_burning(id, true)
}
public return_isunlimitedclip(id)
{
if(!is_user_alive(id))
return
client_print(id, print_chat, "You %s unlimited clip", zp_get_user_unlimited_clip(id) ? "have" : "do not have")
}
public set_unlimitedclip(id)
{
if(!is_user_alive(id))
return
zp_set_user_unlimited_clip(id, true)
}
public return_ispainshockfree(id)
{
if(!is_user_alive(id))
return
client_print(id, print_chat, "You %s pain shock free", zp_get_user_painshockfree(id) ? "have" : "do not have")
}
public set_painshockfree(id)
{
if(!is_user_alive(id))
return
zp_set_user_painshockfree(id, true)
}
public set_randomgamemode()
{
new iRandom = random_num(0, 2)
switch(iRandom)
{
case 0:
{
zp_set_gamemode(MODE_SWARM)
}
case 1:
{
zp_set_gamemode(MODE_MULTI)
}
case 2:
{
zp_set_gamemode(MODE_PLAGUE)
}
}
}
Type the command and see whether if works. If it's broken, please post on this thread.