How do we access the struct property as parameter (FPlayerChances:CameraShakeChance)?
PHP Code:
bool:Game_CanUseAbility(client,FPlayerChances:index)
{
new Float:fChance = GetRandomFloat(0.0, 1.0);
if(FPlayerChances[ client ][ index ] >= fChance) //issue here
{
return true;
}
return false;
}
bool:Game_ShakeVictimOnAttack(victim,attacker)
{
new Float:fShakeAmplitude = FPlayerProperties[ attacker ].CameraShake;
if(fShakeAmplitude > 0.0 && Game_CanUseAbility(attacker,FPlayerChances:CameraShakeChance)) //issue
{
if(!Game_IsAbilityCoolingDown(attacker,EPlayerCooldowns:CameraShakeCooldown,ABILITY_COOLDOWN)) //issue
{
Effect_Shake(victim,fShakeAmplitude,ABILITY_COOLDOWN);
return true;
}
}
return false;
}