Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.

  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

[ROZWIĄZANE] Vip Zombie


  • Zamknięty Temat jest zamknięty
3 odpowiedzi w tym temacie

#1 ZarzadCSB

    Profesjonalista

  • Użytkownik

Reputacja: 8
Nowy

  • Postów:207
  • GG:
  • Imię:Watashi
  • Lokalizacja:reklama
Offline

Napisano 17.02.2012 12:47

Cześć.
Mam problem z vipem zm chciałbym usunąć mu to aby nie dostawał nieskończoność amunicji:


/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#include <hamsandwich>
#include <zombieplague>
////////// PLUGIN SETTINGS //////////
#define MODE 1
#define CHAT_PREFIX "[VIP]"
// (Only if MODE 1 is turrned OFF. Otherwise set flags in vips.ini.) //
#define VIPACCES ADMIN_LEVEL_H
#define MJACCES ADMIN_LEVEL_H
////////// SETTINGS END //////////
// Flags
#define FLAG_A (1<<0)
#define FLAG_B (1<<1)
#define FLAG_C (1<<2)
#define FLAG_D (1<<3)
#define FLAG_E (1<<4)
#define FLAG_K (1<<10)
#define VERSION "1.6"
#if cellbits == 32
const OFFSET_CLIPAMMO = 51
#else
const OFFSET_CLIPAMMO = 65
#endif
const OFFSET_LINUX_WEAPONS = 4
const DMG_HEGRENADE = (1<<24)
#if MODE & (1<<0) || MODE & (1<<1)
new amx_password_field_string[31]
#endif
#if MODE & (1<<0)
new g_user_privileges[33]
enum _:database_items
{
auth[50],
password[50],
accessflags,
flags
}
new vips_database[database_items]
new Array:database_holder
#endif
#if MODE & (1<<1)
const ZV_PLUGIN_HANDLED = 97
enum _:items
{
i_name[31],
i_description[31],
i_cost,
i_team
}
new g_register_in_zp_extra
new g_zp_extra_item_number
new g_menu_close
new extra_items[items]
new Array:items_database
new g_registered_items_count
new g_forward_return
new g_extra_item_selected
#endif
#if MODE == 3
new g_vip_buy_time
new g_vip_cost_ammo
new g_vip_buy_flags
new days
new months
new years
#endif
new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20, 10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 }
static const CONTACT[] = ""
new g_jumps, g_armor, g_killammo, g_infectammo, g_infecthealth, g_nemhealth, g_show_vips, g_unlimited_clip, g_damage_reward, g_damage_increase
new g_bit
new maxplayers, g_msgSayText
new jumpnum[33]
new bool:dojump[33]
new Float:g_damage[33]
public plugin_init() {

register_plugin("ZM VIP", VERSION, "aaarnas")
RegisterHam(Ham_Spawn, "player", "FwdHamPlayerSpawnPost", 1)
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
register_event("ResetHUD", "HUDReset", "be")
register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
maxplayers = get_maxplayers()
g_msgSayText = get_user_msgid("SayText")

g_jumps = register_cvar("zp_vip_jumps", "1")
g_bit = get_pcvar_num(register_cvar("zp_vip_allow_jump", "3"))
g_armor = register_cvar("zp_vip_armor", "65")
g_killammo = register_cvar("zp_vip_killammo", "2")
g_infectammo = register_cvar("zp_vip_infectammo", "2")
g_infecthealth = register_cvar("zp_vip_infecthealth", "300")
g_nemhealth = register_cvar("zp_vip_nemextra", "1")
g_show_vips = register_cvar("zp_vip_show", "1")
g_unlimited_clip = register_cvar("zp_vip_unlimited_ammo", "0")
g_damage_reward = register_cvar("zp_vip_damage_reward", "500")
g_damage_increase = register_cvar("zp_vip_damage_increase", "1.5")
register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
register_cvar("zp_vip_version", VERSION, FCVAR_SERVER|FCVAR_SPONLY)
set_cvar_string("zp_vip_version", VERSION)
#if MODE & (1<<0) || MODE & (1<<1)
get_cvar_string("amx_password_field", amx_password_field_string, 30)
register_dictionary("zm_vip.txt")
#endif
#if MODE & (1<<0) && MODE & (1<<1)
g_vip_cost_ammo = register_cvar("zp_vip_cost_ammo", "0")
g_vip_buy_time = register_cvar("zp_vip_buy_time", "7")
g_vip_buy_flags = register_cvar("zp_vip_buy_flags", "abcd")
set_task(5.0,"check_date",0)
#endif
#if MODE & (1<<0)
register_concmd("amx_reloadvips", "reload_vips", ADMIN_CFG)
reload_vips()
#endif
#if MODE & (1<<1)
register_clcmd("say /vm", "menu_open")
g_register_in_zp_extra = register_cvar("zp_vip_register_in_zp_extra", "1")
g_menu_close = register_cvar("zp_vip_menu_close", "1")
items_database = ArrayCreate(items)

new temp[31]
formatex(temp, 30, "%L", LANG_PLAYER, "VIP_EXTRA_NAME")
if(get_pcvar_num(g_register_in_zp_extra)) g_zp_extra_item_number = zp_register_extra_item(temp, 0, 0)
g_extra_item_selected = CreateMultiForward("zv_extra_item_selected", ET_CONTINUE, FP_CELL, FP_CELL)
#endif
register_clcmd("say /vips", "print_adminlist")
register_clcmd("say /vip", "ShowMotd")
}
public plugin_cfg()
{
new directory[31]
get_configsdir(directory, 30)
server_cmd("exec %s/zm_vip.cfg", directory)
}
#if MODE & (1<<1) || MODE & (1<<0)
public plugin_natives() {
#if MODE & (1<<1)
register_native("zv_register_extra_item", "native_zv_register_extra_item", 1)
#endif
#if MODE & (1<<0)
register_native("zv_get_user_flags", "native_zv_get_user_flags", 1)
#endif
}
#endif
public FwdHamPlayerSpawnPost(id) {
#if MODE & (1<<0)
if(!(g_user_privileges[id] & FLAG_A))
#else
if(!(get_user_flags(id) & VIPACCES))
#endif
  return PLUGIN_HANDLED;
if(pev(id, pev_armorvalue) < get_pcvar_num(g_armor))
set_pev(id, pev_armorvalue, float(get_pcvar_num(g_armor)))
return HAM_IGNORED;
}
public fw_PlayerKilled(victim, attacker) {
#if MODE & (1<<0)
if(is_user_alive(attacker) && g_user_privileges[attacker] & FLAG_A) {
#else
if(is_user_alive(attacker) && get_user_flags(attacker) & VIPACCES) {
#endif
  if(zp_get_user_zombie(attacker) && !(zp_get_user_nemesis(attacker) && !get_pcvar_num(g_nemhealth))) fm_set_user_health(attacker, (pev(attacker, pev_health) + get_pcvar_num(g_infecthealth)))
  zp_set_user_ammo_packs(attacker, zp_get_user_ammo_packs(attacker) + get_pcvar_num(g_killammo))
}
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) {

if(victim == attacker)
  return HAM_IGNORED
 
if(damage_type & DMG_HEGRENADE)
  return HAM_IGNORED
 
if(!is_user_connected(attacker))
  return HAM_IGNORED

if(zp_get_user_zombie(attacker) || zp_get_user_survivor(attacker))
  return HAM_IGNORED
 
#if MODE & (1<<0)
if(g_user_privileges[attacker] & FLAG_D) {
#else
if(get_user_flags(attacker) & VIPACCES) {
#endif
  if(get_pcvar_num(g_damage_reward) != 0) {
   g_damage[attacker]+damage
   if(g_damage[attacker] > float(get_pcvar_num(g_damage_reward))) {
    zp_set_user_ammo_packs(attacker, zp_get_user_ammo_packs(attacker)+1)
    g_damage[attacker] -= float(get_pcvar_num(g_damage_reward))
   }
  }
}
#if MODE & (1<<0)
if(g_user_privileges[attacker] & FLAG_D) {
#else
if(get_user_flags(attacker) & VIPACCES) {
#endif
  damage *= get_pcvar_float(g_damage_increase)
  SetHamParamFloat(4, damage)
}
return HAM_IGNORED

}
public zp_user_infected_post(id, infector, nemesis) {

setVip()
#if MODE & (1<<0)
if(g_user_privileges[infector] & FLAG_A) {
#else
if(get_user_flags(infector) & VIPACCES) {
#endif
  fm_set_user_health(infector, (pev(infector, pev_health) + get_pcvar_num(g_infecthealth)))
  zp_set_user_ammo_packs(infector, zp_get_user_ammo_packs(infector) + get_pcvar_num(g_infectammo))
}
}
public client_connect(id) {

jumpnum[id] = 0
g_damage[id] = 0.0
dojump[id] = false
#if MODE & (1<<0)
set_flags(id)
if(get_pcvar_num(g_show_vips) == 1 && g_user_privileges[id] & FLAG_A) {
#else
if(get_pcvar_num(g_show_vips) == 1 && get_user_flags(id) & VIPACCES) {
#endif
  new name[100]
  get_user_name(id, name, 100)
  client_printcolor(0, "/g%L", LANG_PLAYER, "VIP_CONNECTED", name)
}
}
#if MODE & (1<<1)
public zp_extra_item_selected(id, item_id)
if(item_id == g_zp_extra_item_number)
  menu_open(id)
public menu_open(id) {
#if MODE & (1<<0)
if(g_user_privileges[id] & FLAG_E)
  vip_menu(id)
else if(g_user_privileges[id] > 0) client_printcolor(id, "/g%s /y%L", CHAT_PREFIX, id, "OFF")
#else
if(get_user_flags(id) & VIPACCES)
  vip_menu(id)
#endif
#if MODE & (1<<0)
else if(get_pcvar_num(g_vip_cost_ammo) != 0)
  buy_meniu(id)
#endif
else client_printcolor(id, "/g%s /y%L", CHAT_PREFIX, id, "NOT_A_VIP")
return ZP_PLUGIN_HANDLED
}

public vip_menu(id)
{
if(g_registered_items_count == 0) {
  client_printcolor(id, "/g%s /y%L", CHAT_PREFIX, id, "OFF")
  return PLUGIN_HANDLED
}
new buttons_string[16], menu_string[31], menu
formatex(menu_string, 30, "\r%L", id, "MENU_TOP")
menu = menu_create(menu_string, "vip_menu_handler")
static i, menu_item[61], team_check, num[3], ammo_packs, check
check = 0
team_check = 0
ammo_packs = zp_get_user_ammo_packs(id)
if(zp_get_user_zombie(id) && !zp_get_user_nemesis(id)) team_check |= FLAG_A
else if(!zp_get_user_zombie(id)) team_check |= FLAG_B
else if(zp_get_user_nemesis(id)) team_check |= FLAG_C
else if(zp_get_user_survivor(id)) team_check |= FLAG_D
for(i=0; i < g_registered_items_count; i++) {
  ArrayGetArray(items_database, i, extra_items)
  if(extra_items[i_team] == 0 || team_check & extra_items[i_team]) {
   formatex(menu_item, 61, "%s \r[%s] %s[%d %L]", extra_items[i_name], extra_items[i_description], ammo_packs < extra_items[i_cost] ? "\r" : "\y", extra_items[i_cost], id, "AMMO")
   formatex(num, 2, "%d", i)
   menu_additem(menu, menu_item, num, 0)
   check++
  }
}
if(check == 0) {
  client_printcolor(id, "/g%s /y%L", CHAT_PREFIX, id, "NO_ITEMS")
  return 1
}
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
formatex(buttons_string, 15, "%L", id, "NEXT")
menu_setprop(menu, MPROP_NEXTNAME, buttons_string)
formatex(buttons_string, 15, "%L", id, "BACK")
menu_setprop(menu, MPROP_BACKNAME, buttons_string)
formatex(buttons_string, 15, "%L", id, "EXIT")
menu_setprop(menu, MPROP_EXITNAME, buttons_string)
menu_display(id, menu, 0)

return 1
}

public vip_menu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
  menu_destroy(menu)
  return PLUGIN_HANDLED
}
new data[6], iName[64], item_id, ammo_packs
new access, callback
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
item_id = str_to_num(data)
ammo_packs = zp_get_user_ammo_packs(id)
ArrayGetArray(items_database, item_id, extra_items)
if(ammo_packs >= extra_items[i_cost]) zp_set_user_ammo_packs(id, ammo_packs - extra_items[i_cost])
else {
  client_printcolor(id, "/g%s %L", CHAT_PREFIX, id, "MISSING_AMMO", extra_items[i_cost]-ammo_packs)
  if(g_menu_close) menu_destroy(menu)
  else vip_menu(id)
  return PLUGIN_HANDLED
}
item_id++
ExecuteForward(g_extra_item_selected, g_forward_return, id, item_id)
if (g_forward_return >= ZV_PLUGIN_HANDLED)
  zp_set_user_ammo_packs(id, ammo_packs)

if(g_menu_close) menu_destroy(menu)
else vip_menu(id)
return PLUGIN_HANDLED
}
#endif
#if MODE & (1<<0) && MODE & (1<<1)
public buy_meniu(id)
{
new buttons_string[16], menu_string[101], menu_item[31], menu
formatex(menu_string, 100, "\r%L", id, "BUY_MENU_TOP", get_pcvar_num(g_vip_cost_ammo), get_pcvar_num(g_vip_buy_time))
menu = menu_create(menu_string, "buy_menu_handler")

formatex(menu_item, 30, "%L", id, "BUY_MENU_TYPE1")
menu_additem(menu, menu_item, "1", 0)
formatex(menu_item, 30, "%L", id, "BUY_MENU_TYPE2")
menu_additem(menu, menu_item, "2", 0)
formatex(menu_item, 30, "%L", id, "BUY_MENU_TYPE3")
menu_additem(menu, menu_item, "3", 0)

menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
formatex(buttons_string, 15, "%L", id, "EXIT")
menu_setprop(menu, MPROP_EXITNAME, buttons_string)
menu_display(id, menu, 0)
}

public buy_menu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
  menu_destroy(menu)
  return PLUGIN_HANDLED
}
new data[6], iName[64], key, ammo_packs
new access, callback
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
key = str_to_num(data)
ammo_packs = zp_get_user_ammo_packs(id)
if(key > 1) {
  if(ammo_packs >= get_pcvar_num(g_vip_cost_ammo)) {
   amx_tempadmin(id, key)
   zp_set_user_ammo_packs(id, ammo_packs - get_pcvar_num(g_vip_cost_ammo))
   client_printcolor(id, "/g%s /y%L", CHAT_PREFIX, id, "BOUGHT_VIP", get_pcvar_num(g_vip_buy_time))
  
  }
  else client_printcolor(id, "/g%s /y%L", CHAT_PREFIX, id, "MISSING_AMMO", get_pcvar_num(g_vip_cost_ammo)-ammo_packs)
}
else {
  nick_buy_meniu(id)
  return PLUGIN_HANDLED
}

menu_destroy(menu)
return PLUGIN_HANDLED
}
public nick_buy_meniu(id)
{
new buttons_string[16], menu_string[151], menu_item[81], menu, client_password[21]
get_user_info(id, amx_password_field_string, client_password, 20)
formatex(menu_string, 150, "\r%L", id, "NICK_BUY_MENU_TOP", client_password)
menu = menu_create(menu_string, "nick_buy_menu_handler")

formatex(menu_item, 80, "%L", id, "NICK_BUY_MENU_TYPE1")
menu_additem(menu, menu_item, "1", 0)
formatex(menu_item, 80, "%L", id, "NICK_BUY_MENU_TYPE2")
menu_additem(menu, menu_item, "2", 0)
formatex(menu_item, 80, "%L", id, "NICK_BUY_MENU_TYPE3", get_pcvar_num(g_vip_cost_ammo) ,get_pcvar_num(g_vip_buy_time))
menu_additem(menu, menu_item, "3", 0)

menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
formatex(buttons_string, 15, "%L", id, "BACK")
menu_setprop(menu, MPROP_EXITNAME, buttons_string)
menu_display(id, menu, 0)

}

public nick_buy_menu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
  buy_meniu(id)
  return PLUGIN_HANDLED
}
new data[6], iName[64]
new access, callback
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
new key = str_to_num(data)
switch(key) {
  case 1: {
   generate_password(id)
   nick_buy_meniu(id)
  }
  case 2: nick_buy_meniu_sec(id)
  case 3: {
   amx_tempadmin(id, 1)
   menu_destroy(menu)
   return PLUGIN_HANDLED
  }
}
return PLUGIN_HANDLED
}
public nick_buy_meniu_sec(id)
{
new menu_string[151], menu_item[51], menu
formatex(menu_string, 150, "\r%L", id, "NICK_BUY_MENU_SEC_TOP")
menu = menu_create(menu_string, "nick_buy_menu_sec_handler")

formatex(menu_item, 50, "%L", id, "EXIT")
menu_additem(menu, menu_item, "1", 0)

menu_setprop(menu, MPROP_EXIT, MEXIT_NEVER)
menu_display(id, menu, 0)
}

