When you make a request, it's better that you don't start the work unless you know what you are doing. And if you know what you are doing (this is obviously not your case), then you can post in scripting help forum.
Try this :
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include "furien.inc"
#include "furien_shop.inc"
#define VERSION "0.0.1"
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)
#define m_fPainShock 108
new g_iCost[2]
public plugin_init()
{
register_plugin("Furien NoSlowdown", VERSION, "ConnorMcLeod")
new szConfigFile[128]
get_localinfo("amxx_configsdir", szConfigFile, charsmax(szConfigFile))
format(szConfigFile, charsmax(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(fp, szDatas, charsmax(szDatas))
trim(szDatas)
if(!szDatas[0] || szDatas[0] == ';' || szDatas[0] == '#' || (szDatas[0] == '/' && szDatas[1] == '/'))
{
continue
}
parse(szDatas, szKey, charsmax(szKey), szValue, charsmax(szValue))
switch( szKey[0] )
{
case 'A':
{
switch( szKey[7] )
{
case 'M':
{
if( equal(szKey, "ANTI_NAME" ) )
{
copy(szAntiName, charsmax(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(szFurienName, charsmax(szAntiName), szValue)
}
}
case 'S':
{
if( equal(szKey, "FURIEN_COST" ) )
{
g_iCost[Furien] = str_to_num(szValue)
}
}
}
}
}
}
fclose( fp )
if( g_iCost[Furien] || g_iCost[AntiFurien] )
{
furien_register_item(szFurienName, g_iCost[Furien], szAntiName, g_iCost[AntiFurien], "furien_buy_noslowdown")
RegisterHam(Ham_TakeDamage, "player", "OnCBasePlayer_TakeDamage_Post", true)
RegisterHam(Ham_Player_Jump, "player", "OnCBasePlayer_Jump_Post", true)
RegisterHam(Ham_Killed, "player", "OnCBasePlayer_Killed_Post", true)
}
}
public client_putinserver(id)
{
RemoveUserNoSlowdown(id)
}
public OnCBasePlayer_Killed_Post(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_noslowdown( id )
{
new iTeam = furien_get_user_team(id)
if( iTeam == -1 )
{
return ShopCloseMenu
}
new iItemCost = g_iCost[iTeam]
if( iItemCost <= 0 )
{
return ShopTeamNotAvail
}
if( ~HasUserNoSlowdown(id) )
{
if( furien_try_buy(id, iItemCost) )
{
SetUserNoSlowdown( id )
return ShopBought
}
else
{
return ShopNotEnoughMoney
}
}
return ShopAlreadyHaveOne
}
public OnCBasePlayer_TakeDamage_Post(id)
{
if( HasUserNoSlowdown(id) && is_user_alive(id) )
{
set_pdata_float(id, m_fPainShock, 1.0, 5)
}
}
public OnCBasePlayer_Jump_Post(id)
{
if( HasUserNoSlowdown(id) && is_user_alive(id) )
{
set_pev(id, pev_fuser2, 0.0)
}
}
__________________