Modificare shop

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
User avatar
K1d0x
Fost moderator
Fost moderator
Posts: 800
Joined: 26 Feb 2012, 15:57
Detinator Steam: Da
CS Status: We Build Together ;3 RedFear
Detinator server CS: PuB.RedFear.Ro
SteamID: k1dox
Reputatie: Fost moderator ajutator
Location: Reșița
Been thanked: 152 times
Contact:

26 Jul 2012, 21:33

| Afiseaza codul
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta>
#define PLUGIN "Shop Bb"
#define VERSION "1.0"
#define AUTHOR "R3D"
#define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )
 
/* -------------------------------------------------------------------- */
/* -----                                                          ----- */
/* -------------------------------------------------------------------- */
new const g_ModelSuperKnife[] = "models/ModelSuperKnife.mdl"
new grenade_ct
new gravity_ct
new flash_ct
new boost_ct
new camo_ct
new ext_ct
new veng_ct
new silence_t
new hp_t
new boost_t
new bhop_t
new transfo_t
new bool:Has_Adrenaline_CT
new bool:Has_Invisible_CT
new bool:Has_Gravity_CT
new bool:Has_Silence_T
new bool:Has_Bhop_T
new bool:Has_Supercut_T
new bool:Has_Vitesse_T
new g_iMaxPlayers
/* -------------------------------------------------------------------- */
/* -----                    Start Plugin                          ----- */
/* -------------------------------------------------------------------- */
public plugin_init() 
{
 
 register_plugin(PLUGIN, VERSION, AUTHOR)
 
 
 register_clcmd("say /shop", "shopmenu")
 register_clcmd("say shop", "shopmenu")
 register_clcmd("say_team /shop", "shopmenu")
 register_clcmd("say_team shop", "shopmenu")
 
 
 RegisterHam(Ham_Player_Jump, "player", "ham_PlayerJump_Pre", 1)
 RegisterHam(Ham_Spawn, "player", "Spawn", 1)
 RegisterHam(Ham_Item_Deploy, "weapon_knife", "ham_ItemDeploy_Post", 1)
 RegisterHam(Ham_TakeDamage, "player", "ham_TakeDamage_Pre")
 
 grenade_ct = register_cvar("bb_grenade_ct", "8000")
 gravity_ct = register_cvar("bb_gravity_ct", "3000")  
 flash_ct = register_cvar("bb_flash_ct", "8000")
 boost_ct = register_cvar("bb_adrenaline_ct", "10000")
 camo_ct = register_cvar("bb_camouflage_ct", "11500")
 ext_ct = register_cvar("bb_extasie_ct", "11500")
 veng_ct = register_cvar("bb_vengeur_ct","16000")
 
 silence_t = register_cvar("bb_silence_t","2000")
 hp_t = register_cvar("bb_hp_t","8000")
 boost_t = register_cvar("bb_boost_t","10000")
 bhop_t = register_cvar("bb_bhop_t","14500")
 transfo_t = register_cvar("bb_transfo_t","16000")
 
 g_iMaxPlayers = get_maxplayers()
}
public plugin_precache()
{
 precache_model(g_ModelSuperKnife)
}

public client_connect(id)
{
 Has_Adrenaline_CT = false
 Has_Invisible_CT = false
 Has_Gravity_CT = false
 Has_Vitesse_T = false
 Has_Silence_T = false
 Has_Bhop_T = false
 Has_Supercut_T = false
}
public client_disconnect(id)
{
 Has_Adrenaline_CT = false
 Has_Invisible_CT = false
 Has_Gravity_CT = false
 Has_Vitesse_T = false
 Has_Silence_T = false
 Has_Bhop_T = false
 Has_Supercut_T = false
}
 
 
/* -------------------------------------------------------------------- */
/* -----                         SPAWN                            ----- */
/* -------------------------------------------------------------------- */
public Spawn(id)
{
 Has_Adrenaline_CT = false
 Has_Invisible_CT = false
 Has_Gravity_CT = false
 Has_Vitesse_T = false
 Has_Silence_T = false
 Has_Bhop_T = false
 Has_Supercut_T = false
}
 
