[HELP] AnimationOnLevel

How can I substitute if (player->GetLevel() == #) to automatically sense each level up.

[CODE]
/************************************

  •     AnimationOnLevel          *
    
  •                               *
    
  •  Edit By DemonicRealms        *
    
  •                               *
    
  •     RealityNetGaming          *
    

*/

class AnimationOnLevel : public PlayerScript
{
public:
AnimationOnLevel() : PlayerScript(“AnimationOnLevel”) { }

void OnLevelChanged(Player* player, unit8 oldLevel)
{
if (player->GetLevel() == 2)
player->CastSpell(player, 127933);

if (player->GetLevel() == 3)
player->CastSpell(player, 127933);
}

};

void AddSC_AnimationOnLevel()
{
new AnimationOnLevel;
}[/CODE]

So basically every time the player levels, you want to cast the spell?
Dont make any if check… Just do the spellcast, once if that wasnt clear.

Exactly.

So I should just do player[COLOR=rgb(102,102,0)]->[COLOR=rgb(102,0,102)]CastSpell[COLOR=rgb(102,102,0)](player[COLOR=rgb(102,102,0)], [COLOR=rgb(0,102,102)]127933[COLOR=rgb(102,102,0)]);?

yeah…

try it

Why no simply script the already existing spell?