Jump to content

Have someone this function?


Recommended Posts

  • Premium

    int horse_is_summon(lua_State* L)
    {
        LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();

        if (NULL != ch)
        {
            lua_pushboolean(L, (ch->GetHorse() != NULL) ? true : false);
        }
        else
        {
            lua_pushboolean(L, false);
        }

        return 1;
    }

Link to comment
Share on other sites

  • Active Member

@WeedHex How can I use it in quest? I tried to use it like:

				if number(1, 100) <= horse_summon.get_horse_summon_prob_pct() then
					horse.summon()
					notice("You successfuly summoned your horse.")
				elseif horse_is_summon() == 1 then
					notice("Horse is already summoned.")
					return
				elseif horse_is_summon() <=0 then
					notice("Horse wasn't summoned.")
				end

But it doesn't work.

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Premium
if true == horse.is_summon() then
	notice("Horse is already summoned.")
else
	if number(1, 100) <= horse_summon.get_horse_summon_prob_pct() then
		horse.summon()
		notice("You successfuly summoned your horse.")
	else
		notice("Horse wasn't summoned.")
	end	
end

You have to use like this.

  • Love 2
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.