Jump to content
blazi10

Daily quest error

Recommended Posts

On 24/10/2016 at 0:37 PM, Ximboliex said:

You Need serialize.lua run in your server

 


WeekFolder = "scripts/addons/weekprize/"
 
function CheckWeek(role)
    if exists_file(GetResPath(WeekFolder..""..GetCharID(role)..".txt")) == false then
        table.save({Week = -1,Registered = 0},GetResPath(WeekFolder..""..GetCharID(role)..".txt"),"a")
    end
    local DailyPrize = table.load(GetResPath(WeekFolder..""..GetCharID(role)..".txt"),"r")
    local NowWeek = GetNowWeek()
    if DailyPrize.Week ~= NowWeek then
        GiveWeekPrize(role)
    else
        HelpInfo(role,0,"You already have received your award today, come back tomorrow to receive again.")
    return
    end
end
 
 
function GiveWeekPrize(role)
    local DailyPrize = table.load(GetResPath(WeekFolder..""..GetCharID(role)..".txt"),"r")
    local NowWeek = GetNowWeek()
    if DailyPrize.Registered >= 6 and NowWeek == 0 then
    GiveItem(role,0,xxxx,5,1)       
    DailyPrize.Week = NowWeek
    DailyPrize.Registered = -1
    table.save(DailyPrize,GetResPath(WeekFolder..""..GetCharID(role)..".txt"),"w")
    HelpInfo(role,0,"Congratulations, you collected all the daily prizes and obtained 5 Forbidden Keys")
    else
    local WeekPrize = {}
    WeekPrize[0] = xxx         
    WeekPrize[1] = xxx             
    WeekPrize[2] = xxx                
    WeekPrize[3] = xxx            
    WeekPrize[4] = xxx            
    WeekPrize[5] = xxx            
    WeekPrize[6] = xxx        
    GiveItem(role,0,WeekPrize[NowWeek],1,1)
    DailyPrize.Week = NowWeek
    DailyPrize.Registered = DailyPrize.Registered + 1
    table.save(DailyPrize,GetResPath(WeekFolder..""..GetCharID(role)..".txt"),"w")
    HelpInfo(role,0,"You received "..GetItemName(WeekPrize[NowWeek]).."! You can obtain another award again tomorrow.")
    end
end

*************************************
in NpcSdk: ( under  JumpPage )

    elseif item.func == CheckWeek then
        return CheckWeek(character)

************************************

npc function;

function blabla()
        Talk(1,"Test 1 2 3")
        Text(1,"Daily Prize",CheckWeek)
end

-By @Yomazu

 

TRY THIS!!


xbx3.png

Share this post


Link to post
Share on other sites

All put In missionsdk

 

 

create a carpet called "weekprize" in the direction of WeekFolder

Ex:

WeekFolder= "scripts/weekfolder" make a carpet in scripts called weekfolder


xbx3.png

Share this post


Link to post
Share on other sites
6 hours ago, Ximboliex said:

All put In missionsdk

 

 

create a carpet called "weekprize" in the direction of WeekFolder

Ex:

WeekFolder= "scripts/weekfolder" make a carpet in scripts called weekfolder

eh... not working ...

I'm Giving up... All what is Daily, weekly etc is not working :(:( 

now i see... 1.36 files= SH1T!

Edited by blazi10

Share this post


Link to post
Share on other sites

Ximboliex  i Dont know if it is possible... but you can help me with daily quest? Daily reward is good idea too, but i want to work for something... Can be with serialize...

or say here step by step how install This daily ,maybe i did wrong something.

Edited by blazi10

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...