/* -------------------------------------------------------------------- */
/* -----                      Meniu SHop                          ----- */
/* -------------------------------------------------------------------- */
 
 
public shopmenu(id)
{
 
 if(is_user_alive(id))
 { 
 
 
  new menu
  new menuText[32]
  
  
 
  if( cs_get_user_team(id) == CS_TEAM_CT )
  {
   menu = menu_create("SHOP [CT]:", "menu_ct")
   formatex( menuText, charsmax(menuText), "\wHe - \r[%d $]", get_pcvar_num(grenade_ct) )
   menu_additem(menu, menuText, "1")
   formatex( menuText, charsmax(menuText), "\wGravitate - \r[%d $]", get_pcvar_num(gravity_ct) )
   menu_additem(menu, menuText, "2")
   formatex( menuText, charsmax(menuText), "\wFlash - \r[%d $]", get_pcvar_num(flash_ct) )
   menu_additem(menu, menuText, "3")
   formatex( menuText, charsmax(menuText), "\wViteza - \r[%d $]", get_pcvar_num(boost_ct) )
   menu_additem(menu, menuText, "4")
   formatex( menuText, charsmax(menuText), "\wInvizibil 70% - \r[%d $]", get_pcvar_num(camo_ct) )
   menu_additem(menu, menuText, "5")
   formatex( menuText, charsmax(menuText), "\w+100HP si 100AP - \r[%d $]", get_pcvar_num(ext_ct) )
   menu_additem(menu, menuText, "6")
   formatex( menuText, charsmax(menuText), "\wM249illimiter - \r[%d $]", get_pcvar_num(veng_ct) )
   menu_additem(menu, menuText, "7")
   
   menu_setprop(menu, MPROP_EXITNAME, "Sortir")
   menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
   menu_display(id, menu)
   
  }
  else if( cs_get_user_team(id) == CS_TEAM_T)
  {
   menu = menu_create("SHOP [T]:", "menu_t")
   formatex( menuText, charsmax(menuText), "\wPasi silenti - \r[%d $]", get_pcvar_num(silence_t) )
   menu_additem(menu, menuText, "1")
   formatex( menuText, charsmax(menuText), "\w+990HP - \r[%d $]", get_pcvar_num(hp_t) )
   menu_additem(menu, menuText, "2")
   formatex( menuText, charsmax(menuText), "\wViteza - \r[%d $]", get_pcvar_num(boost_t) )
   menu_additem(menu, menuText, "3")
   formatex( menuText, charsmax(menuText), "\wBhop Automat - \r[%d $]", get_pcvar_num(bhop_t) )
   menu_additem(menu, menuText, "4")
   formatex( menuText, charsmax(menuText), "\wSuper cut+1990HP - \r[%d $]", get_pcvar_num(transfo_t) )
   menu_additem(menu, menuText, "5")
   
   menu_setprop(menu, MPROP_EXITNAME, "Iesire")
   menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
   menu_display(id, menu)
  }
 }
}
 
/* -------------------------------------------------------------------- */
/* -----                         MENIU                            ----- */
/* -------------------------------------------------------------------- */

