Jump to content
  • 0

Guys what the wrong on this script


Jayz

Question


  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  396
  • Reputation:   53
  • Joined:  07/24/12
  • Last Seen:  

can you re-correct the getitemslots??

thanks

if(getitemslots(.@ItemPart)<0){
           mes .@name$;
           mes "Sorry this ^ff0000"+getitemname(getequipid(.@ItemPart))+"^000000 item already have slot";
       }else{
      	 mes "oh your item is not sloted";
	    ..............................................
		  ...........................................
	  ................................. etc..

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  61
  • Reputation:   1
  • Joined:  06/29/12
  • Last Seen:  

if(getitemslots(.@ItemPart) == 0){
		mes .@name$;
		mes "Sorry this ^ff0000"+getitemname(getequipid(.@ItemPart))+"^000000 item already have slot";
	}else{
   	 mes "oh your item is not sloted";
		..............................................
		  ...........................................
	  ................................. etc..

Hope can help :D

Edited by Phantasm
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  396
  • Reputation:   53
  • Joined:  07/24/12
  • Last Seen:  

not working..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  754
  • Reputation:   186
  • Joined:  05/22/12
  • Last Seen:  

should be

if(getitemslots(.@ItemPart) > 0){

it returns how many slots are there based on the item id. it is checked in the item_db

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  396
  • Reputation:   53
  • Joined:  07/24/12
  • Last Seen:  

still not working uhmm..

}else if(getitemslots(.@ItemPart) > 0){

mes .@name$;

mes "Sorry this ^ff0000"+getitemname(getequipid(.@ItemPart))+"^000000 item already have slot";

}else{

getitem 1201,1;

specialeffect2 EF_REFINEOK;

mes "Success...!";

mes "Yet again, my amazing";

mes "talent truly dazzles";

mes "and shines today,";

close;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  754
  • Reputation:   186
  • Joined:  05/22/12
  • Last Seen:  

1. Can you state the error?

2. Uploading the whole script would help us identify the problem.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

Using getitemslots...

*getitemslots(<item ID>)
This function will look up the item with the specified ID number in the database
and return the number of slots this kind of items has - 0 if they are not
slotted. It will also be 0 for all non-equippable items, naturally, unless
someone messed up the item database. It will return -1 if there is no such item.
Example(s):
//@slots now has the amount of slots of the item with ID 1205.
set @slots, getItemSlots(1205);

Using getquipid...

*getequipid(<equipment slot>)
This function returns the item ID of the item equipped in the equipment slot
specified on the invoking character. If nothing is equipped there, it returns -1.
Valid equipment slots are:
EQI_HEAD_TOP (1)  - Upper head gear
EQI_ARMOR (2)     - Armor (Where you keep your Jackets and Robes)
EQI_HAND_L (3)    - What is in your Left hand.
EQI_HAND_R (4)    - What is in your Right hand.
EQI_GARMENT (5)   - The garment slot (Mufflers, Hoods, Manteaus)
EQI_SHOES (6)     - What foot gear the player has on.
EQI_ACC_L (7)     - Accessory 1.
EQI_ACC_R (8)     - Accessory 2.
EQI_HEAD_MID (9)  - Middle Headgear (masks and glasses)
EQI_HEAD_LOW (10) - Lower Headgear (beards, some masks)
Notice that a few items occupy several equipment slots, and if the character is
wearing such an item, 'getequipid' will return it's ID number for either slot.

Your use of .@ItemPart in the part 'if(getitemslots(.@ItemPart) == 0){' should be giving the the ItemID and in the 'getitemname(getequipid(.@ItemPart))' your using it for getequipid which returns an equipment slot. That could be your problem.

if(getitemslots(.@ItemPart)<0){
mes .@name$;
mes "Sorry this ^ff0000"+getitemname(getequipid(.@ItemPart))+"^000000 item already have slot";
}else{
 mes "oh your item is not sloted";

Peopleperson49

Edited by peopleperson49
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...