Raised This Month: $ Target: $400
 0% 

Help with Hns Shop


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MyEyesGreen
Senior Member
Join Date: Apr 2010
Old 06-17-2010 , 10:34   Help with Hns Shop
Reply With Quote #1

i try to make shop
and i have to much problem and i don't know what the problem

Some one can fix all my plugin ?

Here the plugin:
PHP Code:
/*
*    <----------------->
*     Coded in 2010. 
*     By Lw.
*    <----------------->
*     
*    .:: Description ::.
*     
*     Hide'N'Seek Shop.
*     
*    .:: Contacts ::.
*
*    Email: [email protected]
*
*    Steam: ilovemycat12
*/

#include <amxmodx>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <chatcolor>

#define PLUGIN    "Hns-Shop"
#define AUTHOR    "Lw."
#define VERSION    "1.0"

#define get_user_money(%1)    get_pdata_int( %1, 115 )

#define cs_get_user_money(%1)    get_pdata_int( %1, 115 )

#define MAX_CLIENTS 32



native hnsxp_get_user_xp(client);

native hnsxp_set_user_xp(clientxp);

stock hnsxp_add_user_xp(clientxp)
{
    return 
hnsxp_set_user_xp(clienthnsxp_get_user_xp(client) + xp);
}

native add_user_immuneid )
native remove_user_immuneid )

// other pcvars
new plugin_on

// cfg
new cfg[] = "\addons\amxmodx\configs\Hns-Shop.cfg"

// Amount of health and xp and such...
new hpcvar;
new 
xpcvar;

// cost pcvars
new HEgrenadecostFlashbangcostSmokegrenadecostAwpcostDeaglecostHPcostArmorcostNofalldamagecostAntiflashcostAntifrostcostStealthcostCamocostRespawncostXpcost;
new 
allowHEgrenadeallowFlashbangallowSmokegrenadeallowAwpallowDeagleallowHPallowArmorallowNofalldamageallowAntiFlashallowAntifrostallowStealthallowCamoallowRespawnallowXp;
new 
userHEgrenade[33], userFlashbang[33], userSmokegrenade[33], userAwp[33], userDeagle[33], userHP[33], userArmor[33], userNofalldamage[33], userAntiflash[33], userAntifrost[33], userStealth[33], userCamo[33], userRespawn[33], userXp[33];

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_cvar("Hns-Shop_version"VERSIONFCVAR_SERVER);
    
set_cvar_string("Hns-Shop_version"VERSION);
    
    
// Player Spawn
    
plugin_on register_cvar"shop_on""1");

    
// Events
    
register_event("DeathMsg""eDeath""a");
    
register_event("ScreenFade""eventFlash""be""4=255""5=255""6=255""7>199");
    
register_event("TextMsg""fire_in_the_hole""b""2&#Game_radio""4&#Fire_in_the_hole");
    
register_event("TextMsg""fire_in_the_hole2""b""3&#Game_radio""5&#Fire_in_the_hole");
    
register_event("99""grenade_throw""b");
    
    
// Pcvars
    
plugin_on register_cvar("hns_shop""1");
    
HEgrenadecost register_cvar("HEgrenade_cost""1");
    
Flashbangcost register_cvar("Flashbang_cost""1");
    
Smokegrenadecost register_cvar("Smokegrenade_cost""1");
    
Awpcost register_cvar("Awp_cost""1");
    
Deaglecost register_cvar("Deagle_cost""1");
    
HPcost register_cvar("HP_cost""1");
    
Armorcost register_cvar("Armor_cost""1");
    
Nofalldamagecost register_cvar("Nofalldamage_cost""1");
    
Antiflashcost register_cvar("Antiflash_cost""1");
    
Antifrostcost register_cvar("Antifrost_cost""1");
    
Stealthcost register_cvar("Stealth_cost""1");
    
Camocost register_cvar("Camo_cost""1");
    
Respawncost register_cvar("Respawn_cost""1");
    
Xpcost register_cvar("Xp_cost""1");
    
allowHEgrenade register_cvar("allowHEgrenade""1");
    
allowFlashbang register_cvar("allowFlashbang""1");
    
allowSmokegrenade register_cvar("allowSmokegrenade""1");
    
allowAwp register_cvar("allowAwp""1");
    
