No bo mi zależy właśnie na tym aby czas był dokładny co do tego float. Spróbuję dam znać czy działa.
(Nie zaczyna się zdania od "No bo"
)
OK mam ogólnie problem z pluginem:
L 12/17/2011 - 10:44:20: [HAMSANDWICH] Failed to retrieve classtype for "weapon_smokegren", hook for "weaponItemDeployPost" not active.
L 12/17/2011 - 10:44:20: [AMXX] Displaying debug trace (plugin "funkcja_reloadu.amxx")
L 12/17/2011 - 10:44:20: [AMXX] Run time error 10: native error (native "RegisterHam")
L 12/17/2011 - 10:44:20: [AMXX] [0] funkcja_reloadu.sma::plugin_init (line 36)
Korzystam z kodu darka na reload
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#define TASK_RELOAD 7193
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "DarkGL"
const NOCLIP_WPN_BS = ((1<<2)|(1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))
const SHOTGUNS_BS = ((1<<CSW_M3)|(1<<CSW_XM1014))
// weapons offsets
const m_pPlayer = 41
const m_iId = 43
const m_fInReload = 54
const m_flNextAttack = 83
stock const Float:g_fDelay[CSW_P90+1] = {
0.00, 2.70, 0.00, 2.00, 0.00, 0.55, 0.00, 3.15, 3.30, 0.00, 4.50,
2.70, 3.50, 3.35, 2.45, 3.30, 2.70, 2.20, 2.50, 2.63, 4.70,
0.55, 3.05, 2.12, 3.50, 0.00, 2.20, 3.00, 2.45, 0.00, 3.40
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
new szWeapon[17]
for(new i = 1; i <= CSW_P90; i++)
{
if( get_weaponname(i, szWeapon, charsmax(szWeapon)) && RegisterHam(Ham_Item_Deploy,szWeapon,"weaponItemDeployPost",1) && !(NOCLIP_WPN_BS & (1<<i)))
{
if( !(SHOTGUNS_BS & (1<<i)) )
{
RegisterHam(Ham_Weapon_Reload, szWeapon, "weaponReloadPost", 1)
}
}
}
}
public weaponReloadPost(iEnt)
{
if( get_pdata_int(iEnt, m_fInReload, 4) )
{
new id = get_pdata_cbase(iEnt, m_pPlayer, 4)
new Float:fDelay = g_fDelay[get_pdata_int(iEnt, m_iId, 4)]
remove_task(id);
createBarTime(id, fDelay)
set_task(fDelay,"reloadEnd",id+TASK_RELOAD);
}
}
public reloadEnd(id){
if(!is_user_alive(id)) return PLUGIN_CONTINUE;
client_print(id, print_center, "Reload skaczany")
return PLUGIN_CONTINUE;
}
public weaponItemDeployPost(iEnt){
remove_task(get_pdata_cbase(iEnt, m_pPlayer, 4)-TASK_RELOAD);
}
stock createBarTime(id, Float:czas, startprogress = 0){
static barTime2;
if(!barTime2) barTime2 = get_user_msgid("BarTime2");
message_begin( id ? MSG_ONE : MSG_ALL, barTime2, _, id)
write_short( _:czas );
write_short( startprogress );
message_end();
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
linijka 36 to
if( get_weaponname(i, szWeapon, charsmax(szWeapon)) && RegisterHam(Ham_Item_Deploy,szWeapon,"weaponItemDeployPost",1) && !(NOCLIP_WPN_BS & (1<<i)))
Użytkownik Jak się nazwać edytował ten post 17.12.2011 10:49
Pisze na zamówienie statystyki pod nvault. GG: 15600964