s1lentq / reapi

AMX Mod X module, using API regamedll & rehlds
GNU General Public License v3.0
161 stars 103 forks source link

m_iClientHealth & m_iAccount no HUD update on client #57

Closed jesuspunk closed 7 years ago

jesuspunk commented 7 years ago

При отправки данных set_member и получение их, меняются данные на игроке, на клиенте же HUD не меняется, так задумано? Так же при изменение hp через set_entvar(id,var_health,iHp+1.0),то при получение его через get_member(id,m_iClientHealth) не будет отображено добавленное, и опять же разные типы данных если через set_entvar то float, если через set_member то integer.

код для теста примитивный:

#include <amxmodx>
#include <cstrike>
#include <reapi>

public plugin_init() {
  register_plugin("reapitest", "1", "111");
  register_clcmd( "say /retest2", "retest2" )
}

public retest2(id)
{
  cs_set_user_money(id,9999)
  new Float:iHp = Float:get_entvar(id,var_health)
  new Float:iArmor = Float:get_entvar(id,var_armorvalue)
  set_entvar(id,var_health,iHp+1.0)
  set_entvar(id,var_armorvalue,iArmor+1)
  new iHp2 = get_member(id,m_iClientHealth)
  client_print(id,print_console,"%d",iHp2)
  set_member(id,m_iClientHealth,iHp2-15)
  iHp2 = get_member(id,m_iClientHealth)
  client_print(id,print_console,"%d",iHp2) 
}
jesuspunk commented 7 years ago

Ok, sorry for give money i found rg_add_account

WPMGPRoSToTeMa commented 7 years ago

m_iClientHealth is just storing last sent health via Health usermsg, gamedll compares current health value with m_iClientHealth in PreThink and gamedll sends new health if they aren't equal (and updates m_iClientHealth of course). Why do you need m_iClientHealth?

jesuspunk commented 7 years ago

@WPMGPRoSToTeMa need for make regeneration hp of player and not work with float data of set_entvar(id,var_health). Ok thanks. I'm litle understand now how it work.