View Single Post
Author Message
JoshGomez
Member
Join Date: Apr 2006
Location: Sweden
Old 12-02-2022 , 07:25   Enum struct, how do we access the struct property as parameter?
Reply With Quote #1

How do we access the struct property as parameter (FPlayerChances:CameraShakeChance)?

PHP Code:
bool:Game_CanUseAbility(client,FPlayerChances:index)
{
    new 
Float:fChance GetRandomFloat(0.01.0);
    if(
FPlayerChancesclient ][ index ] >= fChance//issue here
    
{
        return 
true;
    }
    
    return 
false;
}

bool:Game_ShakeVictimOnAttack(victim,attacker)
{
    new 
Float:fShakeAmplitude FPlayerPropertiesattacker ].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;


Last edited by JoshGomez; 12-02-2022 at 07:27.
JoshGomez is offline