public menu_ct(id, menu, item)
{
 if (item == MENU_EXIT) return PLUGIN_HANDLED
 // Obtenir l'info de l'item
 new info[3]
 new access, callback
 menu_item_getinfo(menu, item, access, info, 2, _, _, callback)
 new key = str_to_num(info)
 
 
 new money = cs_get_user_money(id)
 
 
 switch(key)
 {
  case 1:
  {
   if(!is_user_alive(id))
   {
    
    mort(id)
    return PLUGIN_HANDLED
    
   }
   else if(user_has_weapon(id, CSW_HEGRENADE))
   {
    
    Deja_arme(id)
    return PLUGIN_HANDLED
    
   }
   
   new V_he = get_pcvar_num(grenade_ct)
   if( money < V_he )
   {
    
    miss_money(id)
    return PLUGIN_HANDLED
    
   }
   else if( money >= V_he)
   {
    
    give_item(id, "weapon_hegrenade")
    cs_set_user_money(id, money - V_he, 1)
    achat(id)
    
   }
   return PLUGIN_HANDLED
  }
  case 2:
  {
   if(!is_user_alive(id))
   {
    
    mort(id)
    return PLUGIN_HANDLED
    
   }
   else if(Has_Gravity_CT == true)
   {
    
    Deja_arme(id)
    return PLUGIN_HANDLED
    
   }
   
   new V_Gravity = get_pcvar_num(gravity_ct)
   if( money < V_Gravity)
   {
    
    miss_money(id)
    return PLUGIN_HANDLED
    
   }
   else if( money >= V_Gravity)
   {
    
    set_user_gravity(id, 0.25)
    cs_set_user_money(id, money - V_Gravity, 1)
    achat(id)
    Has_Gravity_CT = true
    
   }
   return PLUGIN_HANDLED
  }
  case 3:
  {
   if(!is_user_alive(id))
   {
    
    mort(id)
    return PLUGIN_HANDLED
    
   }
   else if(user_has_weapon(id, CSW_HEGRENADE))
   {
    
    Deja_arme(id)
    return PLUGIN_HANDLED
    
   }
   
   new V_Flash = get_pcvar_num(flash_ct)
   if( money < V_Flash)
   {
    
    miss_money(id)
    return PLUGIN_HANDLED
    
   }
   else if( money >= V_Flash)
   {
    
    give_item(id, "weapon_flashbang")
    cs_set_user_money(id, money - V_Flash, 1)
    achat(id)
    
   }
   return PLUGIN_HANDLED
  }
  case 4:
  {
   if(!is_user_alive(id))
   {
    
    mort(id)
    return PLUGIN_HANDLED
    
   }
   else if(Has_Adrenaline_CT == true)
   {
    
    Deja_arme(id)
    return PLUGIN_HANDLED
    
   }
   
   new V_boost = get_pcvar_num(boost_ct)
   if( money < V_boost )
   {
    
    miss_money(id)
    return PLUGIN_HANDLED
    
   }
   else if( money >= V_boost )
   {
    
    set_user_maxspeed(id, 400.0)
    cs_set_user_money(id, money - V_boost, 1)
    Has_Adrenaline_CT = true
    achat(id)
    
   }
   return PLUGIN_HANDLED
  }
  case 5:
  {
   if(!is_user_alive(id))
   {
    
    mort(id)
    return PLUGIN_HANDLED
    
   }
   else if(Has_Invisible_CT == true)
   {
    
    Deja_arme(id)
    return PLUGIN_HANDLED
    
   }
   
   new V_camo = get_pcvar_num(camo_ct)
   if( money < V_camo )
   {
    
    miss_money(id)
    return PLUGIN_HANDLED
    
   }
   else if( money >= V_camo )
   {
    
    set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 18)
    cs_set_user_money(id, money - V_camo, 1)
    Has_Invisible_CT = true
    achat(id)
    
   }
   return PLUGIN_HANDLED
  }
  case 6:
  {
   if(!is_user_alive(id))
   {
    
    mort(id)
    return PLUGIN_HANDLED
    
   }
   
   new V_ext = get_pcvar_num(ext_ct)
   if( money < V_ext )
   {
    
    miss_money(id)
    return PLUGIN_HANDLED
    
   }
   else if( money >= V_ext)
   {
    
    set_user_health(id, get_user_health(id) + 100)
    cs_set_user_armor(id, get_user_armor(id) + 100, CS_ARMOR_VESTHELM)
    cs_set_user_money(id, money - V_ext, 1)
    achat(id)
    
   }
   return PLUGIN_HANDLED
  }
  case 7:
  {
   if(!is_user_alive(id))
   {
    
    mort(id)
    return PLUGIN_HANDLED
    
   }
   else if(user_has_weapon(id, CSW_M249))
   {
    
    Deja_arme(id)
    return PLUGIN_HANDLED
    
   }
   
   new V_veng = get_pcvar_num(veng_ct)
   if( money < V_veng )
   {
    
    miss_money(id)
    return PLUGIN_HANDLED
    
   }
   else if( money >= V_veng )
   {
    
    new weaponid = give_item(id, "weapon_m249")
    
    if ( weaponid )
    {
        cs_set_weapon_ammo(weaponid, 999)
    }
     
    cs_set_user_money(id, money - V_veng, 1)
    achat(id)
   }
   return PLUGIN_HANDLED
  }
  
 }
 return PLUGIN_HANDLED
}
 
 
public menu_t(id, menu, item)
{
 if (item == MENU_EXIT) return PLUGIN_HANDLED
 // Obtenir l'info de l'item
 new info[3]
 new access, callback
 menu_item_getinfo(menu, item, access, info, 2, _, _, callback)
 new key = str_to_num(info)
 
 
 new money = cs_get_user_money(id)
 
 
 switch(key)
 {
  case 1:
  {
   if(!is_user_alive(id))
   {
    
    mort(id)
    return PLUGIN_HANDLED
    
   }
   else if(Has_Silence_T == true)
   {
    
    Deja_arme(id)
    return PLUGIN_HANDLED
    
   }
   
   new G_silence = get_pcvar_num(silence_t)
   if( money < G_silence)
   {
    
    miss_money(id)
    return PLUGIN_HANDLED
    
   }
   else if( money >= G_silence)
   {
    
    set_user_footsteps(id, 1)
    cs_set_user_money(id, money - G_silence, 1)
    Has_Silence_T = true
    achat(id)
    
   }
   return PLUGIN_HANDLED
  }
  case 2:
  {
   if(!is_user_alive(id))
   {
    
    mort(id)
    return PLUGIN_HANDLED
    
   }
   new G_hp = get_pcvar_num(hp_t)
   if( money < G_hp)
   {
    
    miss_money(id)
    return PLUGIN_HANDLED
    
   }
   else if( money >= G_hp)
   {
    
    set_user_health(id, get_user_health(id) + 990)
    cs_set_user_money(id, money - G_hp, 1)
    achat(id)
    
   }
   return PLUGIN_HANDLED
  }
  case 3:
  {
   if(!is_user_alive(id))
   {
    
    mort(id)
    return PLUGIN_HANDLED
    
   }
   else if(Has_Vitesse_T == true)
   {
    
    Deja_arme(id)
    return PLUGIN_HANDLED
    
   }
   
   new G_boost = get_pcvar_num(boost_t)
   if( money < G_boost)
   {
    
    miss_money(id)
    return PLUGIN_HANDLED
    
   }
   else if( money >= G_boost)
   {
    
    set_user_maxspeed(id, 450.0)
    cs_set_user_money(id, money - G_boost, 1)
    Has_Vitesse_T = true
    achat(id)
    
   }
   return PLUGIN_HANDLED
  }
  case 4:
  {
   if(!is_user_alive(id))
   {
    
    mort(id)
    return PLUGIN_HANDLED
    
   }
   else if(Has_Bhop_T == true)
   {
    
    Deja_arme(id)
    return PLUGIN_HANDLED
    
   }
   
   new G_bhop = get_pcvar_num(bhop_t)
   if( money < G_bhop )
   {
    
    miss_money(id)
    return PLUGIN_HANDLED
    
   }
   else if( money >= G_bhop )
   {
    
    cs_set_user_money(id, money - G_bhop , 1)
    Has_Bhop_T = true
    achat(id)
    
   }
   return PLUGIN_HANDLED
  }
  case 5:
  {
   if(!is_user_alive(id))
   {
    
    mort(id)
    return PLUGIN_HANDLED
    
   }
   else if(Has_Supercut_T == true)
   {
    
    Deja_arme(id)
    return PLUGIN_HANDLED
    
   }
   
   new G_supercut = get_pcvar_num(transfo_t)
   if( money < G_supercut)
   {
    
    miss_money(id)
    return PLUGIN_HANDLED
    
   }
   else if( money >= G_supercut)
   {
    
    set_user_health(id, get_user_health(id) + 1990)
    cs_set_user_money(id, money - G_supercut, 1)
    Has_Supercut_T = true
      
    achat(id)
    
   }
   return PLUGIN_HANDLED
  }
 }
 return PLUGIN_HANDLED
}
 
 
 
