PDA

View Full Version : [562][r2shd]Using points for things



scootersam
September 13th, 2010, 22:32
hey guys well this is a simple tutorial i made fast, because a fair few people on msn asked me howto use points and how to make things give points etc so here i go

Files programing:
- Player.java this can be found at src>come>rs2hd>model.
- And the files you want your points in

ok well first of all you need to declare you points in player.java so open it up
and scroll down a little

just after you will see some things like this


public int something declared;

something declared is where you point text will go also where other things are in the file
so first of all to keep it easy this is what you should base your point on

- Something to do with the name of what the point is.

ok so you want to add this


public int pcpoint;
please note - i was coding my pc points as i go along so thats why its called pcpoint

ok well now you can use that in most files

now

Getting the point to do something?
Well in this part i will shwo you how to add this point to add to your points by clicking an object? or a command?

well first off all this is what you program into your file to make it add points when you do what ever you want to do.


pcpoint += 1;

that basicly makes it add a point on


pcpoint -= 1;

that takes a point off the ones you allready have..

Using points in commands and other things!

ok well i will show you some coding for if you click an object and if you type a command..

so for the command


if (cmd[0].equals("pcpoint")) {
pcpoint += 1;
player.sm("You recieved a pestcontroll point!");
}


using it in an object?


case ####:
pcpoint += 1;
player.sm("You recieved a pestcontroll point!");
break;


ok well thats your tutorial

and ik its easy stuff dont flame me please this was just for the people who dont know how to use points for things

well enjoy and i hope i helped!

Kevin'
September 13th, 2010, 22:51
Nice guide!

scootersam
September 13th, 2010, 22:54
thanks kev hope u make something usefull form it :)

Nosz
September 14th, 2010, 02:00
-.- im pretty sure anyone can do this even if u are just starting this is like a question you could google not even joking

google - how to subtract from an public int -.- sad

anyway nice job i guess

Kevin'
September 14th, 2010, 02:02
-.- im pretty sure anyone can do this even if u are just starting this is like a question you could google not even joking

google - how to subtract from an public int -.- sad

anyway nice job i guess

Don't hate, some people don't know how to Declare. Its a beginner's tutorial.

Emily
September 14th, 2010, 02:05
Amg teach me teh JAVA

Kevin'
September 14th, 2010, 02:06
Amg teach me teh JAVA

I lol'd Irl.

alboboy94
September 14th, 2010, 02:07
goob job on it

420
September 14th, 2010, 04:13
Good job I guess lol

scootersam
September 14th, 2010, 08:08
lol ty a fair few pplz asked me for it might do a tut on timers tomorrow

Evo7
September 14th, 2010, 08:38
Nice Sam. I'll most likely use this TuT in iSo.

Faab234
September 14th, 2010, 11:56
People have much Points in their servers, so I suggest using Enums.

Stacx
September 14th, 2010, 12:28
Made me lol. You can't use conventions for 3 lines of code. make it transient for god sakes you make yourself look a like a total idiot.

scootersam
September 14th, 2010, 15:43
no i dont cus a few people said thanks and i helped them... idk why u flame me and emily and the rest your sad tbh, if some one asks me to make a tut that i know howto do i will so stfu and make some of ur own tuts if u so good stacx nap..

The Only Cj
September 14th, 2010, 15:50
Nice work Scootersam, your getting there. At least you found out something on your own.. Unlike some people

scootersam
September 14th, 2010, 15:52
thanks cj im alot better now :p most people just dont see it and flame me, but a few of people respect me :) like i respect u and dkk and caelum

The Only Cj
September 14th, 2010, 15:56
Appreciated.. want help, im here man.. (SUPPORTED)

scootersam
September 14th, 2010, 15:58
thanks dude ill surport u to :p

Stacx
September 14th, 2010, 16:12
no i dont cus a few people said thanks and i helped them... idk why u flame me and emily and the rest your sad tbh, if some one asks me to make a tut that i know howto do i will so stfu and make some of ur own tuts if u so good stacx nap..

You seriously think you need to be to do something as simple as this. You don't know what the fuck are "conventions",
stfu and make some of ur own tuts if u so good stacx nap..
Also you could have pmed this to the "few people" instead of making a tutorial out of three lines of code lmao.

scootersam
September 14th, 2010, 16:14
right i got a few things to say to u like i said make ur own tuts if ur so "fucking good"

1. I helped people so stfu
2. Some people thanked me and surported me for learning this my self.
3. its nto code its programing... u fuck tard

yaminub
January 21st, 2011, 05:06
I have a question for anyone reading this, if a player kills a npc, how can i make that add points?

apache ah64
January 21st, 2011, 09:33
to freaking easy.

tedhead2
January 22nd, 2011, 02:55
Not all of us are born geniuses...

I am trying to figure out how to add points when you kill something...

yaminub
January 22nd, 2011, 03:11
i figured it out ted. look in npc.java
The case is the npc, it would look something likethis:

case (NPC NUMBER HERE):
if(getId() == (NPC NUMBER HERE)) {
p.(POINT SYSTEM HERE)++;
}
break;

tedhead2
January 22nd, 2011, 03:16
thank you very much