allowDeagle register_cvar("allowDeagle""1");
    
allowHP register_cvar("allowHP""1");
    
allowArmor register_cvar("allowArmor""1");
    
allowNofalldamage register_cvar("allowNofalldamage""1");
    
allowAntiFlash register_cvar("allowAntiflash""1");
    
allowAntifrost register_cvar("allowAntifrost""1");
    
allowStealth register_cvar("allowStealth""1");
    
allowCamo register_cvar("allowCamo""1");
    
allowRespawn register_cvar("allowRespawn""1");
    
allowXp register_cvar("allowXp""1");
   
    
hpcvar register_cvar"hp_amount""150");
    
xpcvar register_cvar"xp_amount""150");
    
    
// Clcmds
    
register_clcmd"say /shop""hideNseek" );
    
register_clcmd"say shop""hideNseek" );
    
register_clcmd"say_team /shop""hideNseek" );
    
register_clcmd"say_team shop""hideNseek" );
    
register_clcmd"say /hnsshop""hideNseek" );
    
register_clcmd"say hnsshop""hideNseek" );
    
register_clcmd"say_team /hnsshop""hideNseek" );
    
register_clcmd"say_team hnsshop""hideNseek" );
    
    
// Forwards
    
register_forward(FM_EmitSound,"fw_emitsound"); 
    
register_forward(FM_CmdStart"fwd_FM_CmdStart_pre"0);
    

    
// Tasks
    
set_task2.0"bad_fix2",_,_,_"b" );
    
set_task100.0"advert",_,_,_"b" );
}

public 
plugin_cfg() 
{
    if (!
file_exists(cfg))
    {
        
write_file(cfg"// other cfg");
        
write_file(cfg"shop_on 1");
        
write_file(cfg"");
        
write_file(cfg"");
        
write_file(cfg"// Cost cvars");
        
write_file(cfg"HEgrenade_cost 1");
        
write_file(cfg"Flashbang_cost 1");
        
write_file(cfg"Smokegrenade_cost 1");
        
write_file(cfg"Awp_cost 1");
        
write_file(cfg"Deagle_cost");
        
write_file(cfg"HP_cost 1");
        
write_file(cfg"Armor_cost 1");
        
write_file(cfg"Nofalldamage 1");
        
write_file(cfg"Antiflash 1");
        
write_file(cfg"Antifrost 1");
        
write_file(cfg"Stealth_cost 1");
        
write_file(cfg"Camo_cost 1");
        
write_file(cfg"Respawn_cost 1");
        
write_file(cfg"Xp_cost 1");
        
write_file(cfg"");
        
write_file(cfg"")    ;
        
write_file(cfg"// amount cvars");
        
write_file(cfg"hp_amount 250");
        
write_file(cfg"xp_amount 150")
    
        
write_file(cfg"// Allow cvars");
        
write_file(cfg"allowHEgrenade 1");
        
write_file(cfg"allowFlashbang 1");
        
write_file(cfg"allowSmokegrenade 1");
        
write_file(cfg"allowAwp 1");
        
write_file(cfg"allowDeagle 1");
        
write_file(cfg"allowHP 1");
        
write_file(cfg"allowArmor 1");
        
write_file(cfg"allowNofalldamage 1");
        
write_file(cfg"allowAntiflash 1");
        
write_file(cfg"allowAntifrost 1");
        
write_file(cfg"allowStealth 1");
        
write_file(cfg"allowCamo 1");
        
write_file(cfg"allowRespawn 1");
        
write_file(cfg"allowXp 1");
        
        
write_file(cfg"echo Hns Shop CFG succesfully loaded");

        
console_print(0"%s file not found. creating new ..."cfg);
    }
    
    else
    {
        
server_cmd("exec %s"cfg);
    }
}

