Thread: Scrolls.

Results 1 to 7 of 7
  1. #1 Scrolls. 
    Registered Member
    Join Date
    Mar 2016
    Posts
    131
    Thanks given
    8
    Thanks received
    9
    Rep Power
    11
    Code:
    			if (itemId == 607) {
    				if (c.getItems().playerHasItem(607)) {
    					c.getItems().deleteItem(607, 1);
    					c.amountDonated = 25;
    					c.getDonationPoints = 25;
                                            c.donationPointAmount = 25;
    				c.sendMessage("<col=255>You have added 25$ to your wallet.</col>");
    SO this is my code for donator scroll. Whenever i open it, It only adds 25 dollars to "c.Amountdonated" it doe snot add to the Points.
    Using pi 317.
    Reply With Quote  
     

  2. #2  
    Bossman

    ISAI's Avatar
    Join Date
    Sep 2012
    Posts
    1,916
    Thanks given
    655
    Thanks received
    1,366
    Rep Power
    5000
    First of all, you want to increase their points/money by 25, not set it to 25 as you are currently doing. So instead of just an "=" sign, try using "+=". If what you're saying is still happening when you have done that, just as a debug, try putting the amount donated statement last.
    Reply With Quote  
     

  3. #3  
    Contaminated

    Radiated's Avatar
    Join Date
    Mar 2011
    Age
    27
    Posts
    928
    Thanks given
    255
    Thanks received
    164
    Rep Power
    240
    tl;drJUST DO WHAT ISAI said, kthx.

    Addition

    The + operator performs an addition of two values. This can be an addition of two constants, a constant and a variable, or a variable and a variable. Here are a few Java addition examples:
    Code:
    int sum1 = 10 + 20;      // adding two constant values
    int sum2 = sum1 + 33;    // adding a variable and a constant
    int sum3 = sum2 + sum2;  // adding two variables
    The + operator will replace the two values with the sum of the two values at runtime. So at the place where the expression sum1 + 33 is written, at runtime this will be replaced with the sum of the value of sum1 and the constant value 33.

    You can of course create longer chains of additions and thus add more than two numbers. Here is a en example of adding 3 or more values together:
    Code:
    int sum1 = 10 + 20 + 30;
    int sum3 = sum2 + 99 + 123 + 1191;
    A commonly used math operation on variables is to set the variable equal to its own value plus another value. Here is how that looks:
    Code:
    int result = 10;
    result = result + 20;
    The second line of this example sets the sum variable equals to its own value (before being assigned the new value) + 20. Which means 10 + 20.

    Since adding a value to a variable is a very common operation, Java contains a built-in operator for that specific purpose. It is the += operator. Here is the example above rewritten to use the += operator:
    Code:
    int result = 10;
    result += 20;
    The second line in this example adds 20 to the variable result. This equivalent to the code result = result + 20;
    fuckoff
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Mar 2016
    Posts
    131
    Thanks given
    8
    Thanks received
    9
    Rep Power
    11
    Quote Originally Posted by ISAI View Post
    First of all, you want to increase their points/money by 25, not set it to 25 as you are currently doing. So instead of just an "=" sign, try using "+=". If what you're saying is still happening when you have done that, just as a debug, try putting the amount donated statement last.
    Quote Originally Posted by Alpha View Post
    tl;drJUST DO WHAT ISAI said, kthx.

    Addition

    The + operator performs an addition of two values. This can be an addition of two constants, a constant and a variable, or a variable and a variable. Here are a few Java addition examples:
    Code:
    int sum1 = 10 + 20;      // adding two constant values
    int sum2 = sum1 + 33;    // adding a variable and a constant
    int sum3 = sum2 + sum2;  // adding two variables
    The + operator will replace the two values with the sum of the two values at runtime. So at the place where the expression sum1 + 33 is written, at runtime this will be replaced with the sum of the value of sum1 and the constant value 33.

    You can of course create longer chains of additions and thus add more than two numbers. Here is a en example of adding 3 or more values together:
    Code:
    int sum1 = 10 + 20 + 30;
    int sum3 = sum2 + 99 + 123 + 1191;
    A commonly used math operation on variables is to set the variable equal to its own value plus another value. Here is how that looks:
    Code:
    int result = 10;
    result = result + 20;
    The second line of this example sets the sum variable equals to its own value (before being assigned the new value) + 20. Which means 10 + 20.

    Since adding a value to a variable is a very common operation, Java contains a built-in operator for that specific purpose. It is the += operator. Here is the example above rewritten to use the += operator:
    Code:
    int result = 10;
    result += 20;
    The second line in this example adds 20 to the variable result. This equivalent to the code result = result + 20;
    Thanks for the help, None of it works. Doesnt add anything to the points. tried relogging and i dont get anything.
    Reply With Quote  
     

  5. #5  
    Contaminated

    Radiated's Avatar
    Join Date
    Mar 2011
    Age
    27
    Posts
    928
    Thanks given
    255
    Thanks received
    164
    Rep Power
    240
    Quote Originally Posted by Weekndz View Post
    Thanks for the help, None of it works. Doesnt add anything to the points. tried relogging and i dont get anything.


    Try this;

    Code:
    			if (itemId == 607) {
    				if (c.getItems().playerHasItem(607)) {
    					c.getItems().deleteItem(607, 1);
    					c.amountDonated += 25; //You are increasing his "amountDonated" 25 times.
    					c.getDonationPoints += 25; //You are increasing his "getDonationPoints" 25 times.
                                            c.donationPointAmount += 25; //You are increasing his "donationPointAmount" 25 times.
    					c.sendMessage("<col=255>You have added 25$ to your wallet.</col>");
    				} else {
    					c.sendMessage("Be at peace, not pieces, now gtfo.");
    				}
    			}
    Oh and check your point stuff.. You're actually adding it 2 times? getDonationPoints and donationPointsAmount?
    fuckoff
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Mar 2016
    Posts
    131
    Thanks given
    8
    Thanks received
    9
    Rep Power
    11
    Already tried it but thanks. It's the same i think my source is messed up or something.
    Reply With Quote  
     

  7. #7  
    Respected Member


    Join Date
    Jul 2015
    Posts
    781
    Thanks given
    206
    Thanks received
    394
    Rep Power
    524
    Quote Originally Posted by Weekndz View Post
    Already tried it but thanks. It's the same i think my source is messed up or something.
    Are you having it save donation points on logout, and loading it on login? Also are you sure you're not receiving the point? Make a command that says how many donator points you have. It may not be updating on your quest tab or whatever you're looking at as you're not sending new frame126
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Mouse scrolling
    By Danno in forum Tutorials
    Replies: 32
    Last Post: 05-19-2009, 07:18 AM
  2. ==New RuneScape Login Scroll==
    By Jammy780 in forum Graphics
    Replies: 8
    Last Post: 04-15-2009, 12:18 PM
  3. Rs Login Scroll
    By Thani in forum Graphics
    Replies: 6
    Last Post: 07-16-2008, 09:42 PM
  4. [req] new rs log in sprite(scroll) [req]
    By Mime in forum Graphics
    Replies: 3
    Last Post: 07-11-2008, 10:08 AM
  5. Clue scroll - with item on it.
    By ViperSniper in forum Configuration
    Replies: 20
    Last Post: 06-29-2008, 02:47 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •