VIP Timer...
#1

How comes this VIP timer dont work ? I have been trying for ages please help me


pawn Код:
command(changeviplevel, playerid, params[])
{
    new level, id, string[128], string2[128];
    if(sscanf(params, "ud", id, level))
    {
        if(Player[playerid][AdminLevel] >= 1)
        {
            SendClientMessage(playerid, WHITE, "SYNTAX: /changeviplevel [playerid] [level]");
        }
    }
    else
    {
        if(Player[playerid][AdminLevel] >= 5)
        {
            if(level > 4 ) return SendClientMessage(playerid, RED, "Avaliable levels 1 - 4");
            if(IsPlayerConnectedEx(id))
            {
                Player[id][VipRank] = level;
                if(level == 1)
                {
                    new VIPTime = gettime() + 2592000;
                    SetPVarInt(playerid, "VIPTime", VIPTime);
                }

                format(string, sizeof(string), "%s's VIP level has been changed to %d, by %s.", GetName(id), level, GetName(playerid));
                format(string2, sizeof(string2), "%s's VIP level has been changed to %d by %s.", GetName(id), level, GetName(playerid));
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnectedEx(i) && Player[i][VipRank] >= 1)
                    {
                        SendClientMessage(i, YELLOW, string);
                        SetPlayerColor(playerid, YELLOW);
                    }
                    if(level == 0)
                    {
                        SendClientMessage(i, YELLOW, string2);
                        SetPlayerColor(playerid, WHITE);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, WHITE, "That player is not connected or isn't logged in.");
            }
        }
    }
    return 1;
}
pawn Код:
OnPlayerConnect(playerid)
{
            new timestamp = gettime();
    new VIPTime =  GetPVarInt(playerid, "VIPTime");

    if(timestamp > VIPTime)
    {
        SendClientMessage(playerid, WHITE, "Your VIP has been taken away because the VIP time is up");
        Player[playerid][VipRank] = 0;
    }
    else
    {
        SendClientMessage(playerid, WHITE, "Hi");
    }
}
Thank You
Reply
#2

You need to save the VIPTime in the person's file
Reply
#3

Quote:
Originally Posted by JhnzRep
Посмотреть сообщение
You need to save the VIPTime in the person's file
How would i do that

Also when i connect it says Sorry your VIP has run out..

Thank You
Reply
#4

Do you have a registration system? If so what saving system do you use(y_ini, dini, etc.)
Reply
#5

Quote:
Originally Posted by JhnzRep
Посмотреть сообщение
Do you have a registration system? If so what saving system do you use(y_ini, dini, etc.)
Im using dini

Thank You
Reply
#6

Can you post your PlayerInfo enum and save function here.

Or in my PM please.
Reply
#7

Unix Time stamps.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)