/* -------------------------------------------------------------------- */
/* -----                        DIVERSE                           ----- */
/* -------------------------------------------------------------------- */
achat(id)
{
 
 print_color(id, id, 0, "^x04[Base Builder Shop]^x01 Achizitionare !")
 
}  
 
miss_money(id)
{
 
 print_color(id, id, 0, "^x04[Base Builder Shop]^x01 Nu ai suficienti bani($) pentru a cumpara acest item ...")
 
}  
 
Deja_arme(id)
{
 
 print_color(id, id, 0, "^x04[Base Builder Shop]^x01 Nu poti achizitiona un itel atunci cand il ai deja")
 
} 
 
mort(id)
{
 
 print_color(id, id, 0, "^x04[Base Builder Shop]^x01 Acest magazin (shop) nu este disponibil cand esti mort")
 
 
}

/* -------------------------------------------------------------------- */
/* -----                         ALTELE                           ----- */
/* -------------------------------------------------------------------- */
public ham_PlayerJump_Pre(id)
{
 if ( Has_Bhop_T == true && is_user_alive(id) )
 {
  if ( pev(id, pev_flags) & (FL_WATERJUMP | FL_ONGROUND) == FL_ONGROUND && pev(id, pev_waterlevel) < 2 )
  {
   new iOldButtons = pev(id, pev_oldbuttons)
   if ( iOldButtons & IN_JUMP )
   {
    set_pev(id, pev_oldbuttons, iOldButtons & ~IN_JUMP)
   }
  }
 }
}
public ham_TakeDamage_Pre(victim, inflictor, attacker, Float:damage, damage_bits)
{
 if ( IsPlayer(attacker) && is_user_alive(attacker) &&  inflictor == attacker && get_user_weapon(attacker) == CSW_KNIFE  && Has_Supercut_T == true)
 {
  SetHamParamFloat( 4, damage * 2 )
 }
}

