Jump to content
  • 0

NPC item giver for test server


CyberDevil

Question


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.02
  • Content Count:  242
  • Reputation:   37
  • Joined:  02/25/18
  • Last Seen:  

I'm trying to put on a test server a simple npc to test the items, which to any player (also non-GM players) asks him for the ID and quantity of the item he wants and gives it to him... if the id is not exists, he writes it!
I could simply activate the "@item" command to all players but I need this system to be a script and not a command... any suggestions?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  924
  • Reputation:   167
  • Joined:  04/05/13
  • Last Seen:  

mes "quantity";

input .@q;

next;

mes "item id";

input .@i;

if(getiteminfo(.@i,2)<=0){

setarray $item_non_exist[getarraysize($item_non_exist)],.@i;

clear;

mes "non existed";

close;

}

getitem .@i,.@q;

mes "Here you go";

close;

 

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.02
  • Content Count:  242
  • Reputation:   37
  • Joined:  02/25/18
  • Last Seen:  

ok @Start_ it's quite simple it seems to me, but why with low item ID like red potion 501 tells me that the item doesn't exist?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  924
  • Reputation:   167
  • Joined:  04/05/13
  • Last Seen:  

change getiteminfo type  (doc/script_command (Find *getiteminfo), doc/item_db (For type list)).

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