Jump to content
  • 0

Help with this Streamer Supply NPC


Zantetsuken

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  4
  • Reputation:   0
  • Joined:  06/12/20
  • Last Seen:  

Requesting to edit this script.

Script gives permission to level 99 GMs to assign streamers, I just need a script that will give them supply everyday or every week. Pls see script i found.

Thank you in advance


 

-	script	STREAMER_SUPPLY	FAKE_NPC,{
    OnInit:
        bindatcmd("registerStreamer", strnpcinfo(3) + "::OnRegisterStreamer", 99);
        bindatcmd("unregisterStreamer", strnpcinfo(3) + "::OnUnregisterStreamer", 99);
    end;

    OnRegisterStreamer:
    OnUnregisterStreamer:
        if(.@atcmd_numparameters < 1) 
            dispbottom("Usage: " + .@atcmd_command$  + " <charname>");

        .@switch = (.@atcmd_command$ == "@registerStreamer") ? 1 : 0;

        charcommand("#set " + .@atcmd_parameters$[0] + " #STREAMER " + .@switch);
}

prontera,124,201,1	script	Streamer Supplies	726,{
    mes "[ Streamer Supplies ]";
    mes "You are " + ((#STREAMER == 0) ? "no" : "an") + " Streamer!";
    close;
}
Edited by Zantetsuken
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  234
  • Reputation:   87
  • Joined:  06/30/18
  • Last Seen:  

-	script	STREAMER_SUPPLY	FAKE_NPC,{
    OnInit:
        bindatcmd("registerStreamer", strnpcinfo(3) + "::OnRegisterStreamer", 99);
        bindatcmd("unregisterStreamer", strnpcinfo(3) + "::OnUnregisterStreamer", 99);
    
        .reward_item_id = 502;
        .reward_item_amount = 2;
    end;

    OnRegisterStreamer:
    OnUnregisterStreamer:
        if(.@atcmd_numparameters < 1) 
            dispbottom("Usage: " + .@atcmd_command$  + " <charname>");

        .@switch = (.@atcmd_command$ == "@registerStreamer") ? 1 : 0;

        charcommand("#set " + .@atcmd_parameters$[0] + " #STREAMER " + .@switch);
    end;

    // Every night at 00
    OnHour00:
        // Get all streamers
        query_sql("SELECT account_id FROM acc_reg_num WHERE `key` = \"#STREAMER\" AND value = 1;", .@streamer_acc_ids);
        for(.@i = 0; .@i < getarraysize(.@streamer_acc_ids); .@i) {
            // If the streamer is online hand out a reward.
            if(attachrid(.@streamer_acc_ids[.@i])) {
                getitem(.reward_item_id, .reward_item_amount);
                detachrid;
            }
        }
}

prontera,124,201,1	script	Streamer Supplies	726,{
    mes "[ Streamer Supplies ]";
    mes "You are " + ((#STREAMER == 0) ? "no" : "an") + " Streamer!";
    close;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  4
  • Reputation:   0
  • Joined:  06/12/20
  • Last Seen:  

registerstreamer command suddenly dont work unlike the first script. Is it possible that the streamer needed to click the NPC to get reward and they dont get the rewards automatically? 

 

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