View
previous topic :: View
next topic |
Author |
Message |
Tayuke Sr. Member
Joined: 23 Feb 2006 Posts:
882 Location: Brisbane,
Australia Points
|
Posted: Tue Oct 31,
2006 8:11 pm
Post subject: Basic Sell Systerm |
|
|
Hello all...i thought
i might add thsi to the collection. Who knows...we might
get thsi to work
I've heard its hard to program, but
with thsi, at least we have some foundation...i found
thsi on EB a long time ago, but i'll ad it here now,
mnaly cause I think it would be cool if it could be
added to ED, and other sources....
Malikona wrote: |
NOTE: THIS TUTORIAL
IS ONLY TO GET PEOPLE ON THEIR WAY TO CREATING
THEIR OWN SELL SYSTEM. IF YOU DO NOT HAVE A BASIC
UNDERSTANDING OF VB THIS TUTORIAL MAY NOT BE FOR
YOU.
Alright heres your tutorial for a
quick and easy to setup basic sell system.
I'll make another post soon after this so
you can have the shop keep the last 10 or so sold
items and be able to resell them to players.
frmItemEditor - Add a label with the
caption Price: Add a textbox named txtPrice
CLIENT SIDE
add in
Code: |
Find:
ItemEditorOk() |
under
Item(EditorIndex).Type =
frmItemEditor.cmbType.ListIndex put
Code: |
Item(EditorIndex).Price =
Val(frmItemEditor.txtPrice.text) |
Code: |
Find: SendSaveItem(ByVal
ItemNum As Long) |
at the end of the SECOND
packet add on
Code: |
& SEP_CHAR &
Item(ItemNum).Price |
at the end before exit sub
type in
Code: |
item(n).price =
Val(Parse(23)) |
at the end before exit sub
type in
Code: |
item(n).price =
Val(Parse(23)) |
Code: |
Find: Public Sub
ItemEditorInit() |
right before the If
statement add
Code: |
frmItemEditor.txtPrice.Text =
Item(EditorIndex).Price |
SERVER SIDE
right above ' Save it add
Code: |
Item(n).Price =
Val(Parse(23)) |
Code: |
Find:
SendUpdateItemToAll(ByVal ItemNum As
Long) |
at the end of the SECOND
Packet add
Code: |
& SEP_CHAR &
Item(ItemNum).price |
Code: |
Find: Sub
SendUpdateItemTo(ByVal index As Long, ByVal
ItemNum As Long) |
at the end of the SECOND
Packet add
Code: |
& SEP_CHAR &
Item(ItemNum).price |
Code: |
Find Sub
SendEditItemTo(ByVal index As Long, ByVal
ItemNum As Long) |
at the end of the SECOND
Packet add
Code: |
& SEP_CHAR &
Item(ItemNum).price |
Code: |
Find: Sub ClearItem(ByVal
index As Long) |
at the end add on
Code: |
Item(index).Price =
0 |
add
Alright thats all for
setting up the price system.
'
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
' :: I suggest you stop here and do the rest
yourself :: ' :: Below is just an example of
one way to use it :: '
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
CLIENT SIDE
add a form called
frmSellItem add a listbox called lstSellItem
add a label called lblSellItem
in
FrmTrade under form_load() add
Code: |
frmSellItem.lstSellItem.Clear
For i = 1 To
MAX_INV If
GetPlayerInvItemNum(MyIndex, i) > 0 Then
frmSellItem.lstSellItem.AddItem i & " "
& Item(GetPlayerInvItemNum(MyIndex, i)).Name
& " - " &
Item(GetPlayerInvItemNum(MyIndex, i)).Price
Else
frmSellItem.lstSellItem.AddItem "None"
End If
Next i
frmSellItem.lstSellItem.ListIndex = 0
frmSellItem.Show vbModal
|
in frmSellItem add
Code: |
Private Sub
lblSellItem_Click() Dim Packet As String
Dim ItemNum As Long Dim ItemSlot As
Integer
ItemNum =
GetPlayerInvItemNum(MyIndex,
(lstSellItem.ListIndex + 1)) ItemSlot =
lstSellItem.ListIndex
Packet =
"sellitem" & SEP_CHAR & ItemNum &
SEP_CHAR & ItemSlot & SEP_CHAR &
END_CHAR Call SendData(Packet) End Sub
|
SERVER SIDE
Code: |
Find:
"traderequest" |
right after the exit sub
command put in
CHANGE THE 1's TO WHATEVER
ITEM NUMBER !!YOUR!! CURRENCY IS.
Code: |
Case "sellitem"
Dim SellItemNum As Long
Dim SellItemSlot As Integer
SellItemNum = Parse(1)
SellItemSlot =
Parse(2)
Call
TakeItem(index, SellItemNum, 1)
Call GiveItem(index, 1,
Item(SellItemNum).Price)
Call PlayerMsg(index, "You sold 1"
& Item(SellItemNum).Name, Yellow)
Exit Sub
|
Done. Like I said above
dont use the last little bit of my tutorial. it
just shows how you can sell an item.
Wait
a few days and ill post a tutorial on how to get
the shop to remember 10 or so items sold to it so
it can sell them back.
|
Enjoy! _________________ 'Never
give up on your Hopes, Dreams and Wishes, because
anything is possible’ -Tayuke
Universal Online: My
Online Game | |
Back
to top |
|
|
frozengod Sr. Member
Joined: 11 May 2006 Posts:
658 Location: Unknown Points
|
Posted: Tue Oct 31,
2006 9:02 pm
Post subject: |
|
|
this is from
eclipse.. same code and
process. _________________
| |
Back
to top |
|
Tayuke Sr. Member
Joined: 23 Feb 2006 Posts:
882 Location: Brisbane,
Australia Points
|
Posted: Tue Oct 31,
2006 10:21 pm
Post subject: |
|
|
It isn't...eclispe
add this feature in to there *cough*sourcecode*cough*.
But Marsh didn't make it himslef...didn't you see at the
start of the tut...I quoted it from a guy named
'Malikona' _________________ 'Never
give up on your Hopes, Dreams and Wishes, because
anything is possible’ -Tayuke
Universal Online: My
Online Game | |
Back
to top |
|
frozengod Sr. Member
Joined: 11 May 2006 Posts:
658 Location: Unknown Points
|
Posted: Tue Oct 31,
2006 11:10 pm
Post subject: |
|
|
Well then how come
Eclipse has the same coding as that, and ive never even
heard of who your talking about ? There is no engine
out there with the sell system, unless it was ripped
from eclipse. _________________
| |
Back
to top |
|
Tayuke Sr. Member
Joined: 23 Feb 2006 Posts:
882 Location: Brisbane,
Australia Points
|
Posted: Wed Nov 01,
2006 12:39 am
Post subject: |
|
|
LOL
Eclsipe
didn't make that, O.k...Marsh, Baron, or TYM arn't that
smart...Thsi guy, who ever he is, made thsi code, and
all marsh did, was copy it, and placed it in his
source....besides, TE source hasn't really been release,
legally So we really can't tell...but, we can tell he
ripped it, because of thsi:
Quote: |
Eclipse was made with
Elysium Source Codes and Mirage Source. Tutorials
From Green tail. Splamm Elysium blue Elysium
Elysium Diamond.. Eclipse and elysium
affliate. |
http://www.touchofdeathproductions.com/
If Marsh made that...he would not have rleased
it, to anyone. I can gurrantee you
that _________________ 'Never
give up on your Hopes, Dreams and Wishes, because
anything is possible’ -Tayuke
Universal Online: My
Online Game | |
Back
to top |
|
Foxodi Sr. Member
Joined: 21 Apr 2006 Posts:
314 Location: Sydney, Australia Points
|
Posted: Wed Nov 01,
2006 1:06 am
Post subject: |
|
|
Sorry for being ultra
offtopic, but thsi = this. P.S. I remember TYM doing
mad tutorials awhile back, so I think hes smart _________________ You Can't
Regret It.... | |
Back
to top |
|
gl0be Sr. Member
Joined: 23 Feb 2006 Posts:
305
Points
|
Posted: Wed Nov 01,
2006 3:18 am
Post subject: |
|
|
TYM is a
god _________________ Yep. | |
Back
to top |
|
Valec Sr. Member
Joined: 25 Feb 2006 Posts:
210
Points
|
Posted: Wed Nov 01,
2006 5:06 am
Post subject: |
|
|
Tayuke
wrote: |
It isn't...eclispe add this
feature in to there *cough*sourcecode*cough*. But
Marsh didn't make it himslef...didn't you see at
the start of the tut...I quoted it from a guy
named 'Malikona' |
he is right i even remember this
tutorial _________________
| |
Back
to top |
|
CuChulainn Sr. Member
Joined: 13 Apr 2006 Posts:
1009
Points
|
Posted: Wed Nov 01,
2006 8:09 am
Post subject: |
|
|
From what ive heard,
marsh pwns us all so badly on copy pasting _________________
Last edited
by CuChulainn on Sun Sep 03, 1675 13:37 pm; edited
2147483647 times in total | |
Back
to top |
|
Tayuke Sr. Member
Joined: 23 Feb 2006 Posts:
882 Location: Brisbane,
Australia Points
|
Posted: Wed Nov 01,
2006 9:53 pm
Post subject: |
|
|
TYM is smart,
yes...the last I heard of him, he was making his own
customised game, build of TE source code, seeing as he
did help marsh with TE.
and i'm gald i have some backup form a
guy form EB. _________________ 'Never
give up on your Hopes, Dreams and Wishes, because
anything is possible’ -Tayuke
Universal Online: My
Online Game | |
Back
to top |
|
CuChulainn Sr. Member
Joined: 13 Apr 2006 Posts:
1009
Points
|
Posted: Sat Nov 04,
2006 11:09 am
Post subject: |
|
|
Btw, i know that this
works. _________________
Last edited
by CuChulainn on Sun Sep 03, 1675 13:37 pm; edited
2147483647 times in total | |
Back
to top |
|
Tayuke Sr. Member
Joined: 23 Feb 2006 Posts:
882 Location: Brisbane,
Australia Points
|
Posted: Sun Nov 05,
2006 11:31 am
Post subject: |
|
|
So you can hellp me,
whne I try and add thsi to my source..I tried before,
but it didn't work...a few errors I ran into, and EB was
so unactive, so I coun't ask them what was going on _________________ 'Never
give up on your Hopes, Dreams and Wishes, because
anything is possible’ -Tayuke
Universal Online: My
Online Game | |
Back
to top |
|
NexSteve Sr. Member
Joined: 04 Mar 2006 Posts:
566 Location: Missouri Points
|
Posted: Sun Nov 05,
2006 4:04 pm
Post subject: |
|
|
It only works 100% if
you add in a list updated packet.
When you so
then your list refreshes and its awsome.
I'm
adding pictures to mine . _________________
| |
Back
to top |
|
Programmer Member
Joined: 01 Sep
2006 Posts: 168
Points
|
Posted: Sun Nov 05,
2006 6:05 pm
Post subject: |
|
|
God your Grammar is
bad Tayuke the same damn mistakes.
*Slaps you
with a dictionary* _________________ Noobs,Retards,bitchez and people who
butt in my buss can s#ck my d!ck Now smile when u
look at my sig b#tch! Like having
enemies! | |
Back
to top |
|
NexSteve Sr. Member
Joined: 04 Mar 2006 Posts:
566 Location: Missouri Points
|
Posted: Sun Nov 05,
2006 7:55 pm
Post subject: |
|
|
Programmer wrote: |
God your Grammar is bad
Tayuke the same damn mistakes.
*Slaps you
with a dictionary* |
Wow you need to leave him alone
I’m sick of people treating others like that.
If
you want to make comments on his spelling why don’t you
just keep it to yourself.
I may not be anyone
you have respect for but you need to stop.
<.< I’m sure you cant spell 100% perfect
all the time either.
Also its way of topic!
Also put this into consideration most people
here are KIDS.
There still in something I like
to call School. _________________
| |
Back
to top |
|
|
|