Raised This Month: $ Target: $400
 0% 

Need help adding /buy menu to a NPC


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
'DriGGeR-
Junior Member
Join Date: Dec 2004
Location: Sweden
Old 11-05-2006 , 12:48   Need help adding /buy menu to a NPC
Reply With Quote #1

Hey there. I've added a new NPC to the MCMD hospital (MecklenburgV3_B1) and I want her to have a /buy menu where she will sell first aid kits and such. I followed suzukas tutorial to make a NPC and it is just quite simple. (Nothing with taking dmg or such.) But here's a picture:

[img]http://img233.**************/img233/8505/npcnurseta4.jpg[/img]

So now the question is how to make the /buy script. Could anyone help me with that script and tell me where to put it and so? You will be rewarde with lots of karma!

Also I've already added the items and all that to my economy.sql. But here is the NPC Info that she shall have:

NPC 2. Nurse

1190x, 1264y, -379z

ITEMS:

ID - NAME - MONEY

19 - Operation Kit - 45
33 - Bandage - 15
7 - First Aid Kit - 30

-----------------------------------
(Also if you need the NPC script, I will post it here.)

Thanks!
__________________
[img]http://img507.**************/img507/5797/logoban2ka4.gif[/img]
solidxRP - Where your roles comes true...
A serious RP server & community! Visit now and read the FAQ!

Last edited by 'DriGGeR-; 11-05-2006 at 15:00.
'DriGGeR- is offline
Send a message via AIM to 'DriGGeR- Send a message via MSN to 'DriGGeR-
mini_sodier
Member
Join Date: Sep 2006
Location: Your moms bed
Old 11-05-2006 , 15:57   Re: Need help adding /buy menu to a NPC
Reply With Quote #2

Hmm did you try using Navicat to edit NPC and make a line for her?
__________________




Last edited by mini_sodier; 11-05-2006 at 15:59.
mini_sodier is offline
Send a message via AIM to mini_sodier Send a message via MSN to mini_sodier
'DriGGeR-
Junior Member
Join Date: Dec 2004
Location: Sweden
Old 11-05-2006 , 16:34   Re: Need help adding /buy menu to a NPC
Reply With Quote #3

Quote:
Also I've already added the items and all that to my economy.sql. But here is the NPC Info that she shall have.
Yeah, I added this line to the economy.sql and opened it with navicat:
(22, 'Nurse', '19|33|7', '20|20|20', '45|15|30', '0', 1190, 1264, -379, 0);
__________________
[img]http://img507.**************/img507/5797/logoban2ka4.gif[/img]
solidxRP - Where your roles comes true...
A serious RP server & community! Visit now and read the FAQ!
'DriGGeR- is offline
Send a message via AIM to 'DriGGeR- Send a message via MSN to 'DriGGeR-
mini_sodier
Member
Join Date: Sep 2006
Location: Your moms bed
Old 11-05-2006 , 16:40   Re: Need help adding /buy menu to a NPC
Reply With Quote #4

Then did you go up to the NPC and say /buy ?
__________________



mini_sodier is offline
Send a message via AIM to mini_sodier Send a message via MSN to mini_sodier
'DriGGeR-
Junior Member
Join Date: Dec 2004
Location: Sweden
Old 11-05-2006 , 16:42   Re: Need help adding /buy menu to a NPC
Reply With Quote #5

Of course, but it doesn't work, nothing shows up.
__________________
[img]http://img507.**************/img507/5797/logoban2ka4.gif[/img]
solidxRP - Where your roles comes true...
A serious RP server & community! Visit now and read the FAQ!

Last edited by 'DriGGeR-; 11-05-2006 at 17:16.
'DriGGeR- is offline
Send a message via AIM to 'DriGGeR- Send a message via MSN to 'DriGGeR-
'DriGGeR-
Junior Member
Join Date: Dec 2004
Location: Sweden
Old 11-06-2006 , 15:18   Re: Need help adding /buy menu to a NPC
Reply With Quote #6

Anyway, I've tried some. This is what I've done. Someone please help with the faults and what I should add to make it fully work:

Code:
public plugin_init()
{
   register_clcmd("say /buy", "clcmd_buy", 0, "Activates the menu for medical supplies")
   register_menucmd(register_menuid("Medical Supplies"), 1023, "menucmd_Items")
}

public clcmd_Items(id)
{
   new text[513]

   format(text, 512, "\yMedical Supplies - ^n\w1. Operation Kit^n\w2. Bandage^n\w3. First Aid Kit^n\w4. Exit^n^n")

   new keys = (1<<0)|(1<<1)|(1<<2)
   show_menu(id, keys, text, -1, "Medical Supplies")

   return PLUGIN_HANDLED
}
__________________
[img]http://img507.**************/img507/5797/logoban2ka4.gif[/img]
solidxRP - Where your roles comes true...
A serious RP server & community! Visit now and read the FAQ!
'DriGGeR- is offline
Send a message via AIM to 'DriGGeR- Send a message via MSN to 'DriGGeR-
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 11-06-2006 , 19:17   Re: Need help adding /buy menu to a NPC
Reply With Quote #7

Using your own script will probably make it harder/worse. In your initial post you mention it is NPC ID 2 and later on you say 22. Make sure whatever NPC ID you use isn't already taken. Ensure the coordinates are correct (amx_teleportmenu). Also are ANY NPC's working? If so first try copying that line and simply changing the coordinates (without item id's).
__________________
Quote:
Originally Posted by Twilight Suzuka
Don't worry m'lord. The turtles day will come.
Lord_Destros is offline
Send a message via AIM to Lord_Destros
'DriGGeR-
Junior Member
Join Date: Dec 2004
Location: Sweden
Old 11-07-2006 , 01:01   Re: Need help adding /buy menu to a NPC
Reply With Quote #8

Sorry about the 2 there but the 2 is just that I planned to add 2 new NPCs from the beginning but changed my mind. So the number 2 there is nothing. (The ID's between the already excisting NPCs are from 1-3 and 10-21 so I used 22)Anyway, the coordinates is right (I used amx_telemenu). And yes all the other NPCs are working. But the coordinates I showed you there are where the NPC stands, so you maybe have to put new ones when you stand infront of her to get /buy working?
__________________
[img]http://img507.**************/img507/5797/logoban2ka4.gif[/img]
solidxRP - Where your roles comes true...
A serious RP server & community! Visit now and read the FAQ!
'DriGGeR- is offline
Send a message via AIM to 'DriGGeR- Send a message via MSN to 'DriGGeR-
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 11-07-2006 , 01:41   Re: Need help adding /buy menu to a NPC
Reply With Quote #9

Yes, you do...........(It depends on how large your radius is, if they aren't behind a wall you MAY not have to but its still a good idea).........
__________________
Quote:
Originally Posted by Twilight Suzuka
Don't worry m'lord. The turtles day will come.
Lord_Destros is offline
Send a message via AIM to Lord_Destros
'DriGGeR-
Junior Member
Join Date: Dec 2004
Location: Sweden
Old 11-07-2006 , 10:15   Re: Need help adding /buy menu to a NPC
Reply With Quote #10

Ah! Now it works! Yea, I just needed to put new coordinates to make it work! Thanks!
__________________
[img]http://img507.**************/img507/5797/logoban2ka4.gif[/img]
solidxRP - Where your roles comes true...
A serious RP server & community! Visit now and read the FAQ!
'DriGGeR- is offline
Send a message via AIM to 'DriGGeR- Send a message via MSN to 'DriGGeR-
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:04.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode