PHP Code:
new Float:g_PlayerZombieInfo[33][2]
...
public TurnZombie(id)
{
...
new Float:ZbStun; ZbStun = ArrayGetCell(ZombieStunResist, g_CurrentClass[id]) //Registered as 1.2
new Float:ZbKnockback; ZbKnockback = ArrayGetCell(ZombieKnockback, g_CurrentClass[id])
g_PlayerZombieInfo[id][INFO_STUN] = ZbStun
g_PlayerZombieInfo[id][INFO_KB] = ZbKnockback
...
}
public TakeDamagePost(victim, inflictor, attacker, Float:fDamage, Damagetype)
{
painshock = get_pdata_float(victim, OFFSET_PAINSHOCK)
client_print(0, print_chat, "(DEBUG) Painshock Pre Post: %f %f", painshock, g_PlayerZombieInfo[victim][INFO_STUN]) //Printed: (DEBUG) Painshock Pre Post: 0.500000 1.20000
static Float:new_painshock;
new_painshock = painshock * g_PlayerZombieInfo[victim][INFO_STUN]
client_print(0, print_chat, "(DEBUG) Painshock Post Post: %f", new_painshock) //Printed: (DEBUG) Painshock Post Post: 533515456.00000
set_pdata_float(victim, OFFSET_PAINSHOCK, painshock)
}
puclic Native_Register_Class()
{
...
ArrayPushCell(ZombieStunResist, get_param_f(6))
...
}
I tried to replace g_PlayerZombieInfo[victim][INFO_STUN] with 1.2 ajd the calculation give correct answer: 0.6
I don't know what I did wrong
Solved
PHP Code:
puclic Native_Register_Class()
{
...
ArrayPushCell(ZombieStunResist, get_param_f(6))
...
}
=>
PHP Code:
puclic Native_Register_Class()
{
new Float:Stun; Stun = get_param_f(6)
...
ArrayPushCell(ZombieStunResist, Stun)
...
}
__________________