Raised This Month: $ Target: $400
 0% 

slowdown


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
JenProchazim
Member
Join Date: Jun 2012
Old 07-01-2012 , 04:06   slowdown
#1

Hello i need help with my plugin for furien, i'm newbie, so please someone help, here's my code. TT have in shop menu no slowdown ( bullets not slow you).

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#include "furien.inc"
#include "furien_shop.inc"

#define VERSION "0.0.1"

#define FLASHBANG_SEARCH_RADIUS 1500.0

new g_bHasNoSlowdown
#define SetUserNoSlowdown(%1)        g_bHasNoSlowdown |=   1<<(%1&31)
#define RemoveUserNoSlowdown(%1)        g_bHasNoSlowdown &= ~(1<<(%1&31))
#define HasUserNoSlowdown(%1)        g_bHasNoSlowdown &    1<<(%1&31)

const fPainShock 108
new g_pCvarPainShockFree
new g_iMaxPlayers
#define IsPlayer(%1)    ( 1 <= %1 <= g_iMaxPlayers )
g_pCvarPainShockFree register_cvar("amx_painshockfree""1"FCVAR_SERVER)

new 
g_iCost[2]

public 
plugin_init()
{
    
register_plugin("Furien NoSlowdown"VERSION"ConnorMcLeod")
    new 
szConfigFile[128]
    
get_localinfo("amxx_configsdir"szConfigFilecharsmax(szConfigFile))
    
format(szConfigFilecharsmax(szConfigFile), "%s/furien/items/noslowdown.ini"szConfigFile);

    new 
fp fopen(szConfigFile"rt")
    if( !
fp )
    {
        return
    }

    new 
szFurienName[32], szAntiName[32]

    new 
szDatas[64], szKey[16], szValue[32]
    while( !
feof(fp) )
    {
        
fgets(fpszDatascharsmax(szDatas))
        
trim(szDatas)
        if(!
szDatas[0] || szDatas[0] == ';' || szDatas[0] == '#' || (szDatas[0] == '/' && szDatas[1] == '/'))
        {
            continue
        }

        
parse(szDatasszKeycharsmax(szKey), szValuecharsmax(szValue))

        switch( 
szKey[0] )
        {
            case 
'A':
            {
                switch( 
szKey[7] )
                {
                    case 
'M':
                    {
                        if( 
equal(szKey"ANTI_NAME" ) )
                        {
                            
copy(szAntiNamecharsmax(szAntiName), szValue)
                        }
                    }
                    case 
'S':
                    {
                        if( 
equal(szKey"ANTI_COST" ) )
                        {
                            
g_iCost[AntiFurien] = str_to_num(szValue)
                        }
                    }
                }
            }
            case 
'F':
            {
                switch( 
szKey[9] )
                {
                    case 
'M':
                    {
                        if( 
equal(szKey"FURIEN_NAME" ) )
                        {
                            
copy(szFurienNamecharsmax(szAntiName), szValue)
                        }
                    }
                    case 
'S':
                    {
                        if( 
equal(szKey"FURIEN_COST" ) )
                        {
                            
g_iCost[Furien] = str_to_num(szValue)
                        }
                    }
                }
            }
        }
    }
    
fclosefp )

    if( 
g_iCost[Furien] || g_iCost[AntiFurien] )
    {
        
furien_register_item(szFurienNameg_iCost[Furien], szAntiNameg_iCost[AntiFurien], "furien_buy_noslowdown")
    
        
register_forward(FM_FindEntityInSphere"FindEntityInSphere")
        
RegisterHam(Ham_Killed"player""CBasePlayer_Killed"true)

        
g_iMaxPlayers get_maxplayers()
    }
}

public 
client_putinserver(id)
{
    
RemoveUserNoSlowdown(id)
}

public 
CBasePlayer_Killed(id)
{
    
RemoveUserNoSlowdown(id)
}

public 
furien_team_change/*iFurien */ )
{
    if( !
g_iCost[Furien] || !g_iCost[AntiFurien] )
    {
        
g_bHasNoSlowdown 0
    
}
}

public 
furien_round_restart()
{
    
g_bHasNoSlowdown 0
}

public 
furien_buy_noslowdownid )
{
    new 
iTeam furien_get_user_team(id)
    if( 
iTeam == -)
    {
        return 
ShopCloseMenu
    
}

    new 
iItemCost g_iCost[iTeam]
    if( 
iItemCost <= )
    {
        return 
ShopTeamNotAvail
    
}

    if( ~
HasUserNoSlowdown(id) )
    {
        if( 
furien_try_buy(idiItemCost) )
        {
            
SetUserNoSlowdownid )
            return 
ShopBought
        
}
        else
        {
            return 
ShopNotEnoughMoney
        
}
    }
    return 
ShopAlreadyHaveOne
}
public 
Player_TakeDamage(id)
{
    if( ~
HasUserNoSlowdown(id) && is_user_alive(id) || ( get_pcvar_num(g_pCvarPainShockFree) ) )
    {
        
set_pdata_float(idfPainShock1.05)
    }

JenProchazim is offline
 



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 15:22.


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