Raised This Month: $ Target: $400
 0% 

Employment MOD Help TSRP Amxx 1.7


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kenx187x
Junior Member
Join Date: Jun 2006
Old 06-12-2006 , 17:31   Employment MOD Help TSRP Amxx 1.7
Reply With Quote #1

Yes i found this on here and it is told to be broke and un finshed i want it where you can go up to a npc and type /buy and brings up list jobs u see
1.Waiter 2. janitor and you press 1 makes you waiter, reason i want this so i dont have to give new people e jobs and i can deal with bigger issues

Code:
public plugin_init() { 
         register_clcmd("employment","menu_mymenu"); 
    register_menucmd( register_menuid( MENU_MYMENU_TITLE ) , 1023, "_menu_mymenu"); 
    register_menucmd( register_menuid( MENU_MYMENU2_TITLE ) , 1023, "_menu_mymenu2"); 


} 
public menu_mymenu( id ) { 

    new szMenu[512], iLen; 
    new iKeys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<8)|(1<<9); 

    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU_TITLE ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU_1 ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU_2 ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU_3 ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU_4 ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU_5 ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU_6 ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU_7 ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU_8 ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU_NEXT ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_CANCEL ); 

    show_menu( id, iKeys, szMenu ); 
    return PLUGIN_HANDLED; 
} 

public cmd_mymenu(id) { 
    menu_mymenu(id); 
    return PLUGIN_HANDLED; 
} 

public _menu_mymenu( id, iKey ) { 

    switch ( iKey ) 
    { 
      case 0:     jobchange(id,"Banker", "10"); 
      case 1:     jobchange(id,"Waiter", "7"); 
      case 2:     jobchange(id,"Clerk", "8"); 
      case 3:     jobchange(id,"Gunsec", "7"); 
      case 4:     jobchange(id,"Scout", "7"); 
      case 5:     jobchange(id,"Bodyguard", "7"); 
      case 6:     jobchange(id,"Cop", "9"); 
    case 7:     jobchange(id,"Bouncer", "7"); 
      case 8:     menu_mymenu2(id); 
    } 

    return PLUGIN_HANDLED; 
} 

public menu_mymenu2( id ) { 

    new szMenu[512], iLen; 
    new iKeys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<8)|(1<<9); 

    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU2_TITLE ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU2_1 ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU2_2 ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU2_3 ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU2_4 ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU2_5 ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU2_6 ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU2_7 ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU2_8 ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_MYMENU2_NEXT ); 
    iLen += format( szMenu[iLen], 512 - iLen, MENU_PREVIOUS ); 

    show_menu( id, iKeys, szMenu ); 
    return PLUGIN_HANDLED; 
} 



public _menu_mymenu2( id, iKey ) { 

    switch ( iKey ) 
    { 
      case 0:     jobchange(id,"Bellboy", "6"); 
      case 1:     jobchange(id,"Secretary", "8"); 
      case 2:     jobchange(id,"Nurse", "7"); 
      case 3:     jobchange(id,"Altar", "4"); 
      case 4:     jobchange(id,"Taxidriver", "5"); 
    case 5:     menu_mymenu2(id); 
    case 6:     menu_mymenu2(id); 
    case 7:     menu_mymenu2(id); 
    case 8:     menu_mymenu2(id); 
    case 9:     menu_mymenu(id); 
    } 

    return PLUGIN_HANDLED; 
}
kenx187x is offline
kenx187x
Junior Member
Join Date: Jun 2006
Old 06-12-2006 , 18:41  
Reply With Quote #2

anyone?
kenx187x is offline
tetsoma
Member
Join Date: May 2006
Location: somewhere in my head
Old 06-12-2006 , 18:44  
Reply With Quote #3

i might know someone who will touch it
__________________


Tetsoma's RP
http://thespecialistsrp.com
i_hate_iburg
tetsoma is offline
Send a message via AIM to tetsoma Send a message via Yahoo to tetsoma
kenx187x
Junior Member
Join Date: Jun 2006
Old 06-12-2006 , 19:17  
Reply With Quote #4

and testoma do you know how to un precache models on map for like i can run more models for a carmod
kenx187x is offline
tetsoma
Member
Join Date: May 2006
Location: somewhere in my head
Old 06-12-2006 , 19:30  
Reply With Quote #5

someone eles is going to have to fix that code
__________________


Tetsoma's RP
http://thespecialistsrp.com
i_hate_iburg
tetsoma is offline
Send a message via AIM to tetsoma Send a message via Yahoo to tetsoma
kenx187x
Junior Member
Join Date: Jun 2006
Old 06-12-2006 , 20:32  
Reply With Quote #6

anyone fix that plugin?
kenx187x is offline
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 06-12-2006 , 20:36  
Reply With Quote #7

Quote:
Originally Posted by kenx187x
and testoma do you know how to un precache models on map for like i can run more models for a carmod
Either use Suzuka's stripper2 plugin or remove existing plugins (and unprecache what they use). If you wish to remove sprites/models/sounds built into the map you have to use the first method.
__________________
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
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 06-12-2006 , 20:46  
Reply With Quote #8

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
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 06-12-2006 , 21:58  
Reply With Quote #9

Ummmm, that shouldn't work at all.

1. You never created a method named clcmd_buy
2. You never set origin on where NPC (the store only, not the model) should appear, I believe this would cause /buy to work anywhere around the map.

Yes, yes, i know you said this wouldn't work, just pointin it out though .
__________________
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
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 06-13-2006 , 16:22  
Reply With Quote #10

Quote:
Originally Posted by Lord_Destros
Ummmm, that shouldn't work at all.

1. You never created a method named clcmd_buy
2. You never set origin on where NPC (the store only, not the model) should appear, I believe this would cause /buy to work anywhere around the map.

Yes, yes, i know you said this wouldn't work, just pointin it out though .
Maybe you didn't check to see that I didn't even focus on adding the NPC part, only the menu + command. He can implement that into his command later. I didn't include it because I don't know much about NPC's and I don't want to mess him up.
Peli is offline
Send a message via MSN to Peli
Reply


Thread Tools
Display Modes

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