Jump to content
  • 0

ADD Rops


Jesca

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  04/22/18
  • Last Seen:  

Can anyone help me with a script to add Rops through an NPC?
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  50
  • Reputation:   14
  • Joined:  07/23/18
  • Last Seen:  

//By Brian

//http://rathena.org/board/user/237-brian/

 

prontera,156,178,4      script  ChangeMe        910,{

        if (getgmlevel() < 10) end;

        set .@AID, getcharid(3);        // save their RID

        

        mes "Hello GM";

        mes "Enter the char's name:";

        input .@name$;

        query_sql "SELECT `account_id`,`name` FROM `char` WHERE `name` = '"+escape_sql(.@name$)+"'", .@account_id,.@name$;

        if (!.@account_id) {

                mes "^FF0000     This player doesn't exist!";

                close;

        }

        mes "How many cash point would you like give to^0000FF " + .@name$ + "^000000?";

        input .@amt;

        if (.@amt < 1) {

                mes "^FF0000     Amount must be positive.";

                close;

        }

        

        mes " ";

        mes "Give "+.@amt+" cash points to "+.@name$+"?";

        if(select("Yes:No")==2) close;

        

        if (attachrid(.@account_id)) {

                set #CASHPOINTS, #CASHPOINTS + .@amt;

                dispbottom "Gained "+.@amt+" cash points. Total "+#CASHPOINTS+" points";

        } else {

                query_sql "SELECT COUNT(`account_id`) FROM `global_reg_value` WHERE `str`='#CASHPOINTS' AND `account_id`='"+.@account_id+"'", .@update;

                if (.@update)

                        query_sql "UPDATE `global_reg_value` SET `value` = (CAST(`value` AS UNSIGNED)+'"+.@amt+"') WHERE `str`='#CASHPOINTS' AND `account_id`='"+.@account_id+"'";

                else

                        query_sql "INSERT INTO `global_reg_value` (`str`,`value`,`type`,`account_id`) VALUES ('#CASHPOINTS',"+.@amt+",2,"+.@account_id+")";

        }

        attachrid(.@AID);

        mes "Gave "+.@amt+" cash points to "+.@name$+".";

        announce "GM "+strcharinfo(0)+" gave to "+.@name$+" "+.@amt+" Cash Points",bc_all;

        close;

}

Try it.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  04/22/18
  • Last Seen:  

5 hours ago, Tanlor said:

//By Brian

//http://rathena.org/board/user/237-brian/

 

prontera,156,178,4      script  ChangeMe        910,{

        if (getgmlevel() < 10) end;

        set .@AID, getcharid(3);        // save their RID

        

        mes "Hello GM";

        mes "Enter the char's name:";

        input .@name$;

        query_sql "SELECT `account_id`,`name` FROM `char` WHERE `name` = '"+escape_sql(.@name$)+"'", .@account_id,.@name$;

        if (!.@account_id) {

                mes "^FF0000     This player doesn't exist!";

                close;

        }

        mes "How many cash point would you like give to^0000FF " + .@name$ + "^000000?";

        input .@amt;

        if (.@amt < 1) {

                mes "^FF0000     Amount must be positive.";

                close;

        }

        

        mes " ";

        mes "Give "+.@amt+" cash points to "+.@name$+"?";

        if(select("Yes:No")==2) close;

        

        if (attachrid(.@account_id)) {

                set #CASHPOINTS, #CASHPOINTS + .@amt;

                dispbottom "Gained "+.@amt+" cash points. Total "+#CASHPOINTS+" points";

        } else {

                query_sql "SELECT COUNT(`account_id`) FROM `global_reg_value` WHERE `str`='#CASHPOINTS' AND `account_id`='"+.@account_id+"'", .@update;

                if (.@update)

                        query_sql "UPDATE `global_reg_value` SET `value` = (CAST(`value` AS UNSIGNED)+'"+.@amt+"') WHERE `str`='#CASHPOINTS' AND `account_id`='"+.@account_id+"'";

                else

                        query_sql "INSERT INTO `global_reg_value` (`str`,`value`,`type`,`account_id`) VALUES ('#CASHPOINTS',"+.@amt+",2,"+.@account_id+")";

        }

        attachrid(.@AID);

        mes "Gave "+.@amt+" cash points to "+.@name$+".";

        announce "GM "+strcharinfo(0)+" gave to "+.@name$+" "+.@amt+" Cash Points",bc_all;

        close;

}

Try it.

Ty for this ❤️

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