Resolved Buy Vip Menu

Coding Help/Re-API Supported
Post Reply
User avatar
Mark
Senior Member
Senior Member
United States of America
Posts: 279
Joined: 10 Months Ago
Location: Des Moines/USA
Donation: 1x donated in total €10.00
Has thanked: 6 times
Been thanked: 21 times
Age: 33
Contact:

Buy Vip Menu

#1

Post by Mark » 9 Months Ago

is this possible tried a few things can't figure it out

Im trying to show extra information that will call the expire and cost.
  1.  public BuyVipMenu( id )
  2.  {
  3.     new vipMenu = menu_create( "\rBuy VIP^n^n Cost: %s ^m Expires: %s", "menu_handler", get_pcvar_num(VIP_Cost), sdate);
  4.    
  5.     menu_additem( vipMenu, "\wBuy Vip with escape coins!", "", 0 );
  6.  
  7.     menu_setprop( vipMenu, MPROP_EXIT, MEXIT_ALL );
  8.     menu_display( id, vipMenu, 0 );
  9.  
  10.  }

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1794
Joined: 2 Years Ago
Location: Egypt
Has thanked: 31 times
Been thanked: 89 times
Age: 21
Contact:

#2

Post by Raheem » 9 Months Ago

We format text and save it in a variable then display it in our menu:
    1. new szTitle[128]
    2.  
    3. formatex(szTitle, charsmax(szTitle), "\rBuy VIP^n^n Cost: %i ^n Expires: %s", get_pcvar_num(VIP_Cost), sdate)
    4.  
    5. new iVIPMenu
    6.  
    7. iVIPMenu = menu_create(szTitle, "Menu_Handler")
You don't know? Learn and you will know.

User avatar
Mark
Senior Member
Senior Member
United States of America
Posts: 279
Joined: 10 Months Ago
Location: Des Moines/USA
Donation: 1x donated in total €10.00
Has thanked: 6 times
Been thanked: 21 times
Age: 33
Contact:

#3

Post by Mark » 9 Months Ago

Raheem wrote:
9 Months Ago
We format text and save it in a variable then display it in our menu:
    1. new szTitle[128]
    2.  
    3. formatex(szTitle, charsmax(szTitle), "\rBuy VIP^n^n Cost: %i ^n Expires: %s", get_pcvar_num(VIP_Cost), sdate)
    4.  
    5. new iVIPMenu
    6.  
    7. iVIPMenu = menu_create(szTitle, "Menu_Handler")
Umm so like this? did not work explain more :D
  1.  public BuyVipMenu( id )
  2.  {
  3.     new szTitle[128]
  4.  
  5.     formatex(szTitle, charsmax(szTitle), "\rBuy VIP^n^n Cost: %i ^n Expires: %s", get_pcvar_num(VIP_Cost), sdate)
  6.  
  7.     new vipMenu = menu_create(szTitle, "Menu_Handler");
  8.    
  9.     menu_additem( vipMenu, "\yPurchase Vip++!\w", "", 0 );
  10.  
  11.     menu_setprop( vipMenu, MPROP_EXIT, MEXIT_ALL );
  12.     menu_display( id, vipMenu, 0 );
  13.  
  14.  }

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1794
Joined: 2 Years Ago
Location: Egypt
Has thanked: 31 times
Been thanked: 89 times
Age: 21
Contact:

#4

Post by Raheem » 9 Months Ago

What this variable contain: sdate?

Also let me know what the problem now. It's not compiling or it's not showing right in game? give more information.
You don't know? Learn and you will know.

User avatar
Mark
Senior Member
Senior Member
United States of America
Posts: 279
Joined: 10 Months Ago
Location: Des Moines/USA
Donation: 1x donated in total €10.00
Has thanked: 6 times
Been thanked: 21 times
Age: 33
Contact:

#5

Post by Mark » 9 Months Ago

Menu won't open in game
  1. get_date(get_pcvar_num(g_vip_buy_time), sdate, charsmax(sdate))

  1. stock get_date(days, string[], chars) {
  2.    
  3.     new y, m, d
  4.     date(y, m ,d)
  5.    
  6.     d+=days
  7.    
  8.     new go = true
  9.     while(go) {
  10.         switch(m) {
  11.             case 1,3, 5, 7, 8, 10: {
  12.                 if(d>31) { d=d-31; m++; }
  13.                 else go = false
  14.             }
  15.             case 2: {
  16.                 if(d>28) { d=d-28; m++; }
  17.                 else go = false
  18.             }
  19.             case 4, 6, 9, 11: {
  20.                 if(d>30) { d=d-30; m++; }
  21.                 else go = false
  22.             }
  23.             case 12: {
  24.                 if(d>31) { d=d-31; y++; m=1; }
  25.                 else go = false
  26.             }
  27.         }
  28.     }
  29.     formatex(string, chars, "%d-%d-%d", m, d ,y)
  30. }

User avatar
Mark
Senior Member
Senior Member
United States of America
Posts: 279
Joined: 10 Months Ago
Location: Des Moines/USA
Donation: 1x donated in total €10.00
Has thanked: 6 times
Been thanked: 21 times
Age: 33
Contact:

#6

Post by Mark » 9 Months Ago

RapidFlush wrote:
9 Months Ago
Menu won't open in game
  1. get_date(get_pcvar_num(g_vip_buy_time), sdate, charsmax(sdate))

  1. stock get_date(days, string[], chars) {
  2.    
  3.     new y, m, d
  4.     date(y, m ,d)
  5.    
  6.     d+=days
  7.    
  8.     new go = true
  9.     while(go) {
  10.         switch(m) {
  11.             case 1,3, 5, 7, 8, 10: {
  12.                 if(d>31) { d=d-31; m++; }
  13.                 else go = false
  14.             }
  15.             case 2: {
  16.                 if(d>28) { d=d-28; m++; }
  17.                 else go = false
  18.             }
  19.             case 4, 6, 9, 11: {
  20.                 if(d>30) { d=d-30; m++; }
  21.                 else go = false
  22.             }
  23.             case 12: {
  24.                 if(d>31) { d=d-31; y++; m=1; }
  25.                 else go = false
  26.             }
  27.         }
  28.     }
  29.     formatex(string, chars, "%d-%d-%d", m, d ,y)
  30. }
Even if i take sdate out it still does not work :D

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1794
Joined: 2 Years Ago
Location: Egypt
Has thanked: 31 times
Been thanked: 89 times
Age: 21
Contact:

#7

Post by Raheem » 9 Months Ago

Menu is showing or not?
You don't know? Learn and you will know.

User avatar
Mark
Senior Member
Senior Member
United States of America
Posts: 279
Joined: 10 Months Ago
Location: Des Moines/USA
Donation: 1x donated in total €10.00
Has thanked: 6 times
Been thanked: 21 times
Age: 33
Contact:

#8

Post by Mark » 9 Months Ago

Raheem im sorry friend i made a mistype with spelling it seems to be working now thanks!

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1794
Joined: 2 Years Ago
Location: Egypt
Has thanked: 31 times
Been thanked: 89 times
Age: 21
Contact:

#9

Post by Raheem » 9 Months Ago

:flushed: :joy:
You don't know? Learn and you will know.

User avatar
Mark
Senior Member
Senior Member
United States of America
Posts: 279
Joined: 10 Months Ago
Location: Des Moines/USA
Donation: 1x donated in total €10.00
Has thanked: 6 times
Been thanked: 21 times
Age: 33
Contact:

#10

Post by Mark » 9 Months Ago

Raheem wrote:
9 Months Ago
:flushed: :joy:
:lol: :lol: :lol:

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest