Eclipse
January 05, 2009, 10:08:03 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Chat Help Rules Arcade Search Calendar Gallery Login Register  
 
 
 
Recent Topics +-
~ Paradise uncharted ~ Supported by Dezire Software Forums by slym
Today at 10:07:06 PM

I need a little help by waffletamer
Today at 10:03:40 PM

Actual Map for the continents by MrMiguu™
Today at 10:00:23 PM

World of Hyrule - Official Topic by MrMiguu™
Today at 09:58:39 PM

Lostica [Project Revamp] by MrMiguu™
Today at 09:56:40 PM

Disparity Recruiting by Peter
Today at 09:49:31 PM

Okay Questions (very noob person here) by The Roujo
Today at 09:48:45 PM

fun with photoshop by MrMiguu™
Today at 09:48:19 PM

stackable items? by MrMiguu™
Today at 09:45:06 PM

scripts? by MrMiguu™
Today at 09:44:14 PM

Members Online +-
11 Guests, 20 Users
Kreator,
slym,
Catcatcat,
Simius Cruentus,
Sablefalcon,
HawkStorm95,
ralir,
Amperglyph,
MrMiguu™,
‪‫‬‭‮‪‫Kusy,
shakadaran,
waffletamer,
Gwendalin,
dg1423,
dragonlord52,
Sk3wer,
Ambard,
‪‫‬‭‮‪‫‬‭The Admiral,
Baron,
Haruhito
Pages: [1]
  Print  
Author Topic: Give and Take item script all in one  (Read 1123 times)
0 Members and 1 Guest are viewing this topic.
Brutal - Zeldo
Ex-Eclipse Programmer
Global Moderator
Active Member
*
Offline Offline

Posts: 324

Pie


View Profile Email
« on: July 28, 2006, 08:15:11 PM »

Ok i made this for anyone to use in there scripts so that theres not 15 million diffrent ones being made every time a new script is made so here it is

add this to the bottom of ur main
Code: [Select]
Sub itemz(index, item, value, stackable , type)
Dim Slot
If type = 1 Then
    If stackable = 0 Then
Slot = 1
Do While Slot < 24
If GetPlayerInvItemNum(index, Slot) = item Then
Call SetPlayerInvItemNum(index, Slot, 0)
Call SetPlayerInvItemValue(index, Slot, 0)
Call SendInventoryUpdate(index, Slot)
Slot = 24
End If
Slot = Slot+1
Loop
Exit Sub
    End If
    If stackable = 1 Then
Slot = 1
Do While Slot < 24
If GetPlayerInvItemNum(index, Slot) = item Then
AMOUNT = GetPlayerInvItemValue(index, Slot)
TAKE = Int(AMOUNT-value)
If TAKE <0> 0 Then
Call SetPlayerInvItemNum(index, Slot, 0)
Call SetPlayerInvItemValue(index, Slot, 0)
Call SetPlayerInvItemNum(index, Slot, item)
Call SetPlayerInvItemValue(index, Slot, TAKE)
Call SendInventoryUpdate(index, Slot)
End If
Slot = 24
End If
Slot = Slot+1
Loop
Exit Sub
    End If
ElseIf type = 2 Then
Do While Slot < 24
If GetPlayerInvItemNum(index, Slot) = 0 Then
Call SetPlayerInvItemNum(index, Slot, item)
Call SetPlayerInvItemValue(index, Slot, GetPlayerInvItemValue(index, Slot)+value)
Call SendInventoryUpdate(index, Slot)
Slot = 24
End If
Slot = Slot+1
Loop
End If
End Sub

And Thats is  :)

HOW TO USE

Command is Sub itemz(index, item, value, stackable , type)
item = the item num
value = how many of the item(if non-stackable put 0)
stackable = 0 if not stackable and 1 if it is
type = 1 if its takeing an item and 2 if it giveing an item

Well thats it post here if you are haveing a problem
jakeruston
Member
**
Offline Offline

Posts: 85


View Profile WWW Email
« Reply #1 on: July 28, 2006, 11:47:34 PM »

So what do you type to give an item?
Brutal - Zeldo
Ex-Eclipse Programmer
Global Moderator
Active Member
*
Offline Offline

Posts: 324

Pie


View Profile Email
« Reply #2 on: July 29, 2006, 03:17:24 PM »

type = 1 if its takeing an item and 2 if it giveing an item
I posted that above msn me if u still dont get it (i will ONLY help u not put the script in or help u use it i will only teach u how to)
GF3
Newb
*
Offline Offline

Posts: 24


View Profile Email
« Reply #3 on: July 31, 2006, 12:38:59 PM »

I Put The Code But Can Get It to work...Is this Code useable on NPCs?
Brutal - Zeldo
Ex-Eclipse Programmer
Global Moderator
Active Member
*
Offline Offline

Posts: 324

Pie


View Profile Email
« Reply #4 on: July 31, 2006, 01:56:14 PM »

If you know what ur doin (know how to call a sub...) then yes
GF3
Newb
*
Offline Offline

Posts: 24


View Profile Email
« Reply #5 on: July 31, 2006, 02:49:16 PM »

Quote from: brutal
If you know what ur doin (know how to call a sub...) then yes
Uhh to tell you I have no Idea what im Doing....
Brutal - Zeldo
Ex-Eclipse Programmer
Global Moderator
Active Member
*
Offline Offline

Posts: 324

Pie


View Profile Email
« Reply #6 on: July 31, 2006, 06:31:04 PM »

Read the script tuts to learn...Then try and use scripts
1472000
Programmer
Advanced Member
****
Offline Offline

Posts: 557



View Profile Email
« Reply #7 on: June 06, 2007, 11:53:33 AM »

Read the script tuts to learn...Then try and use scripts
I read this and it helps a lot!

Thanks!~
kayoken
Member
**
Offline Offline

Posts: 58


Dont Mess with the God of Battle


View Profile WWW Email
« Reply #8 on: July 26, 2007, 07:56:41 PM »

thx for this iv been looking for this for a while
Pages: [1]
  Print  
 
 

Powered by EzPortal
Powered by MySQL Powered by PHP Powered by SMF 2.0 Beta 4 | SMF © 2006–2008, Simple Machines LLC | Sitemap Valid XHTML 1.0! Valid CSS!
Page created in 0.435 seconds with 33 queries.