public 
client_connect(id
{
    
userHEgrenade[id]    = 0;
    
userFlashbang[id]   = 0;
    
userSmokegrenade[id]   = 0;
    
userAwp[id]   = 0;
    
userDeagle[id]   = 0;
    
userHP[id]   = 0;
    
userArmor[id]   = 0;
    
userNofalldamage[id]   = 0;
    
userAntiflash[id]   = 0;
    
userAntifrost[id]   = 0;
    
userStealth[id]   = 0;
    
userCamo[id]   = 0;
    
userRespawn[id]   = 0;
    
userXp[id]   = 0;
}

public 
client_disconnect(id
{
    
userHEgrenade[id]    = 0;
    
userFlashbang[id]   = 0;
    
userSmokegrenade[id]   = 0;
    
userAwp[id]   = 0;
    
userDeagle[id]   = 0;
    
userHP[id]   = 0;
    
userArmor[id]   = 0;
    
userNofalldamage[id]   = 0;
    
userAntiflash[id]   = 0;
    
userAntifrost[id]   = 0;
    
userStealth[id]   = 0;
    
userCamo[id]   = 0;
    
userRespawn[id]   = 0;
    
userXp[id]   = 0;
}

public 
advert() 
{
    
client_print_color(0DontChange"^4[Lw. Shop] ^1Click ^4'N' ^1To Open  The ^4Shop.");
    
    
client_print_color(0DontChange"^4[Lw. Shop] ^1This server is running ^3Hide'N'Seek ^4Shop, ^1to open the Type ^4/shop ^1or Press ^4'N'");


public 
Event_Deathmsg()
{
    new 
victim read_data(2)
    
    
userHEgrenade[victim]    = 0;
    
userFlashbang[victim]   = 0;
    
userSmokegrenade[victim]   = 0;
    
userAwp[victim]   = 0;
    
userDeagle[victim]   = 0;
    
userHP[victim]   = 0;
    
userArmor[victim]   = 0;
    
userNofalldamage[victim]   = 0;
    
userAntiflash[victim]   = 0;
    
userAntifrost[victim]   = 0;
    
userStealth[victim]   = 0;
    
userCamo[victim]   = 0;
    
userRespawn[victim]   = 0;
    
userXp[victim]   = 0;
}

public 
hideNseek(id){
    
    new 
iMoney cs_get_user_moneyid );
    new 
color1[] = "\d";
    new 
color2[] = "\d";
    new 
color3[] = "\d";
    new 
color4[] = "\d";
    new 
color5[] = "\d";
    new 
color6[] = "\d";
    new 
color7[] = "\d";
    new 
color8[] = "\d";
    new 
color9[] = "\d";
    new 
color10[] = "\d";
    new 
color11[] = "\d";
    new 
color12[] = "\d";
    new 
color13[] = "\d";
    new 
color14[] = "\d";
        
    if(
iMoney >= get_pcvar_num(HEgrenadecost)) 
    {
    
color1 "\w";
    }
    if(
iMoney >= get_pcvar_num(Flashbangcost))
    {
    
color2 "\w";
    }
    if(
iMoney >= get_pcvar_num(Smokegrenadecost))
    {
    
color3 "\w";
    }
    if(
iMoney >= get_pcvar_num(Awpcost))
    {
    
color4 "\w";
    }
    if(
iMoney >= get_pcvar_num(Deaglecost))
    {
    
color5 "\w";
    }
    if(
iMoney >= get_pcvar_num(HPcost))
    {
    
color6 "\w";
    }
    if(
iMoney >= get_pcvar_num(Armorcost))
    {
    
color7 "\w";
    }
    if(
iMoney >= get_pcvar_num(Nofalldamagecost))
    {
    
color8 "\w";
    }
    if(
iMoney >= get_pcvar_num(Antiflashcost))
    {
    
color9 "\w";
    }
    if(
iMoney >= get_pcvar_num(Antifrostcost))
    {
    
color10 "\w";
    }
    if(
iMoney >= get_pcvar_num(Stealthcost))
    {
    
color11 "\w";
    }
    if(
iMoney >= get_pcvar_num(Camocost))
    {
    
color12 "\w";
    }
    if(
iMoney >= get_pcvar_num(Respawncost))
    {
    
color13 "\w";
    }
    if(
iMoney >= get_pcvar_num(Xpcost))
    {
    
color14 "\w";
    }

    if(
get_pcvar_num(plugin_on) == 1)
    {
    
    new 
iMenu menu_create"\r[\wLw. Shop\r]\yHide'N'Seek Shop v1.0^n\wBy Lw.^n^n""hideNseek_handler" );

    
    
    new 
grav[60];

    
formatex(gravsizeof(grav) - 1"%sHE-Grenade  \r%d$"color1get_pcvar_num(HEgrenadecost));
    
menu_additem(iMenugrav"1"0);

    
formatex(gravsizeof(grav) - 2"%sHe-grenade - \r%d$"color2get_pcvar_num(Flashbangcost)); 
    
menu_additem(iMenugrav"2"0);
    
    
formatex(gravsizeof(grav) - 3"%sHe-grenade - \r%d$"color3get_pcvar_num(Smokegrenadecost)); 
    
menu_additem(iMenugrav"3"0);
    
    
formatex(gravsizeof(grav) - 4"%sHe-grenade - \r%d$"color4get_pcvar_num(Awpcost)); 
    
menu_additem(iMenugrav"4"0);
    
    
formatex(gravsizeof(grav) - 5"%sHe-grenade - \r%d$"color5get_pcvar_num(Deaglecost)); 
    
menu_additem(iMenugrav"5"0);
    
    
formatex(gravsizeof(grav) - 6"%sHe-grenade - \r%d$"color6get_pcvar_num(HPcost)); 
    
menu_additem(iMenugrav"6"0);
    
    
formatex(gravsizeof(grav) - 7"%sHe-grenade - \r%d$"color7get_pcvar_num(Armorcost)); 
    
menu_additem(iMenugrav"7"0);
    
    
formatex(gravsizeof(grav) - 8"%sHe-grenade - \r%d$"color8get_pcvar_num(Nofalldamagecost)); 
    
menu_additem(iMenugrav"8"0);
    
    
formatex(gravsizeof(grav) - 9"%sHe-grenade - \r%d$"color9get_pcvar_num(Antiflashcost)); 
    
menu_additem(iMenugrav"9"0);
    
    
formatex(gravsizeof(grav) - 10"%sHe-grenade - \r%d$"color10get_pcvar_num(Antifrostcost)); 
    
menu_additem(iMenugrav"10"0);
    
    
formatex(gravsizeof(grav) - 11"%sHe-grenade - \r%d$"color11get_pcvar_num(Stealthcost)); 
    
menu_additem(iMenugrav"11"0);
    
    
formatex(gravsizeof(grav) - 12"%sHe-grenade - \r%d$"color12get_pcvar_num(Camocost)); 
    
menu_additem(iMenugrav"12"0);
    
    
formatex(gravsizeof(grav) - 13"%sHe-grenade - \r%d$"color13get_pcvar_num(Respawncost)); 
    
menu_additem(iMenugrav"13"0);
    
    
formatex(gravsizeof(grav) - 14"%sHe-grenade - \r%d$"color14get_pcvar_num(Xpcost)); 
    
menu_additem(iMenugrav"14"0);

    } 
   
    else
    {
        
client_printidprint_chat"[Lw. Shop] Shop is currently closed.");
    }
}


