Coding Help/Re-API Supported
-
Mark
- VIP
- Posts: 283
- Joined: 5 years ago
- Location: Des Moines/USA
-
Contact:
-
Quote
-
0
login to like this post
#1
Post
by Mark » 5 years 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.
public BuyVipMenu( id )
{
new vipMenu = menu_create( "\rBuy VIP^n^n Cost: %s ^m Expires: %s", "menu_handler", get_pcvar_num(VIP_Cost), sdate);
menu_additem( vipMenu, "\wBuy Vip with escape coins!", "", 0 );
menu_setprop( vipMenu, MPROP_EXIT, MEXIT_ALL );
menu_display( id, vipMenu, 0 );
}
-
Raheem
- Mod Developer
- Posts: 2214
- Joined: 7 years ago
-
Contact:
-
Quote
-
0
login to like this post
#2
Post
by Raheem » 5 years ago
We format text and save it in a variable then display it in our menu:
new szTitle[128]
formatex(szTitle, charsmax(szTitle), "\rBuy VIP^n^n Cost: %i ^n Expires: %s", get_pcvar_num(VIP_Cost), sdate)
new iVIPMenu
iVIPMenu = menu_create(szTitle, "Menu_Handler")
He who fails to plan is planning to fail
-
Mark
- VIP
- Posts: 283
- Joined: 5 years ago
- Location: Des Moines/USA
-
Contact:
-
Quote
-
0
login to like this post
#3
Post
by Mark » 5 years ago
Raheem wrote: ↑5 years ago
We format text and save it in a variable then display it in our menu:
new szTitle[128]
formatex(szTitle, charsmax(szTitle), "\rBuy VIP^n^n Cost: %i ^n Expires: %s", get_pcvar_num(VIP_Cost), sdate)
new iVIPMenu
iVIPMenu = menu_create(szTitle, "Menu_Handler")
Umm so like this? did not work explain more
public BuyVipMenu( id )
{
new szTitle[128]
formatex(szTitle, charsmax(szTitle), "\rBuy VIP^n^n Cost: %i ^n Expires: %s", get_pcvar_num(VIP_Cost), sdate)
new vipMenu = menu_create(szTitle, "Menu_Handler");
menu_additem( vipMenu, "\yPurchase Vip++!\w", "", 0 );
menu_setprop( vipMenu, MPROP_EXIT, MEXIT_ALL );
menu_display( id, vipMenu, 0 );
}
-
Raheem
- Mod Developer
- Posts: 2214
- Joined: 7 years ago
-
Contact:
-
Quote
-
0
login to like this post
#4
Post
by Raheem » 5 years 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.
He who fails to plan is planning to fail
-
Mark
- VIP
- Posts: 283
- Joined: 5 years ago
- Location: Des Moines/USA
-
Contact:
-
Quote
-
0
login to like this post
#5
Post
by Mark » 5 years ago
Menu won't open in game
get_date(get_pcvar_num(g_vip_buy_time), sdate, charsmax(sdate))
stock get_date(days, string[], chars) {
new y, m, d
date(y, m ,d)
d+=days
new go = true
while(go) {
switch(m) {
case 1,3, 5, 7, 8, 10: {
if(d>31) { d=d-31; m++; }
else go = false
}
case 2: {
if(d>28) { d=d-28; m++; }
else go = false
}
case 4, 6, 9, 11: {
if(d>30) { d=d-30; m++; }
else go = false
}
case 12: {
if(d>31) { d=d-31; y++; m=1; }
else go = false
}
}
}
formatex(string, chars, "%d-%d-%d", m, d ,y)
}
-
Mark
- VIP
- Posts: 283
- Joined: 5 years ago
- Location: Des Moines/USA
-
Contact:
-
Quote
-
0
login to like this post
#6
Post
by Mark » 5 years ago
RapidFlush wrote: ↑5 years ago
Menu won't open in game
get_date(get_pcvar_num(g_vip_buy_time), sdate, charsmax(sdate))
stock get_date(days, string[], chars) {
new y, m, d
date(y, m ,d)
d+=days
new go = true
while(go) {
switch(m) {
case 1,3, 5, 7, 8, 10: {
if(d>31) { d=d-31; m++; }
else go = false
}
case 2: {
if(d>28) { d=d-28; m++; }
else go = false
}
case 4, 6, 9, 11: {
if(d>30) { d=d-30; m++; }
else go = false
}
case 12: {
if(d>31) { d=d-31; y++; m=1; }
else go = false
}
}
}
formatex(string, chars, "%d-%d-%d", m, d ,y)
}
Even if i take sdate out it still does not work
-
Raheem
- Mod Developer
- Posts: 2214
- Joined: 7 years ago
-
Contact:
-
Quote
-
0
login to like this post
#7
Post
by Raheem » 5 years ago
Menu is showing or not?
He who fails to plan is planning to fail
-
Mark
- VIP
- Posts: 283
- Joined: 5 years ago
- Location: Des Moines/USA
-
Contact:
-
Quote
-
0
login to like this post
#8
Post
by Mark » 5 years ago
Raheem im sorry friend i made a mistype with spelling it seems to be working now thanks!
-
Raheem
- Mod Developer
- Posts: 2214
- Joined: 7 years ago
-
Contact:
-
Quote
-
0
login to like this post
#9
Post
by Raheem » 5 years ago
He who fails to plan is planning to fail
-
Mark
- VIP
- Posts: 283
- Joined: 5 years ago
- Location: Des Moines/USA
-
Contact:
-
Quote
-
0
login to like this post
#10
Post
by Mark » 5 years ago
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute
Register
Sign in
Users browsing this forum: No registered users and 7 guests