Raised This Month: $ Target: $400
 0% 

Employment MOD Help TSRP Amxx 1.7


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 06-12-2006 , 20:46  
Reply With Quote #1

I can't help you on the NPC part, so I would look over Twilight Suzuka's Awesome Creating an NPC Guide.

Well for the command to access the NPC you would need to register this:
Code:
register_clcmd("say /buy", "clcmd_buy", 0, "Activates the menu for jobs")

Then, you would have to make a menu where you could link to that:
Code:
register_menucmd(register_menuid("Job Menu"), 1023, "menucmd_JobMenu")

Then, for the menu to actually work you need to complete the client command function:
Code:
public clcmd_jobmenu(id) {    new text[513]    format(text, 512, "\yJob Menu - ^n\w1. Waiter^n\w2. Janitor^n\w3. Exit^n^n")    new keys = (1<<0)|(1<<1)|(1<<2)    show_menu(id, keys, text, -1, "Job Menu")    return PLUGIN_HANDLED }

Finally, you can set the code/actions that take place for the actual menu:
Code:
public menucmd_JobMenu(id, key) {    switch(key)    {       case 0:       {          // Code for waiter here...       }       case 1:       {          // Code for Janitor here...       }       case 2:       {          // Exit       }    } }

Well here's it all together:
Code:
#include <amxmodx> #include <amxmisc> // Not sure if this is needed public plugin_init() {    register_clcmd("say /buy", "clcmd_buy", 0, "Activates the menu for jobs")    register_menucmd(register_menuid("Job Menu"), 1023, "menucmd_JobMenu") } public clcmd_jobmenu(id) {    new text[513]    format(text, 512, "\yJob Menu - ^n\w1. Waiter^n\w2. Janitor^n\w3. Exit^n^n")    new keys = (1<<0)|(1<<1)|(1<<2)    show_menu(id, keys, text, -1, "Job Menu")    return PLUGIN_HANDLED } public menucmd_JobMenu(id, key) {    switch(key)    {       case 0:       {          // Code for Waiter here...       }       case 1:       {          // Code for Janitor here...       }       case 2:       {           //  Exit       }    } }

This isn't perfect, might not work because I did it real fast without thinking straight. But it's just supposed to be helpful.
Peli is offline
Send a message via MSN to Peli
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 08:09.


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