Raised This Month: $51 Target: $400
 12% 

API Scripting Help Help fixing buy nem and surv for 5.0.8


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gam3ronE
SourceMod Donor
Join Date: Aug 2010
Old 03-27-2012 , 18:45   Help fixing buy nem and surv for 5.0.8
Reply With Quote #1

Need it to work for 5.0.8

here is buy nem:

PHP Code:
/*================================================================================
    
    --------------------------------
    -*- [ZP] Extra Item: Nemesis -*-
    --------------------------------
    
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
    
    This is just an extra item for buy nemesis. This version is totally without logs,  because I haven't used commands,
    only forwards & natives. To use this plugin make sure you are running the latest version of ZP.

    ~~~~~~~~~~~~~~~
    - CVARs -
    ~~~~~~~~~~~~~~~

    zp_nemesis_buy 1 // 1|0 - Enable/disable the plugin
    zp_nemesis_cost 60 // Set the Nemesis cost - Default 60
    zp_nemesis_hudtime 2.0 // Time before the HUD message appears. Decimal is a must, don't forget that.
    
================================================================================*/

#include <amxmodx>
#include <zombieplague>

#define PLUGIN "[ZP] Extra Item: Nemesis"
#define VERSION "0.1.1"
#define AUTHOR "fezh"

new g_nemesis
new g_msgSayText
new g_maxplayers

new pcvar_enabledpcvar_costpcvar_hudtime

public plugin_init()
{
    
register_pluginPLUGINVERSIONAUTHOR )
    
    
pcvar_enabled register_cvar"zp_nemesis_buy""1" )
    
pcvar_cost register_cvar"zp_nemesis_cost""100" )
    
pcvar_hudtime register_cvar"zp_nemesis_hudtime""3.0" )
    
    
g_nemesis zp_register_extra_item"Nemesis"get_pcvar_numpcvar_cost ) , ZP_TEAM_HUMAN )

    
g_maxplayers get_maxplayers()
    
g_msgSayText get_user_msgid"SayText" )

    
register_cvar"zp_extra_nemesis"VERSIONFCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY )
}

public 
zp_extra_item_selectediditem )
{
    if( !
get_pcvar_numpcvar_enabled ) )
        return 
PLUGIN_HANDLED
    
    
if( item == g_nemesis )
    {
        if( 
zp_has_round_started() )
        {
            
colored_printid"^x04[ZP]^x01 You must try buy Nemesis before the round start!" )
            return 
ZP_PLUGIN_HANDLED
        
}

        
zp_make_user_nemesisid )

        
colored_printid"^x04[ZP]^x01 You have bought Nemesis!" )

        
set_taskget_pcvar_floatpcvar_hudtime ), "nemesis_message"id )
    }
    return 
PLUGIN_HANDLED
}

public 
nemesis_messageid )
{
    new 
szName32 ]
    
get_user_nameidszName31 )
    
set_hudmessage255000.050.4510.05.01.01.0, -)
    
show_hudmessage0"%s bought Nemesis!"szName )
}

stock colored_printtarget, const message[],  any:... )
{
    static 
buffer512 ]

    if( !
target )
    {
        static 
player
        
for( player 1player <= g_maxplayersplayer++ )
        {
            if ( !
is_user_connectedplayer ) )
                continue;
            
            
vformatbuffercharsmaxbuffer ), message)
            
            
message_beginMSG_ONE_UNRELIABLEg_msgSayText_player )
            
write_byteplayer )
            
write_stringbuffer )
            
message_end()
        }
    }

    else
    {
        
vformatbuffercharsmaxbuffer ), message)
        
        
message_beginMSG_ONEg_msgSayText_target )
        
write_bytetarget )
        
write_stringbuffer )
        
message_end()
    }

and here is buy surv:

