AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   Subplugin Submission [New Natives] Zombie Plague 4.3 Fix 5a (https://forums.alliedmods.net/showthread.php?t=162970)

Excalibur.007 07-25-2011 05:42

[New Natives] Zombie Plague 4.3 Fix 5a
 
1 Attachment(s)
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(idprint_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(idtrue5.0)
}

public 
return_hasinfectnade(id)
{
    if(!
is_user_alive(id) || !zp_get_user_zombie(id))
        return
        
    
client_print(idprint_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(idprint_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(idtrue)
}

public 
return_isunlimitedclip(id)
{
    if(!
is_user_alive(id))
        return
        
    
client_print(idprint_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(idtrue)
}

public 
return_ispainshockfree(id)
{
    if(!
is_user_alive(id))
        return
        
    
client_print(idprint_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(idtrue)
}

public 
set_randomgamemode()
{
    new 
iRandom random_num(02)
    
    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.

abdul-rehman 07-25-2011 06:34

Re: [New Natives] Zombie Plague 4.3 Fix 5a
 
You should PM MeRcyLeZZ to add these natives to his upcoming patch, since his codes are much optimized etc. btw nice work in keeping them updated.

Excalibur.007 07-25-2011 07:24

Re: [New Natives] Zombie Plague 4.3 Fix 5a
 
Will do. Suggestions are welcomed as long they do much help on creating plugins.

bibu 07-25-2011 16:12

Re: [New Natives] Zombie Plague 4.3 Fix 5a
 
Quote:

Originally Posted by abdul-rehman (Post 1517986)
You should PM MeRcyLeZZ to add these natives to his upcoming patch.

Agreed. He will for sure add some/all natives, since they're really useful. Keep up the good work.

Excalibur.007 07-25-2011 19:18

Re: [New Natives] Zombie Plague 4.3 Fix 5a
 
Please note that there may be a update to this if I found bugs on the natives, after my school hours =_=...

hellmoss 11-11-2011 06:41

Re: [New Natives] Zombie Plague 4.3 Fix 5a
 
..

WaLkMaN 10-19-2013 08:04

Re: [New Natives] Zombie Plague 4.3 Fix 5a
 
Can you create two new natives ? For check multi round and normal infection ? (ex. zp_is_multi_round(), zp_is_normal_round())


All times are GMT -4. The time now is 14:49.

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