public ham_ItemDeploy_Post(weapon_ent)
{
 static owner
 owner = get_pdata_cbase(weapon_ent, 41, 4)
 if ( is_user_alive(owner) && Has_Supercut_T == true )
 {
  set_pev(owner, pev_viewmodel2, g_ModelSuperKnife)
 }
 if ( get_user_weapon(owner) == CSW_KNIFE )
 {
  set_pev(owner, pev_viewmodel2, g_ModelSuperKnife)
 }
}

/* -------------------------------------------------------------------- */
/* -----                     CULORI CHAT                          ----- */
/* -------------------------------------------------------------------- */
public print_color(id, cid, color, const message[], any:...)
{
 new msg[192]
 vformat(msg, charsmax(msg), message, 5)
 new param
 if (!cid) return
 else param = cid
 new team[32]
 get_user_team(param, team, 31)
 switch (color)
 {
  case 0: msg_teaminfo(param, team)
  case 1: msg_teaminfo(param, "TERRORIST")
  case 2: msg_teaminfo(param, "CT")
  case 3: msg_teaminfo(param, "SPECTATOR")
 }
    
 if(id) msg_saytext(id, param, msg)
 else msg_saytext(0, param, msg)
 if (color != 0) msg_teaminfo(param, team)
}
msg_saytext(id, cid, msg[])
{
 message_begin(id?MSG_ONE:MSG_ALL, get_user_msgid("SayText"), {0,0,0}, id)
 write_byte(cid)
 write_string(msg)
 message_end()
}
msg_teaminfo(id, team[])
{
 message_begin(MSG_ONE, get_user_msgid("TeamInfo"), {0,0,0}, id)
 write_byte(id)
 write_string(team)
 message_end()
}
Translate, done
Invizibility, done
Gravity, done
Speed, done

Restu vrei prea multe si deocamdata nu am timp sa ma ocup
Image
32slots.net - Sursa ta de încredere de KIT-uri CS 1.6
RedFear.Ro România - | Afiseaza codul
Vă aştept cu un Register pe Forum
- Suntem în căutare de Dezvoltatori & Administratori :
HTML
PHP
MYSQL
C++
Ofer Server CS spre administrare | Afiseaza codul
Condiții : 
- Să dispui de timp liber
- Să ai cunoștințe AMXX & HLDS
Boostul este asigurat de către Mine (PM pentru. detalii)
ik1d0x@redfear.ro
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 21 guests