public 
hideNseek_handler(idiMenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroyiMenu );
        return 
PLUGIN_HANDLED;
    }
   
    new 
data[6], iName[32];
    new 
accesscallback;
   
    
menu_item_getinfo(iMenuitemaccessdata,5iName31callback);
   
    new 
key str_to_num(data);
   
    switch(
key)
    {
        case 
1// HE-Grenade
        
{
            if(!
is_user_alive(id)) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need to be alive!");
                return 
PLUGIN_HANDLED;
            }
            if(
userHEgrenade[id] > 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You already own this item!");
                return 
PLUGIN_HANDLED;
            }
            if(
get_pcvar_num(allowHEgrenade) == 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1This item is disabled.");
                return 
PLUGIN_HANDLED;
            }
    
            new 
money fm_get_user_money(id);
            new 
cost get_pcvar_num(HEgrenadecost);
    
            if(
money cost || money == cost) {
                
fm_get_user_money(idmoney cost);
                
fm_give_item(id"weapon_hegrenade")
                
userHEgrenade[id]++;
                
client_print_color0DontChange"^4[Lw. Shop] ^1You purchased ^3HE-Grenade.");
            } else {  
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need more ^4money ^1to buy this!");
            } 
            
        }
        case 
2// Flash-Bang
        
{
            if(!
is_user_alive(id)) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need to be alive!");
                return 
PLUGIN_HANDLED;
            }
            if(
userFlashbang[id] > 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You already own this item!");
                return 
PLUGIN_HANDLED;
            }
            if(
get_pcvar_num(allowFlashbang) == 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1This item is disabled.");
                return 
PLUGIN_HANDLED;
            }
    
            new 
money fm_get_user_money(id);
            new 
cost get_pcvar_num(Flashbangcost);
    
            if(
money cost || money == cost) {
                
fm_get_user_money(idmoney cost);
                
fm_give_item(id"weapon_flashbang")
                
userFlashbang[id]++;
                
client_print_color0DontChange"^4[Lw. Shop] ^1You purchased ^3Flash-Bang.");
            } else {  
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need more ^4money ^1to buy this!");
            } 
            
        }
        case 
3// Smoke-Grenade
        
{
            if(!
is_user_alive(id)) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need to be alive!");
                return 
PLUGIN_HANDLED;
            }
            if(
userSmokegrenade[id] > 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You already own this item!");
                return 
PLUGIN_HANDLED;
            }
            if(
get_pcvar_num(allowSmokegrenade) == 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1This item is disabled.");
                return 
PLUGIN_HANDLED;
            }
    
            new 
money fm_get_user_money(id);
            new 
cost get_pcvar_num(Smokegrenadecost);
    
            if(
money cost || money == cost) {
                
fm_get_user_money(idmoney cost);
                
fm_give_item(id"weapon_smokegrenade")
                
userSmokegrenade[id]++;
                
client_print_color0DontChange"^4[Lw. Shop] ^1You purchased ^3Smoke-Grenade.");
            } else {  
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need more ^4money ^1to buy this!");
            } 
            
        }
        case 
4// Awp
        
{
            if(!
is_user_alive(id)) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need to be alive!");
                return 
PLUGIN_HANDLED;
            }
            if(
userAwp[id] > 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You already own this item!");
                return 
PLUGIN_HANDLED;
            }
            if(
get_pcvar_num(allowAwp) == 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1This item is disabled.");
                return 
PLUGIN_HANDLED;
            }
    
            new 
money fm_get_user_money(id);
            new 
cost get_pcvar_num(Awpcost);
    
            if(
money cost || money == cost) {
                
fm_get_user_money(idmoney cost);
                
fm_give_itemid"weapon_awp" )
                
cs_set_weapon_ammofind_ent_by_owner1"weapon_awp"id ), )
                
userAwp[id]++;
                
client_print_color0DontChange"^4[Lw. Shop] ^1You purchased ^3Awp 1 Shot.");
            } else {  
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need more ^4money ^1to buy this!");
            } 
            
        }
        case 
5// Deagle
        
{
            if(!
is_user_alive(id)) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need to be alive!");
                return 
PLUGIN_HANDLED;
            }
            if(
userDeagle[id] > 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You already own this item!");
                return 
PLUGIN_HANDLED;
            }
            if(
get_pcvar_num(allowDeagle) == 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1This item is disabled.");
                return 
PLUGIN_HANDLED;
            }
    
            new 
money fm_get_user_money(id);
            new 
cost get_pcvar_num(Deaglecost);
    
            if(
money cost || money == cost) {
                
fm_get_user_money(idmoney cost);
                
fm_give_itemid"weapon_deagle" )
                
cs_set_weapon_ammofind_ent_by_owner1"weapon_deagle"id ), )
                
userDeagle[id]++;
                
client_print_color0DontChange"^4[Lw. Shop] ^1You purchased ^3Deagle 1 Shot.");
            } else {  
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need more ^4money ^1to buy this!");
            } 
            
        }
        case 
6// 150 HP
        
{
            if(!
is_user_alive(id)) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need to be alive!");
                return 
PLUGIN_HANDLED;
            }
            if(
userHP[id] > 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You already own this item!");
                return 
PLUGIN_HANDLED;
            }
            if(
get_pcvar_num(allowHP) == 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1This item is disabled.");
                return 
PLUGIN_HANDLED;
            }
    
            new 
money fm_get_user_money(id);
            new 
cost get_pcvar_num(HPcost);
    
            if(
money cost || money == cost) {
                new 
userhp get_user_healthid )
                new 
hpcvar get_pcvar_numhpcvar )
                
fm_set_user_healthiduserhp )
                
userHP[id]++;
                
client_cmdid"spk items/medshot4" )
                
fm_get_user_money(idmoney cost);
                
userHP[id]++;
                
client_print_color0DontChange"^4[Lw. Shop] ^1You purchased ^3150 HP.");
            } else {  
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need more ^4money ^1to buy this!");
            } 
            
        }
        case 
7// 150 Armor
        
{
            if(!
is_user_alive(id)) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need to be alive!");
                return 
PLUGIN_HANDLED;
            }
            if(
userArmor[id] > 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You already own this item!");
                return 
PLUGIN_HANDLED;
            }
            if(
get_pcvar_num(allowArmor) == 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1This item is disabled.");
                return 
PLUGIN_HANDLED;
            }
    
            new 
money fm_get_user_money(id);
            new 
cost get_pcvar_num(Armorcost);
    
            if(
money cost || money == cost) {
                new 
playerarmor get_user_armorid )
                new 
armor get_pcvar_numarmorammount )
                
fm_set_user_armoridplayerarmor armor )
                
fm_get_user_money(idmoney cost);
                
userArmor[id]++;
                
client_print_color0DontChange"^4[Lw. Shop] ^1You purchased ^3150 Armor.");
            } else {  
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need more ^4money ^1to buy this!");
            } 
            
        }
        case 
8// NoFallDamage
        
{
            if(!
is_user_alive(id)) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need to be alive!");
                return 
PLUGIN_HANDLED;
            }
            if(
userNofalldamage[id] > 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You already own this item!");
                return 
PLUGIN_HANDLED;
            }
            if(
get_pcvar_num(allowNofalldamage) == 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1This item is disabled.");
                return 
PLUGIN_HANDLED;
            }
    
            new 
money fm_get_user_money(id);
            new 
cost get_pcvar_num(Nofalldamagecost);
    
            if(
money cost || money == cost) {
                
fm_get_user_money(idmoney cost);
                
userNofalldamage[id]++;
                
client_print_color0DontChange"^4[Lw. Shop] ^1You purchased ^3NoFallDamage.");
            } else {  
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need more ^4money ^1to buy this!");
            } 
            
        }
        case 
9// Anti-Flash
        
{
            if(!
is_user_alive(id)) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need to be alive!");
                return 
PLUGIN_HANDLED;
            }
            if(
userAntiflash[id] > 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You already own this item!");
                return 
PLUGIN_HANDLED;
            }
            if(
get_pcvar_num(Antiflashcost) == 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1This item is disabled.");
                return 
PLUGIN_HANDLED;
            }
    
            new 
money fm_get_user_money(id);
            new 
cost get_pcvar_num(Antiflashcost);
    
            if(
money cost || money == cost) {
                
fm_get_user_money(idmoney cost);
                
userAntiflash[id]++;
                
client_print_color0DontChange"^4[Lw. Shop] ^1You purchased ^3Anti-Flash.");
            } else {  
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need more ^4money ^1to buy this!");
            } 
            
        }
        case 
10// Anti-Frost
        
{
            if(!
is_user_alive(id)) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need to be alive!");
                return 
PLUGIN_HANDLED;
            }
            if(
userAntifrost[id] > 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You already own this item!");
                return 
PLUGIN_HANDLED;
            }
            if(
get_pcvar_num(Antifrostcost) == 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1This item is disabled.");
                return 
PLUGIN_HANDLED;
            }
    
            new 
money fm_get_user_money(id);
            new 
cost get_pcvar_num(Antifrostcost);
    
            if(
money cost || money == cost) {
                
fm_get_user_money(idmoney cost);
                
userAntifrost[id]++;
                
client_print_color0DontChange"^4[Lw. Shop] ^1You purchased ^3150 HP.");
            } else {  
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need more ^4money ^1to buy this!");
            } 
            
        }
        case 
11// Stealth
        
{
            if(!
is_user_alive(id)) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need to be alive!");
                return 
PLUGIN_HANDLED;
            }
            if(
userStealth[id] > 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You already own this item!");
                return 
PLUGIN_HANDLED;
            }
            if(
get_pcvar_num(Stealthcost) == 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1This item is disabled.");
                return 
PLUGIN_HANDLED;
            }
    
            new 
money fm_get_user_money(id);
            new 
cost get_pcvar_num(Stealthcost);
    
            if(
money cost || money == cost) {
                
fm_set_user_renderingidkRenderFxGlowShell000kRenderTransAlpha15 );
                
set_task20.0"remove_stealth"id );
                
fm_get_user_money(idmoney cost);
                
userStealth[id]++;
                
client_print_color0DontChange"^4[Lw. Shop] ^1You purchased ^3Stealth For 20 Sec.");
            } else {  
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need more ^4money ^1to buy this!");
            } 
            
        }
        case 
12// Camoflouge
        
{
            if(!
is_user_alive(id)) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need to be alive!");
                return 
PLUGIN_HANDLED;
            }
            if(
userCamo[id] > 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You already own this item!");
                return 
PLUGIN_HANDLED;
            }
            if(
get_pcvar_num(allowCamo) == 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1This item is disabled.");
                return 
PLUGIN_HANDLED;
            }
    
            new 
money fm_get_user_money(id);
            new 
cost get_pcvar_num(Camocost);
    
            if(
money cost || money == cost) {
                
team get_user_team(id);
        
                    if (
team == 1)        
                    {
                        
cs_set_user_model(id"urban");
                    }
                    
                    else
                    {
                        
cs_set_user_model(id"leet");
                    }
                
fm_get_user_money(idmoney cost);
                
userCamo[id]++;
                
client_print_color0DontChange"^4[Lw. Shop] ^1You purchased ^3Camoflouge For 20 Sec.");
            } else {  
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need more ^4money ^1to buy this!");
            } 
            
        }
        case 
13// Respawn
        
{
            if(!
is_user_alive(id)) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need to be alive!");
                return 
PLUGIN_HANDLED;
            }
            if(
userRespawn[id] > 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You already own this item!");
                return 
PLUGIN_HANDLED;
            }
            if(
get_pcvar_num(allowRespawn) == 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1This item is disabled.");
                return 
PLUGIN_HANDLED;
            }
    
            new 
money fm_get_user_money(id);
            new 
cost get_pcvar_num(Respawncost);
    
            if(
money cost || money == cost) {
                
fm_get_user_money(idmoney cost);
                
ExecuteHamB(Ham_CS_RoundRespawnid);
                
userRespawn[id]++;
                
client_print_color0DontChange"^4[Lw. Shop] ^1You purchased ^3Respawn.");
            } else {  
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need more ^4money ^1to buy this!");
            } 
            
        }
        case 
14// 150 Xp
        
{
            if(!
is_user_alive(id)) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need to be alive!");
                return 
PLUGIN_HANDLED;
            }
            if(
userXp[id] > 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1You already own this item!");
                return 
PLUGIN_HANDLED;
            }
            if(
get_pcvar_num(allowXp) == 0) {
                
client_print_color0DontChange"^4[Lw. Shop] ^1This item is disabled.");
                return 
PLUGIN_HANDLED;
            }
    
            new 
money fm_get_user_money(id);
            new 
cost get_pcvar_num(Xpcost);
    
            if(
money cost || money == cost) {
                
fm_get_user_money(idmoney cost);
                
userXp[id]++;
                
client_print_color0DontChange"^4[Lw. Shop] ^1You purchased ^3150 Xp.");
            } else {  
                
client_print_color0DontChange"^4[Lw. Shop] ^1You need more ^4money ^1to buy this!");
            } 
            
        }
    }
    return 
PLUGIN_HANDLED;
}

public 
remove_camo(id
{
    
cs_reset_user_model(id);
    
usercamo[id] = 0;
    
    
ColorChat(idGREEN"^4[Lw. Shop] ^1you dont look like enemy anymore.");
}


// remove stealth
public remove_stealthid ) {
    
    new 
iName[32]
    
get_user_name(id,iName,31)
    
    
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlpha255);
    
ColorChat(idBLUE,"^4[Lw. Shop] ^1 you dont have Stealth anymore.",iName);


/// NoFlash Blinding - Start
public bad_fix2() {
    new 
Float:gametime get_gametime();
    if(
gametime g_gametime2 2.5)
        for(new 
032i++)
            
grenade[i] = 0;
}

