Jump to content
  • 0

About Hourly Points Event


Eross

Question


  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.09
  • Content Count:  377
  • Reputation:   12
  • Joined:  04/05/20
  • Last Seen:  

Hi ! I just want to ask if there is an hourly points system like this that wont hault even if I reloadscript ??? Also I tried adding gepard settings ...I dont know if my modification is right. I dont know who is the author of this script, a friend just gave this to me ... Thankyou !

 

Quote

-    script    hangoutpoints    FAKE_NPC,{
 
OnInit:
    set .Gepard,0;
    announce "[Hang Out Reward System]: Hang out reward system has been reloaded, please relog again to get more points.", bc_all;
 
    .point_name$ = "Hango Out Points";
    .point_amt = 1;    // Normal points gained.
    .dlimit = 900;    // Stop points if afk greater then in seconds. 600s = 10 minutes //43200
    .enable = 1;
    .level = 30;
    .online_time = 1800; // One hour = 3600 seconds
 
    bindatcmd "hoinfo", "hangoutpoints::OnAtcommand", 0, 100;
    bindatcmd "hopoints", "hangoutpoints::OnCheckPoints", 0, 100;
    end;
 
OnPCLoginEvent:
    /*if (.Gepard == 1) {    //GEPARD SHIELD ID CHECKER
        query_sql("SELECT last_unique_id FROM `login` WHERE account_id = "+getcharid(3)+"", .@UniqueId$);
        query_sql("SELECT account_id FROM `login` WHERE last_unique_id = '"+.@UniqueId$+"'", .@CuentaId);
        set .@error,getcharid(3,strcharinfo(0));
        
        for(set .@i ,0;.@i<getarraysize(.@CuentaId);set .@i,.@i+1) {
            if(attachrid(.@CuentaId[.@i])) {
                if (.@CuentaId == 2000001) {
                    set .@j,0;
                } 
                else {
                        set .@j,.@j+1;
                }
            }    
        }
        detachrid;
    
        attachrid .@error;
        if(.@j > 1) {
            #acctick += @idle_time; // Add idle time
            #idle = 1;        
            dispbottom "The hang out reward system haulted because you were loggedin with same Gepard ID.";
            end;
        }
    }*/        
    if (BaseLevel >= .level)
    {
        #idle = 0;
        @backup_time = 0;
 
        if (!#acctick || #acctick > .online_time)
            #acctick = gettimetick(2) + .online_time;
        else
            #acctick += gettimetick(2);
 
        while(.enable)
        {
            @idle_time = checkidle();
 
            if (checkvending() >= 1 || @idle_time >= .dlimit) //  checkchatting() == 1 ||
            {
                #acctick += @idle_time; // Add idle time
                #idle = 1;
                dispbottom "The hang out reward system haulted because you were vending, chatting, or idle.";
            }
            else
            {
                sleep2 1000;
 
                @backup_time = .@time_left = #acctick - gettimetick(2);
 
                if (.@time_left <= 0) {
                
                    if (vip_status(1)) {
                        #HANGOUTPOINTS += .point_amt + 1;
                        #acctick = gettimetick(2) + .online_time;
                         dispbottom "[Hang Out Reward System]: Gained " + .point_amt + " " + .point_name$ + " +1 " + .point_name$ + " [Vip Bonus]. Stay online and gain more points.";

                    }
                    else {
                    #HANGOUTPOINTS += .point_amt;
                    #acctick = gettimetick(2) + .online_time;
                    dispbottom "[Hang Out Reward System]: Gained " + .point_amt + " " + .point_name$ + ". Total " + #HANGOUTPOINTS + " Hang out Points. Stay online to gain more points.";
                    }
                }
                else
                {
                    .@time_left = .online_time - .@time_left;
                    .@Time$ = "";
                    .@Minutes = .@time_left / 60;
                    .@time_left -= (.@Minutes * 60);
 
                    if (.@Minutes > 1)
                        .@Time$ += .@Minutes + " minutes, ";
                    else if (.@Minutes > 0)
                        .@Time$ += .@Minutes + " minute, ";
 
                    if (.@time_left > 1 || .@time_left == 0)
                        .@Time$ += .@time_left + " seconds";
                    else if (.@time_left == 1)
                        .@Time$ += .@time_left + " second";
 
                    if (.@Minutes == 15 && .@time_left == 0 || .@Minutes == 30 && .@time_left == 0 || .@Minutes == 45 && .@time_left == 0)
                        dispbottom "[Hang Out Reward System]: You spend a total of [" + .@Time$ + "] playing.";
                }
            }
 
            if (#idle)
                break;
        }
    }
    end;
 
OnPCLogoutEvent:
    // BackUP online time
    if (BaseLevel >= .level)
    {
        if (@backup_time)
            #acctick = @backup_time;
    }
    end;
OnCheckPoints: 
    dispbottom "[Hang Out Reward System]: You have a total of ["+ #HANGOUTPOINTS +"] Hang Out Points.",0xRRGGBB;
    end;
OnAtcommand:
    if (BaseLevel >= .level)
    {
        if (#idle)
        {
            .@Time$ = "";
            .@Minutes = @idle_time / 60;
            .@time_left = @idle_time - (.@Minutes * 60);
 
            if (.@Minutes > 1)
                .@Time$ += .@Minutes + " minutes, ";
            else if (.@Minutes > 0)
                .@Time$ += .@Minutes + " minute, ";
 
            if (.@time_left > 1 || .@time_left == 0)
                .@Time$ += .@time_left + " seconds";
            else if (.@time_left == 1)
                .@Time$ += .@time_left + " second";
 
            //dispbottom "[Hang Out Reward System]: You been idle for " + .@Time$ + ". Please relog again.",0xRRGGBB;
            dispbottom "[Hang Out Reward System]: You've been idle/vending/chatting or logged in dual account. Please relog again.",0xRRGGBB;
        }
        else
        {
            .@time_left = @backup_time;
            .@Time$ = "";
            .@Minutes = .@time_left / 60;
            .@time_left -= (.@Minutes * 60);
 
            if (.@Minutes > 1)
                .@Time$ += .@Minutes + " minutes, ";
            else if (.@Minutes > 0)
                .@Time$ += .@Minutes + " minute, ";
 
            if (.@time_left > 1 || .@time_left == 0)
                .@Time$ += .@time_left + " seconds";
            else if (.@time_left == 1)
                .@Time$ += .@time_left + " second";
 
            dispbottom "[Hang Out Reward System]: You have [" + .@Time$ + "] left in able to gain a hang out points.",0xRRGGBB;
        }
    }
    end;
}
 

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  75
  • Reputation:   11
  • Joined:  12/16/11
  • Last Seen:  

The problem if you reloadscript, the script reset. So OnPCLoginEvent won't execute after they relog. You should not reloadscript during production, you can reload specific scripts instead all,

@loadnpc <path>
Loads an NPC script by path.
Example:
@loadnpc npc/custom/jobmaster.txt
---------------------------------------
@unloadnpc <npc name>
Unloads an NPC.
Example:
@unloadnpc Job Master
---------------------------------------
@unloadnpcfile <path>
Unloads all NPCs in a file.
Example:
@unloadnpcfile npc/custom/jobmaster.txt
---------------------------------------
@reloadnpcfile <path>
Unloads and loads an NPC.
Same as @unloadnpcfile and @loadnpc but ran as one command.
Example:
@reloadnpcfile npc/custom/jobmaster.txt

Maybe reloadnpcfile is the proper you want, but if you add first time, loadnpc and then reloadnpcfile.

Link to comment
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
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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...