Jump to content
  • 0

add a check weight


maynard

Question


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   1
  • Joined:  12/21/11
  • Last Seen:  

edit please to check weight before converting cash points to poring coin. The coin drops if you are overweight.

prontera,137,171,5 script CoinExchanger 510,{

mes "[Exchanger]";

mes " ... ";

next;

switch(select("Poring Coin to Cash Point:Cash Points to Poring Coin")) {

case 1:

mes "How many Points you want?";

mes "NOTE: 1 Poring Coin = 1 CASHPOINT";

mes " ";

mes "Enter number of Points to exchange with.";

input .@Point;

if (.@Point < 1 || .@Point > countitem(7539)) { // Edit POD Id here

mes "You Don't have enought Poring Coin or the Entered Value is Not allowed.";

close;

}

set #CASHPOINTS, #CASHPOINTS + .@Point; // Edit Point Variable

dispbottom "You have total of " + #CASHPOINTS;

delitem 7539,.@Point; // Edit this

mes "Exchange successfully done.";

close;

case 2:

mes "How many Poring Coin you want?";

mes "NOTE: 1 CASHPOINT = 1 Poring Coin";

mes " ";

mes "Enter number of PODS to exchange with.";

input .@POD;

if (.@POD < 1 || .@POD > #CASHPOINTS) { // Edit Point Variable here

mes "You Don't have enought CashPoints or the Entered Value is Not allowed.";

close;

}

getitem 7539,.@POD; // Edit Point Variable

set #CASHPOINTS, #CASHPOINTS - .@POD; // Edit Point Variable

dispbottom "You have total of " + #CASHPOINTS + ".";

mes "Exchange successfully done.";

close;

}

}

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  715
  • Reputation:   83
  • Joined:  01/05/12
  • Last Seen:  

Please use code or codebox

Try this . . . .

prontera,137,171,5    script    CoinExchanger    510,{

mes "[Exchanger]";
mes " ...  ";
next;
switch(select("Poring Coin to Cash Point:Cash Points to Poring Coin")) {

       case 1:
       mes "How many Points you want?";
       mes "NOTE: 1 Poring Coin = 1 CASHPOINT";
       mes " ";
       mes "Enter number of Points to exchange with.";
       input .@Point;
       if (.@Point < 1 || .@Point > countitem(7539)) { // Edit POD Id here
           mes "You Don't have enought Poring Coin or the Entered Value is Not allowed.";
           close;
       }
       set #CASHPOINTS, #CASHPOINTS + .@Point; // Edit Point Variable
       dispbottom "You have total of " + #CASHPOINTS;
       delitem 7539,.@Point; // Edit this
       mes "Exchange successfully done.";
       close;

       case 2:
       mes "How many Poring Coin you want?";
       mes "NOTE: 1 CASHPOINT = 1 Poring Coin";
       mes " ";
       mes "Enter number of PODS to exchange with.";
       input .@POD;
       if (.@POD < 1 || .@POD > #CASHPOINTS) { // Edit Point Variable here
           mes "You Don't have enought CashPoints or the Entered Value is Not allowed.";
           close;
       }
       if (checkweight(7539,.@POD)) {
       getitem 7539,.@POD; // Edit Point Variable
       set #CASHPOINTS, #CASHPOINTS - .@POD; // Edit Point Variable
       dispbottom "You have total of " + #CASHPOINTS + ".";
       mes "Exchange successfully done.";
       } else {
       mes "Sorry you cannot hold this amount of PODS.";
       }
       close;
   }
}

Edited by Lelouch
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   1
  • Joined:  12/21/11
  • Last Seen:  

DONE thank you sir

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