Advertisement
ColdWar-Pawn

Tabit | KnifeShop | NOT MINE

May 29th, 2013
698
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.89 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4.  
  5. #define MaxKnives 3
  6.  
  7.  
  8. enum _:Knives
  9. {
  10.     Name[128],
  11.     Price
  12. };
  13.  
  14.  
  15. new const szKnives[MaxKnives] [Knives] =
  16. {
  17.     { "Begginer Knife", 20000 },
  18.     { "Advanced Knife", 30000 },
  19.     { "Master Knife", 40000 }
  20. };
  21.  
  22. new iKnife[33];
  23.  
  24. public plugin_init()
  25.     register_clcmd("say /menu", "pShop")
  26.  
  27.  
  28. public pShop(id) {
  29.     new iMenu = menu_create("HeadLine", "Handler")
  30.    
  31.     new szItem[64];
  32.    
  33.     formatex(szItem, charsmax(szItem), "The Knife Is \y[\r%s\y]", szKnives[iKnife[id]][Name])
  34.     menu_additem(iMenu, szItem, "0")
  35.    
  36.     menu_display(id, iMenu)
  37. }
  38.  
  39.  
  40. public Handler (id, iMenu, item)
  41. {
  42.     if(item == MENU_EXIT)
  43.     {
  44.         menu_destroy(iMenu)
  45.         return 1;
  46.     }
  47.    
  48.     switch(item)
  49.     {
  50.         case 0:
  51.         {
  52.             iKnife[id] ++;
  53.            
  54.             if( iKnife == MaxKnives )
  55.                 iKnife[id] = 0;
  56.            
  57.             return pShop(id);
  58.         }
  59.     }
  60.     menu_destroy (iMenu)
  61.     return 1;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement