Raised This Month: $ Target: $400
 0% 

if you chaose sword1 you have sword1 damage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 11-10-2009 , 09:09   if you chaose sword1 you have sword1 damage
Reply With Quote #1

Topic^

PHP Code:
#include <amxmodx>
#include <hamsandwich>
new damage_sword1damage_sword2damage_sword3damage_sword4
new g_MaxPlayers
public plugin_init()
{
 
register_plugin("Fable TLC Mod Shop""1.0""Frostas")
 
register_clcmd("say shop""ShopSystem")
 
damage_sword1 register_cvar("damage_sword1""3.0")
 
damage_sword2 register_cvar("damage_sword2""4.0")
 
damage_sword3 register_cvar("damage_sword3""5.0")
 
damage_sword4 register_cvar("damage_sword4""6.0")
 
RegisterHam(Ham_TakeDamage"player""Ham_DamageSword1");
 
RegisterHam(Ham_TakeDamage"player""Ham_DamageSword2");
 
RegisterHam(Ham_TakeDamage"player""Ham_DamageSword3");
 
RegisterHam(Ham_TakeDamage"player""Ham_DamageSword4");
 
g_MaxPlayers get_maxplayers()
}
public 
Ham_DamageSword1(idinflictorattackerFloat:damagedamagebits
{
 if ( !(
<= attacker <= g_MaxPlayers) || !is_user_alive(id))
        return 
HAM_IGNORED;
 new 
weapon2 get_user_weapon(attacker__);
 if( 
weapon2 == CSW_KNIFE)
 {
  
SetHamParamFloat(4damage get_pcvar_float(damage_sword1))
  return 
HAM_HANDLED;
 }
 return 
HAM_IGNORED;
}
public 
Ham_DamageSword2(idinflictorattackerFloat:damagedamagebits
{
 if ( !(
<= attacker <= g_MaxPlayers) || !is_user_alive(id))
        return 
HAM_IGNORED;
 new 
weapon2 get_user_weapon(attacker__);
 if( 
weapon2 == CSW_KNIFE)
 {
  
SetHamParamFloat(4damage get_pcvar_float(damage_sword2))
  return 
HAM_HANDLED;
 }
 return 
HAM_IGNORED;
}
public 
Ham_DamageSword3(idinflictorattackerFloat:damagedamagebits
{
 if ( !(
<= attacker <= g_MaxPlayers) || !is_user_alive(id))
        return 
HAM_IGNORED;
 new 
weapon2 get_user_weapon(attacker__);
 if( 
weapon2 == CSW_KNIFE)
 {
  
SetHamParamFloat(4damage get_pcvar_float(damage_sword3))
  return 
HAM_HANDLED;
 }
 return 
HAM_IGNORED;
}
public 
Ham_DamageSword4(idinflictorattackerFloat:damagedamagebits
{
 if ( !(
<= attacker <= g_MaxPlayers) || !is_user_alive(id))
        return 
HAM_IGNORED;
 new 
weapon2 get_user_weapon(attacker__);
 if( 
weapon2 == CSW_KNIFE)
 {
  
SetHamParamFloat(4damage get_pcvar_float(damage_sword4))
  return 
HAM_HANDLED;
 }
 return 
HAM_IGNORED;
}
public 
ShopSystem(id)
{
 new 
menu menu_create("\rFable TLC Mod Shop:""menu_handler")
     
menu_additem(menu"\wSwords Menu""1"0);
     
menu_additem(menu"\wArmors Menu""2"0);
     
menu_setprop(menuMPROP_EXITMEXIT_ALL);
     
menu_display(idmenu0);
}
 
public 
menu_handler(idmenuitem)
{
 if (
item == MENU_EXIT)
     {
         
menu_destroy(menu);
         return 
PLUGIN_HANDLED;
     }
     new 
data[6], iName[64];
     new 
accesscallback;
     
menu_item_getinfo(menuitemaccessdata,5iName63callback);
     new 
key str_to_num(data);
     switch(
key)
     {
         case 
1:
         {
              
SwordsMenu(id)
         }
         case 
2:
         {
              
ArmorsMenu(id)
         }
     }
     
menu_destroy(menu);
     return 
PLUGIN_HANDLED;
}
SwordsMenu(id)
{
 new 
menu menu_create("\rFable TLC Swords:""swordsmenu_handler")
     
menu_additem(menu"\yBlack Sword""1"0);
     
menu_additem(menu"\yMithril Sword""2"0);
     
menu_additem(menu"\yAdamant Sword""3"0);
     
menu_additem(menu"\yRune Sword""4"0);
     
menu_setprop(menuMPROP_EXITMEXIT_ALL);
     
menu_display(idmenu0);
}
public 
swordsmenu_handler(idmenuitem)
{
 if (
item == MENU_EXIT)
     {
         
menu_destroy(menu);
         if (
is_user_connected(id))
             
ShopSystem(id);
         return 
PLUGIN_HANDLED;
     }
     new 
data[6], iName[64];
     new 
accesscallback;
     
menu_item_getinfo(menuitemaccessdata,5iName63callback);
     new 
key str_to_num(data);
     switch(
key)
     {
         case 
1:
         {
              
client_print(idprint_chat"You buy Black Sword!");
   
set_task(1.0"Ham_DamageSword1"id)
         }
         case 
2:
         {
              
client_print(idprint_chat"You buy Mithril Sword!");
   
set_task(2.0"Ham_DamageSword2"id)
         }
         case 
3:
         {
              
client_print(idprint_chat"You buy Adamant Sword!");
   
set_task(3.0"Ham_DamageSword3"id)
         }
         case 
4:
         {
              
client_print(idprint_chat"You buy Rune Sword!");
   
set_task(4.0"Ham_DamageSword4"id)
         }
     }
     
menu_destroy(menu);
     
ShopSystem(id);
     return 
PLUGIN_HANDLED;
}
ArmorsMenu(id)
{
 new 
menu menu_create("\rFable TLC Armors:""armorsmenu_handler")
     
menu_additem(menu"\yRune Full Helm""1"0);
     
menu_additem(menu"\yRune PlateBody""2"0);
     
menu_additem(menu"\yRune PlateLegs""3"0);
     
menu_setprop(menuMPROP_EXITMEXIT_ALL);
     
menu_display(idmenu0);
}
public 
armorsmenu_handler(idmenuitem)
{
 if (
item == MENU_EXIT)
     {
         
menu_destroy(menu);
         if (
is_user_connected(id))
             
ShopSystem(id);
         return 
PLUGIN_HANDLED;
     }
     new 
data[6], iName[64];
     new 
accesscallback;
     
menu_item_getinfo(menuitemaccessdata,5iName63callback);
     new 
key str_to_num(data);
     switch(
key)
     {
         case 
1:
         {
              
client_print(idprint_chat"You buy Rune Full Helm!");
         }
         case 
2:
         {
              
client_print(idprint_chat"You buy Rune PlateBody!");
         }
         case 
3:
         {
              
client_print(idprint_chat"You buy Rune PlateLegs!");
         }
     }
     
menu_destroy(menu);
     
ShopSystem(id);
     return 
PLUGIN_HANDLED;
}
stock fm_give_item(index, const item[])
{
 if (!
equal(item"weapon_"7) && !equal(item"ammo_"5) && !equal(item"item_"5) && !equal(item"tf_weapon_"10))
  return 
0
 
new ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocStringitem))
 if (!
pev_valid(ent))
  return 
0
 
new Float:origin[3]
 
pev(indexpev_originorigin)
 
set_pev(entpev_originorigin)
 
set_pev(entpev_spawnflagspev(entpev_spawnflags) | SF_NORESPAWN)
 
dllfunc(DLLFunc_Spawnent)
 new 
save pev(entpev_solid)
 
dllfunc(DLLFunc_Touchentindex)
 if (
pev(entpev_solid) != save)
  return 
ent
 engfunc
(EngFunc_RemoveEntityent)
 return -
1

who can help ?
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
 



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 17:46.


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