public 
eventFlashid ) {
    new 
Float:gametime get_gametime();
    if(
gametime != g_gametime) { 
        
g_owner get_grenade_owner();
        
g_gametime gametime;
        for(new 
033i++) 
            
g_track[i] = false;
        
g_track_enemy false;
    }    
    if(
is_user_connected(g_owner) && usernoflash[id] > 0) {
        
g_track_enemy true;

        
message_begin(MSG_ONEg_msgScreenFade, {0,0,0}, id);
        
write_short(1);
        
write_short(1);
        
write_short(1);
        
write_byte(0);
        
write_byte(0);
        
write_byte(0);
        
write_byte(255);
        
message_end();
    }
}

public 
flash_delay() {
    if(
g_track_enemy == false) {
        for(new 
033i++) {
            if(
g_track[i] == true && is_user_connected(i)) {
                
message_begin(MSG_ONEg_msgScreenFade, {0,0,0}, i) ;
                
write_short(1);
                
write_short(1);
                
write_short(1);
                
write_byte(0);
                
write_byte(0);
                
write_byte(0);
                
write_byte(255);
                
message_end();
            }
        }
    }
}

public 
grenade_throw() {
    if(
g_sync_check_data == 0)
        return 
PLUGIN_CONTINUE;
    
g_sync_check_data--;
    if(
read_datanum() < 2)
        return 
PLUGIN_HANDLED_MAIN;

    if(
read_data(1) == 11 && (read_data(2) == || read_data(2) == 1))
        
add_grenade_owner(last);

    return 
PLUGIN_CONTINUE;
}

public 
fire_in_the_hole() {
    new 
name[32];
    
read_data(3name31);
    new 
temp_last get_user_index(name);
    new 
junk;
    if((
temp_last == 0) || (!is_user_connected(temp_last)))
        return 
PLUGIN_CONTINUE;
    if(
get_user_weapon(temp_last,junk,junk) == CSW_FLASHBANG) {
        
last temp_last;
        
g_sync_check_data 2
    }
    return 
PLUGIN_CONTINUE;
}

public 
fire_in_the_hole2() {
    new 
name[32];
    
read_data(4name31);
    new 
temp_last get_user_index(name);
    new 
junk;
    if((
temp_last == 0) || (!is_user_connected(temp_last)))
        return 
PLUGIN_CONTINUE;
    if(
get_user_weapon(temp_last,junk,junk) == CSW_FLASHBANG) {    
        
last temp_last;
        
g_sync_check_data 2;
    }
    return 
PLUGIN_CONTINUE;
}

add_grenade_owner(owner) {
    new 
Float:gametime get_gametime();
    
g_gametime2 gametime;
    for(new 
032i++) {
        if(
grenade[i] == 0) {
            
grenade[i] = owner;
            return;
        }
    }
}

get_grenade_owner() {
    new 
which grenade[0];
    for(new 
132i++)  
        
grenade[i-1] = grenade[i];
    
grenade[31] = 0;
    return 
which;
}

// from XxAvalanchexX "Flashbang Dynamic Light"
public fw_emitsound(entity,channel,const sample[],Float:volume,Float:attenuation,fFlags,pitch) {
    if(!
equali(sample,"weapons/flashbang-1.wav") && !equali(sample,"weapons/flashbang-2.wav"))
        return 
FMRES_IGNORED;

    new 
Float:gametime get_gametime();

    
//in case no one got flashed, the sound happens after all the flashes, same game time
    
if(gametime != g_gametime) {
        
g_owner get_grenade_owner();
        return 
FMRES_IGNORED;
    }
    return 
FMRES_IGNORED;
}
// NoFlash Blinding - End 
it good?
MyEyesGreen is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 06-17-2010 , 17:06   Re: Help with Hns Shop
Reply With Quote #2

Quote:
Originally Posted by MyEyesGreen View Post
Some one can fix all my plugin ?
No. This is Scripting Help. Not I'll post this here and you fix it.
__________________
Hi.
Kreation is offline
wizard94
Junior Member
Join Date: Jul 2010
Location: ^Argentina^
Old 09-19-2010 , 21:18   Re: Help with Hns Shop
Reply With Quote #3

que forr chabon...
wizard94 is offline
Send a message via MSN to wizard94
Reply


Thread Tools
Display Modes

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 14:53.


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