public nick_buy_menu_sec_handler(id, menu, item)
{
nick_buy_meniu(id)
}
#endif
public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
if (!get_pcvar_num(g_unlimited_clip)) return
#if MODE & (1<<0)
if (!(g_user_privileges[msg_entity] & FLAG_C)) return
#else
if (!(get_user_flags(msg_entity) & VIPACCES)) return
#endif
if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1) return

static weapon, clip
weapon = get_msg_arg_int(2)
clip = get_msg_arg_int(3)

if (MAXCLIP[weapon] > 2)
{
  set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon])
 
  if (clip < 2)
  {
   static wname[32], weapon_ent
   get_weaponname(weapon, wname, sizeof wname - 1)
   weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)
   fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
  }
}
}
public HUDReset()
setVip()

public setVip()
{
new players[32], pNum
get_players(players, pNum, "a")
for (new i = 0; i < pNum; i++)
{
  new id = players[i]
#if MODE & (1<<0)
  if (g_user_privileges[id] & FLAG_A)
#else
  if (get_user_flags(id) & VIPACCES)
#endif
  {
   message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"))
   write_byte(id)
   write_byte(4)
   message_end()
  }
}
return PLUGIN_HANDLED
}
public print_adminlist(user)
{
new adminnames[33][32]
new message[256]
new contactinfo[256], contact[112]
new id, count, x, len

for(id = 1 ; id <= maxplayers ; id++)
  if(is_user_connected(id))
#if MODE & (1<<0)
   if(g_user_privileges[id] & FLAG_A)
#else
   if(get_user_flags(id) & VIPACCES)
#endif
    get_user_name(id, adminnames[count++], 31)
len = format(message, 255, "%L ", id, "VIP_STATUS")
if(count > 0) {
  for(x = 0 ; x < count ; x++) {
   len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
   if(len > 96 ) {
    client_printcolor(user, "/g%s", message)
    len = format(message, 255, "")
   }
  }
  client_printcolor(user, "/g%s", message)
}
else {
  len += format(message[len], 255-len, "%L ", id, "VIP_STATUS_N")
  client_printcolor(user, "/g%s", message)
}

get_cvar_string("amx_contactinfo", contact, 63)
if(contact[0])  {
  format(contactinfo, 111, "%L ", id, "VIP_STATUS_CON", contact)
  client_printcolor(user, "/g%s", contactinfo)
}

}
public client_disconnect(id)
{
jumpnum[id] = 0
g_damage[id] = 0.0
dojump[id] = false
}
public client_PreThink(id)
{
#if MODE & (1<<0)
if(!is_user_alive(id) || !g_jumps || (!(g_user_privileges[id] & FLAG_<img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />)) return PLUGIN_CONTINUE
#else
if(!is_user_alive(id) || !g_jumps || (!(get_user_flags(id) & MJACCES))) return PLUGIN_CONTINUE
#endif
new nbut = get_user_button(id)
new obut = get_user_oldbutton(id)
if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
{
  if(jumpnum[id] < get_pcvar_num(g_jumps) &&
  ((g_bit & FLAG_D && zp_get_user_nemesis(id)) ||
  (g_bit & FLAG_C && zp_get_user_survivor(id)) ||
  (g_bit & FLAG_A && !zp_get_user_zombie(id)) ||
  (g_bit & FLAG_B && zp_get_user_zombie(id) && !zp_get_user_nemesis(id))))
  {
   dojump[id] = true
   jumpnum[id]++
   return PLUGIN_CONTINUE
  }
}
if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
{
  jumpnum[id] = 0
  return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public client_PostThink(id)
{
#if MODE & (1<<0)
if(!is_user_alive(id) || !get_pcvar_num(g_jumps) || (!(g_user_privileges[id] & FLAG_<img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />)) return PLUGIN_CONTINUE
#else
if(!is_user_alive(id) || !get_pcvar_num(g_jumps) || (!(get_user_flags(id) & MJACCES))) return PLUGIN_CONTINUE
#endif
if(dojump[id] == true)
{
  new Float:velocity[3]
  entity_get_vector(id,EV_VEC_velocity,velocity)
  velocity[2] = random_float(265.0,285.0)
  entity_set_vector(id,EV_VEC_velocity,velocity)
  dojump[id] = false
  return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public ShowMotd(id)
show_motd(id, "vip.txt")
#if MODE & (1<<0)
public reload_vips() {

if(database_holder) ArrayDestroy(database_holder)
database_holder = ArrayCreate(database_items)
new configsDir[64]
get_configsdir(configsDir, 63)
format(configsDir, 63, "%s/vips.ini", configsDir)

new File=fopen(configsDir,"r");

if (File)
{
  static Text[512], Flags[32], AuthData[50], Privileges_Flags[32], Password[50]
  while (!feof(File))
  {
   fgets(File,Text,sizeof(Text)-1);
  
   trim(Text);
  
   // comment
   if (Text[0]==';')
   {
    continue;
   }
  
   Flags[0]=0;
   AuthData[0]=0;
   Privileges_Flags[0]=0;
   Password[0]=0;
  
   // not enough parameters
   if (parse(Text,AuthData,sizeof(AuthData)-1,Password,sizeof(Password)-1,Privileges_Flags,sizeof(Privileges_Flags)-1,Flags,sizeof(Flags)-1) < 2)
   {
    continue;
   }
   vips_database[auth] = AuthData
   vips_database[password] = Password
   vips_database[accessflags] = read_flags(Privileges_Flags)
   vips_database[flags] = read_flags(Flags)
   ArrayPushArray(database_holder, vips_database)
  }
 
  fclose(File);
}
else log_amx("Error: vips.ini file doesn't exist")
}
#endif
#if MODE & (1<<0) && MODE & (1<<1)
public check_date()
{
new todaysmonth[32]
new todaysday[32]
new todaysyear[32]
get_time("%m",todaysmonth,31)
get_time("%d",todaysday,31)
get_time("%Y",todaysyear,31)
new todaysdaynum = str_to_num(todaysday)
new todaysmonthnum = str_to_num(todaysmonth)
new todaysyearnum = str_to_num(todaysyear)
new alltogether[200]
format(alltogether,199,"m%dd%dy%d",todaysmonthnum,todaysdaynum,todaysyearnum)
new configdir[200]
get_configsdir(configdir,199)
new configfile1[200]
format(configfile1,199,"%s/vips.ini",configdir)

new text[512], len
new pnum = file_size(configfile1,1)
for(new i = 1; i < pnum; i++)
{
  read_file(configfile1, i, text, 511, len)
  if ( contain(text, alltogether) != -1 )
  {
   DeleteLine(configfile1, i)
  }
}
return PLUGIN_HANDLED
}
public amx_tempadmin(id, type)
{
new authid[31], ip[31], name[51], client_password[21], p_flags[21]
get_pcvar_string(g_vip_buy_flags, p_flags, 20)
get_user_authid(id, authid, 30)
get_user_ip(id, ip, 30, 1)
get_user_name(id, name, 50)
get_user_info(id, amx_password_field_string, client_password, 20)
new todaysmonth[32]
new todaysday[32]
new todaysyear[32]
get_time("%m",todaysmonth,31)
get_time("%d",todaysday,31)
get_time("%Y",todaysyear,31)
new day = str_to_num(todaysday)
months = str_to_num(todaysmonth)
years = str_to_num(todaysyear)
days = day + get_pcvar_num(g_vip_buy_time)

if(get_pcvar_num(g_vip_buy_time) == 0 || get_pcvar_num(g_vip_buy_time)>=900)
{
  new instertintovips[200]
  switch(type) {
   case 1: formatex(instertintovips,199,"^"%s^" ^"%s^" ^"%s^" ^"b^"",name,client_password,p_flags)
   case 2: formatex(instertintovips,199,"^"%s^" ^"^" ^"%s^" ^"ce^"",authid,p_flags)
   case 3: formatex(instertintovips,199,"^"%s^" ^"^" ^"%s^" ^"de^"",ip,p_flags)
  }
  new configdir[200]
  get_configsdir(configdir,199)
  new configfile1[200]
  format(configfile1,199,"%s/vips.ini",configdir)
  write_file(configfile1,instertintovips,-1)
  server_cmd("amx_reloadvips")
  set_task(1.0, "set_flags", id)
  return PLUGIN_HANDLED
}
switch(months) {
  case 1: {
   if(days>31)
   {
    thirtyone(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 2: {
   if(days>28)
   {
    february(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 3: {
   if(days>31)
   {
    thirtyone(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 4: {
   if(days>30)
   {
    thirty(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 5: {
   if(days>31)
   {
    thirtyone(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 6: {
   if(days>30)
   {
    thirty(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 7: {
   if(days>31)
   {
    thirtyone(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 8: {
   if(days>31)
   {
    thirtyone(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 9: {
   if(days>30)
   {
    thirty(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 10: {
   if(days>31)
   {
    thirtyone(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 11: {
   if(days>30)
   {
    thirty(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
  case 12: {
   if(days>31)
   {
    december(id, type)
    return PLUGIN_HANDLED
   }
   else
   {
    makenewdate(id, type)
    return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
  }
}
return PLUGIN_HANDLED
}
public makenewdate(id, type)
{
new alltogether[200], authid[31], ip[31], name[51], client_password[21], p_flags[21]
get_pcvar_string(g_vip_buy_flags, p_flags, 20)
get_user_authid(id, authid, 30)
get_user_ip(id, ip, 30, 1)
get_user_name(id, name, 50)
get_user_info(id, amx_password_field_string, client_password, 20)
format(alltogether,199,"m%dd%dy%d",months,days,years)
new instertintovips[200]
switch(type) {
  case 1: formatex(instertintovips,199,"^"%s^" ^"%s^" ^"%s^" ^"b^"; Exp: %s",name,client_password,p_flags,alltogether)
  case 2: formatex(instertintovips,199,"^"%s^" ^"^" ^"%s^" ^"ce^"; Exp: %s",authid,p_flags,alltogether)
  case 3: formatex(instertintovips,199,"^"%s^" ^"^" ^"%s^" ^"de^"; Exp: %s",ip,p_flags,alltogether)
}
new configdir[200]
get_configsdir(configdir,199)
new configfile1[200]
format(configfile1,199,"%s/vips.ini",configdir)
write_file(configfile1,instertintovips,-1)
server_cmd("amx_reloadvips")
set_task(1.0, "set_flags", id)
return PLUGIN_HANDLED
}
public december(id, type)
{
if(days>31)
{
  days = days - 31
  months = 1
  years = years + 1
  select_days(id, type)
}
else
{
  makenewdate(id, type)
}
return PLUGIN_HANDLED
}
public thirtyone(id, type)
{
if(days>31)
{
  days = days - 31
  months = months + 1
  select_days(id, type)
}
else
{
  makenewdate(id, type)
}
return PLUGIN_HANDLED
}
public thirty(id, type)
{
if(days>30)
{
  days = days - 30
  months = months + 1
  select_days(id, type)
}
else
{
  makenewdate(id, type)
}
return PLUGIN_HANDLED
}
public february(id, type)
{
if(days>28)
{
  days = days - 28
  months = 3
  select_days(id, type)
}
else
{
  makenewdate(id, type)
}
return PLUGIN_HANDLED
}
public newyear(id, type)
{
if(days>31)
{
  days = days - 31
  years = years + 1
  months = 1
  select_days(id, type)
}
else
{
  makenewdate(id, type)
}
return PLUGIN_HANDLED
}
public select_days(id, type)
{
switch(months) {
  case 1, 4, 5, 7, 8, 10: thirtyone(id, type)
  case 2: february(id, type)
  case 3, 6, 9, 11: thirty(id, type)
  case 12: newyear(id, type)
}
return PLUGIN_HANDLED
}
DeleteLine( const szFilename[ ], const iLine )
{
new iFile = fopen( szFilename, "rt" );
if( !iFile )
{
  return;
}
static const szTempFilename[ ] = "delete_line.txt";
new iTempFile = fopen( szTempFilename, "wt" );
   
new szData[ 256 ], iLineCount, bool:bReplaced = false;
while( !feof( iFile ) )
{
  fgets( iFile, szData, 255 );
	   
  if( iLineCount++ == iLine )
  {
   bReplaced = true;
  }
  else
  {
   fputs( iTempFile, szData );
  }
}
   
fclose( iFile );
fclose( iTempFile );
   
if( bReplaced )
{
  delete_file( szFilename );
	   
  while( !rename_file( szTempFilename, szFilename, 1 ) ) { }
}
else
{
  delete_file( szTempFilename );
}
}
#endif
stock fm_set_user_health(id, health)
{
(health > 0) ? set_pev(id, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, id);
}
stock client_printcolor(const id, const input[], any:...)
{

new iCount = 1, iPlayers[32]

static szMsg[191]
vformat(szMsg, charsmax(szMsg), input, 3)

replace_all(szMsg, 190, "/g", "^4") // green txt
replace_all(szMsg, 190, "/y", "^1") // orange txt
replace_all(szMsg, 190, "/ctr", "^3") // team txt
replace_all(szMsg, 190, "/w", "^0") // team txt

if(id) iPlayers[0] = id
else get_players(iPlayers, iCount, "ch")
 
for (new i = 0; i < iCount; i++)
{
  if (is_user_connected(iPlayers[i]))
  {
   message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])
   write_byte(iPlayers[i])
   write_string(szMsg)
   message_end()
  }
}
}
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {}

return entity;
}
stock fm_set_weapon_ammo(entity, amount)
{
set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);
}
#if MODE & (1<<0)
public set_flags(id) {

static authid[31], ip[31], name[51], index, client_password[31], size, log_flags[11]
get_user_authid(id, authid, 30)
get_user_ip(id, ip, 30, 1)
get_user_name(id, name, 50)
get_user_info(id, amx_password_field_string, client_password, 30)

g_user_privileges[id] = 0
size = ArraySize(database_holder)
for(index=0; index < size ; index++) {
  ArrayGetArray(database_holder, index, vips_database)
  if(vips_database[flags] & FLAG_D) {
   if(equal(ip, vips_database[auth])) {
    if(!(vips_database[flags] & FLAG_E)) {
	 if(equal(client_password, vips_database[password]))
	  g_user_privileges[id] = vips_database[accessflags]
	 else if(vips_database[flags] & FLAG_A) {
	  server_cmd("kick #%d ^"%L^"", get_user_userid(id), id, "INV_PAS")
	  break
	 }
    }
    else g_user_privileges[id] = vips_database[accessflags]
    get_flags(vips_database[accessflags], log_flags, 10)
    log_amx("%L",LANG_PLAYER, "AUTHORISED", name, authid, ip, log_flags)
    break
   }
  }
  else if(vips_database[flags] & FLAG_C) {
   if(equal(authid, vips_database[auth])) {
    if(!(vips_database[flags] & FLAG_E)) {
	 if(equal(client_password, vips_database[password]))
	  g_user_privileges[id] = vips_database[accessflags]
	 else if(vips_database[flags] & FLAG_A) {
	  server_cmd("kick #%d ^"%L^"", get_user_userid(id), id, "INV_PAS")
	  break
	 }
    }
    else g_user_privileges[id] = vips_database[accessflags]
    get_flags(vips_database[accessflags], log_flags, 10)
    log_amx("%L",LANG_PLAYER, "AUTHORISED", name, authid, ip, log_flags)
    break
   }
  }
  else {
   if(vips_database[flags] & FLAG_K) {
    if((vips_database[flags] & FLAG_B && contain(name, vips_database[auth]) != -1) || equal(name, vips_database[auth])) {
	 if(!(vips_database[flags] & FLAG_E)) {
	  if(equal(client_password, vips_database[password]))
	   g_user_privileges[id] = vips_database[accessflags]
	  else if(vips_database[flags] & FLAG_A) {
	   server_cmd("kick #%d ^"%L^"", get_user_userid(id), id, "INV_PAS")
	   break
	  }
	 }
	 else g_user_privileges[id] = vips_database[accessflags]
	 get_flags(vips_database[accessflags], log_flags, 10)
	 log_amx("%L",LANG_PLAYER, "AUTHORISED", name, authid, ip, log_flags)
	 break
    }
   }
   else {
    if((vips_database[flags] & FLAG_B && containi(name, vips_database[auth]) != -1) || equali(name, vips_database[auth])) {
	 if(!(vips_database[flags] & FLAG_E)) {
	  if(equal(client_password, vips_database[password]))
	   g_user_privileges[id] = vips_database[accessflags]
	  else if(vips_database[flags] & FLAG_A) {
	   server_cmd("kick #%d ^"%L^"", get_user_userid(id), id, "INV_PAS")
	   break
	  }
	 }
	 else g_user_privileges[id] = vips_database[accessflags]
	 get_flags(vips_database[accessflags], log_flags, 10)
	 log_amx("%L",LANG_PLAYER, "AUTHORISED", name, authid, ip, log_flags)
	 break
    }
   }
  }
}
}
#endif
#if MODE & (1<<0) && MODE & (1<<1)
stock generate_password(id) {

new password_holder[31]
formatex(password_holder, 30, "%d%d%d%d%d", random(9), random(9), random(9), random(9), random(9))
client_cmd(id, "setinfo %s %s", amx_password_field_string, password_holder)
}
#endif
#if MODE & (1<<0)
public native_zv_get_user_flags(id)
return g_user_privileges[id]
#endif
#if MODE & (1<<1)
public native_zv_register_extra_item(const item_name[], const item_discription[], item_cost, item_team)
{
  param_convert(1)
  param_convert(2)
  copy(extra_items[i_name], 30, item_name)
  copy(extra_items[i_description], 30, item_discription)
  extra_items[i_cost] = item_cost
  extra_items[i_team] = item_team
  ArrayPushArray(items_database, extra_items)
  g_registered_items_count++
 
  return g_registered_items_count
}
#endif

Onyke (18.02.2012 21:25):
Kod w postach(np. źródło pluginu) umieszczaj w odpowiednich tagach(code/php/spoiler itp) a powyżej 200 linijek tylko w załączniku.

  • +
  • -
  • -1
Zarząd Cs-Baraki.pl Zapraszam serdecznie
Zarzad:
Washi * Agata * Kysy * oPALEJRO * MarWit
Zapraszamy na www.Cs-Baraki.pl

#2 ImSpY

    Zaawansowany

  • Użytkownik

Reputacja: 27
Życzliwy

  • Postów:97
  • Lokalizacja:localhost
Offline

Napisano 17.02.2012 13:31

Po co usuwać? Nie prościej zmienić cvar?
zp_vip_unlimited_ammo 0

Użytkownik ImSpY edytował ten post 17.02.2012 13:32

  • +
  • -
  • 1

#3 ZarzadCSB

    Profesjonalista

  • Autor tematu
  • Użytkownik

Reputacja: 8
Nowy

  • Postów:207
  • GG:
  • Imię:Watashi
  • Lokalizacja:reklama
Offline

Napisano 17.02.2012 15:02

W pluginie jak zmienie to nic sie nie dzieje.
Dodaje do amxx.cfg
zp_vip_unlimited_ammo "0"
Też nic

Komenda na serwie
amx_cvar zp_vip_unlimited_ammo 0

Działa ale tylko do zmiany mapy

HELP :)

Dobra wyrypałem już wszystkie funkcje dot. tego i śmiga :)

Użytkownik baned edytował ten post 17.02.2012 14:49

  • +
  • -
  • 0
Zarząd Cs-Baraki.pl Zapraszam serdecznie
Zarzad:
Washi * Agata * Kysy * oPALEJRO * MarWit
Zapraszamy na www.Cs-Baraki.pl

#4 Onyke

    Godlike

  • Przyjaciel

Reputacja: 705
Guru

  • Postów:2178
Offline

Napisano 18.02.2012 21:25

Wiadomość wygenerowana automatycznie


Ten temat został zamknięty przez moderatora.

Powód: Pomoc udzielona

Jeśli się z tym nie zgadzasz, Dołączona grafika raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.


Z pozdrowieniami,
Zespół AMXX.PL
  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych