Senior Member
|
![Old](images/statusicon/post_old.svg)
07-13-2014
, 22:37
[HE % Smoke Problem]
|
#1
|
Hi all. I have downloaded He Granade & Smoke Granade for furien mod and I can compil it but this don't work in Shop Menu.
He Granade:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <engine>
#include <amxmisc>
#include <fun>
#include "furien.inc"
#include "furien_shop.inc"
#define VERSION "0.2.1"
new g_iCost[2]
public plugin_init()
{
register_plugin("Furien OldSchool He Granade", VERSION, "frOOgy")
new szConfigFile[128]
get_localinfo("amxx_configsdir", szConfigFile, charsmax(szConfigFile))
format(szConfigFile, charsmax(szConfigFile), "%s/furien/items/hegranade.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_autobhop")
RegisterHam(Ham_Player_Jump, "player", "CBasePlayer_Jump", false)
RegisterHam(Ham_Killed, "player", "CBasePlayer_Killed", true)
}
}
public furien_buy_autobhop( id )
{
new iTeam = furien_get_user_team(id)
if( iTeam == -1 )
{
return ShopCloseMenu
}
new iItemCost = g_iCost[iTeam]
if( iItemCost <= 0 )
{
return ShopTeamNotAvail
}
if( furien_try_buy(id, iItemCost) )
{
give_item(id,"weapon_hegranade")
}
else
{
return ShopNotEnoughMoney
}
return ShopAlreadyHaveOne
}
Smoke Granade
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <engine>
#include <amxmisc>
#include <fun>
#include "furien.inc"
#include "furien_shop.inc"
#define VERSION "1.0"
new g_iCost[2]
public plugin_init()
{
register_plugin("Furien OldSchool Smoke Granade", VERSION, "frOOgy")
new szConfigFile[128]
get_localinfo("amxx_configsdir", szConfigFile, charsmax(szConfigFile))
format(szConfigFile, charsmax(szConfigFile), "%s/furien/items/smoke.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_autobhop")
RegisterHam(Ham_Player_Jump, "player", "CBasePlayer_Jump", false)
RegisterHam(Ham_Killed, "player", "CBasePlayer_Killed", true)
}
}
public furien_buy_autobhop( id )
{
new iTeam = furien_get_user_team(id)
if( iTeam == -1 )
{
return ShopCloseMenu
}
new iItemCost = g_iCost[iTeam]
if( iItemCost <= 0 )
{
return ShopTeamNotAvail
}
if( furien_try_buy(id, iItemCost) )
{
give_item(id,"weapon_smokegranade")
}
else
{
return ShopNotEnoughMoney
}
return ShopAlreadyHaveOne
}
__________________
|
|