stats help
#1

So I have made a stats but I got a prob...

Код:
format(string, sizeof(string), "VIP: %s - VIP Points: %d - Total Donations: $%d - Shop Coupon: $%d", RPVIPN(playerb), PlayerInfo[playerid][pLPoints], PlayerInfo[playerb][pDonations], PlayerInfo[playerb][pCoupon]);
    SendClientMessage(playerid, COLOR_VIP, string);
    if(PlayerInfo[playerid][pVIP]) format(string, sizeof(string), "VIP Expiration: %d/%d/2013", PlayerInfo[playerid][pVIPMonth], PlayerInfo[playerid][pVIPDay]);
    SendClientMessage(playerid, COLOR_VIP, string);
Now what is red should only show up if you are a VIP, But now if you are not VIP you see the line that is blue twice, But you no longer see the red line... Any idea how to fix this?
Reply
#2

Anyone at all?
Reply
#3

Have you tried an if statement?
Reply
#4

What do you mean?
Reply
#5

if they are a vip. show the correct line to them.

if they aren't VIP, show them the other line, or other applicable ones

It's called control structures
Reply
#6

I don't think I would need to do that though.
Reply
#7

Try this?

pawn Код:
format(string, sizeof(string), "VIP: %s - VIP Points: %d - Total Donations: $%d - Shop Coupon: $%d", RPVIPN(playerb), PlayerInfo[playerid][pLPoints], PlayerInfo[playerb][pDonations], PlayerInfo[playerb][pCoupon]);
SendClientMessage(playerid, COLOR_VIP, string);
if(PlayerInfo[playerid][pVIP])
{
    format(string, sizeof(string), "VIP Expiration: %d/%d/2013", PlayerInfo[playerid][pVIPMonth], PlayerInfo[playerid][pVIPDay]);
    SendClientMessage(playerid, COLOR_VIP, string);
}
Your problem was here

pawn Код:
if(PlayerInfo[playerid][pVIP]) format(string, sizeof(string), "VIP Expiration: %d/%d/2013", PlayerInfo[playerid][pVIPMonth], PlayerInfo[playerid][pVIPDay]);
    SendClientMessage(playerid, COLOR_VIP, string);
See the if- Line. If you're vip it formats the string. But if you're not it doesn't. Because of that sends the server last formatted text. So the Blue marked text again.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)