User
Pass
2FA
 
 

Modificare plugin Buy Health [ ZM ]

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Plugins - Help / Support
Author Message849
Smokey.

[Mentally Stable]



Status: Offline
(since 08-01-2016 17:02)
Joined: 21 Dec 2015
Posts: 21, Topics: 9
Location: Romania

Reputation: 0.7

Post Posted: 21-12-2015, 10:15:54 | Translate post to: ... (Click for more languages)

Salut userii freakz, am si eu un plugin in care vreau sa il modificati. El se numeste Buy Health [ ZM ] ! Ideea e ca acest plugin e pe modul zombie plague si cu acest extra item poti cumpara viata , insa am o problema vreau sa fie one round !! De ce ? Pentru ca daca nu e one round, toti zombi oameni pot atinge peste 100000 la viata cu nu stiu cate Pachete de Munitie ! Va multumesc mult , codul e mai jos !
Edit: si daca ati putea adauga si un mesaj cu , Numai runda viitoare poti Cumpara Viata !!
Code:
#include <amxmodx>
#include <fun>
#include <zombieplague>

new const item_name[] = "Cumpara Viata (1000hp)"
new g_itemid_buyhp
new hpamount

public plugin_init()
{
   register_plugin("[ZP] Buy Health Points", "1.0", "T[h]E Dis[as]teR")
   hpamount = register_cvar("zp_buyhp_amount", "1000")
   g_itemid_buyhp = zp_register_extra_item(item_name, 5, ZP_TEAM_HUMAN & ZP_TEAM_ZOMBIE)
}
public zp_extra_item_selected(id,itemid)
{
   if(!is_user_alive(id))
      
   return PLUGIN_HANDLED;
   
   if(itemid==g_itemid_buyhp)
   {
      if(zp_get_user_ammo_packs(id) < 10)
      {
         client_print(id, print_chat,"[ZP] Nu ai indeajuns Pachete de Munitie!");
         return PLUGIN_HANDLED;
      }
      else
      {

         set_user_health(id,get_user_health(id)+get_pcvar_num(hpamount));
         zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) - 10);
         client_print(id, print_chat,"[ZP] Ai Cumparat Viata!");
      }
   }
   return PLUGIN_CONTINUE;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang3082\\ f0\\ fs16 \n\\ par }
*/

0 0
  
Back to top
View user's profile Send private message
EDUTz

[HardcoreAmxxScripter]



Status: Offline
(since 15-08-2021 16:34)
Joined: 27 Dec 2010
Posts: 4306, Topics: 244
Location: Jud. Miserupia, sat Bagadanc

Reputation: 4085
Votes: 179

         
Post Posted: 21-12-2015, 12:30:18 | Translate post to: ... (Click for more languages)

Uite pe asta-l foloseam eu pe serverul meu vechi, e modificat special doar pentru o runda.
Modifici dupa bunul plac cvarurile si mesajele.

Code:
#include <amxmodx>
#include <fakemeta>

#define ZP_TEAM_ZOMBIE (1<<0)
#define ZP_TEAM_HUMAN (1<<1)

native zp_register_extra_item(a[], b, c)
forward zp_extra_item_selected(a, b)
new cumparathp[33]

new BUY_HP_ITEM_ID, HP_CVAR_AMMOUNT

public plugin_init()
{
   register_plugin("[ZP] Buy Health", "1.0", "Hattrick")
   HP_CVAR_AMMOUNT = register_cvar("zp_buy_hp_amount", "800")
   BUY_HP_ITEM_ID = zp_register_extra_item("Buy health", 15, ZP_TEAM_HUMAN | ZP_TEAM_ZOMBIE)
   register_event("HLTV", "event_round_start", "a", "1=0", "2=0");
}

public event_round_start()
{
   for (new i = 0; i < get_maxplayers(); i++)
   {
      cumparathp[i] = 0
   }
}

public zp_extra_item_selected(index, item)
{
   if ((item == BUY_HP_ITEM_ID) && (cumparathp[index] == 0))
   {
      new Float:HP = float(get_user_health(index)) + get_pcvar_float(HP_CVAR_AMMOUNT)
      set_pev(index, pev_health, HP)
      
      new x[128]
      formatex(x, charsmax(x), "^x04[ZP]^x01 You bought 800 health", get_pcvar_float(HP_CVAR_AMMOUNT))
      
      message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, index)
      write_byte(index)
      write_string(x)
      message_end()
      cumparathp[index] = 1;
   }
   if ((item == BUY_HP_ITEM_ID) && (cumparathp[index] == 1))
   client_print(index, print_chat, "[ZP] Nu mai poti cumpara HP !")
}




Pentru pluginuri complicate le fac cu $$ pe paypal/psc. PM

1 0
  
Back to top
View user's profile Send private message Yahoo! Messenger ID
Smokey.

[Mentally Stable]



Status: Offline
(since 08-01-2016 17:02)
Joined: 21 Dec 2015
Posts: 21, Topics: 9
Location: Romania

Reputation: 0.7

Post Posted: 21-12-2015, 13:38:24 | Translate post to: ... (Click for more languages)

Multumesc mult Edutz !!! T/C !
0 0
  
Back to top
View user's profile Send private message

  Topic locked


Topic is closed, you cannot post any messages in it anymore

Locked by EDUTz, 21 December 2015 14:55



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Plugins - Help / Support  


The time now is 30-07-2025, 11:47:43
Copyright info

Based on phpBB ro/com
B

 
 
 







I forgot my password