PHP Code:
/*================================================================================
    
    --------------------------------
    -*- [ZP] Extra Item: Survivor -*-
    --------------------------------
    
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
    
    This is just an extra item for buy Survivor. This version is totally without logs,  because I haven't used commands,
    only forwards & natives. To use this plugin make sure you are running the latest version of ZP.

    ~~~~~~~~~~~~~~~
    - CVARs -
    ~~~~~~~~~~~~~~~

    zp_survivor_buy 1 // 1|0 - Enable/disable the plugin
    zp_survivor_cost 60 // Set the survivor cost - Default 60
    zp_survivor_hudtime 2.0 // Time before the HUD message appears. Decimal is a must, don't forget that.
    
================================================================================*/

#include <amxmodx>
#include <zombieplague>

#define PLUGIN "[ZP] Extra Item: Survivor"
#define VERSION "0.1.1"
#define AUTHOR "fezh"

new g_survivor
new g_msgSayText
new g_maxplayers

new pcvar_enabledpcvar_costpcvar_hudtime

public plugin_init()
{
    
register_pluginPLUGINVERSIONAUTHOR )
    
    
pcvar_enabled register_cvar"zp_survivor_buy""1" )
    
pcvar_cost register_cvar"zp_survivor_cost""100" )
    
pcvar_hudtime register_cvar"zp_survivor_hudtime""3.0" )
    
    
g_survivor zp_register_extra_item"Survivor"get_pcvar_numpcvar_cost ) , ZP_TEAM_HUMAN )

    
g_maxplayers get_maxplayers()
    
g_msgSayText get_user_msgid"SayText" )

    
register_cvar"zp_extra_survivor"VERSIONFCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY )
}

public 
zp_extra_item_selectediditem )
{
    if( !
get_pcvar_numpcvar_enabled ) )
        return 
PLUGIN_HANDLED
    
    
if( item == g_survivor )
    {
        if( 
zp_has_round_started() )
        {
            
colored_printid"^x04[ZP]^x01 You must try buy Survivor before the round start!" )
            return 
ZP_PLUGIN_HANDLED
        
}

        
zp_make_user_survivorid )

        
colored_printid"^x04[ZP]^x01 You have bought Survivor!" )

        
set_taskget_pcvar_floatpcvar_hudtime ), "survivor_message"id )
    }
    return 
PLUGIN_HANDLED
}

public 
survivor_messageid )
{
    new 
szName32 ]
    
get_user_nameidszName31 )
    
set_hudmessage255000.050.4510.05.01.01.0, -)
    
show_hudmessage0"%s bought Survivor!"szName )
}

stock colored_printtarget, const message[],  any:... )
{
    static 
buffer512 ]

    if( !
target )
    {
        static 
player
        
for( player 1player <= g_maxplayersplayer++ )
        {
            if ( !
is_user_connectedplayer ) )
                continue;
            
            
vformatbuffercharsmaxbuffer ), message)
            
            
message_beginMSG_ONE_UNRELIABLEg_msgSayText_player )
            
write_byteplayer )
            
write_stringbuffer )
            
message_end()
        }
    }

    else
    {
        
vformatbuffercharsmaxbuffer ), message)
        
        
message_beginMSG_ONEg_msgSayText_target )
        
write_bytetarget )
        
write_stringbuffer )
        
message_end()
    }

They are from the old super central website so all coding credits go to them, I just fixed up the spellings.
Gam3ronE is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 03-27-2012 , 19:00   Re: Help fixing buy nem and surv for 5.0.8
Reply With Quote #2

http://forums.alliedmods.net/showpos...98&postcount=2
__________________
H.RED.ZONE is offline
Gam3ronE
SourceMod Donor
Join Date: Aug 2010
Old 03-28-2012 , 02:23   Re: Help fixing buy nem and surv for 5.0.8
Reply With Quote #3

My plugin is better. Why doesn't it work?
Gam3ronE is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 03-28-2012 , 10:02   Re: Help fixing buy nem and surv for 5.0.8
Reply With Quote #4

Because zp 5.0 uses different natives
__________________
H.RED.ZONE is offline
Gam3ronE
SourceMod Donor
Join Date: Aug 2010
Old 03-29-2012 , 13:28   Re: Help fixing buy nem and surv for 5.0.8
Reply With Quote #5

Yeah found it someone else already converted the exact one I wanted thanks anyway
Gam3ronE is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:06.


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