/setvip syntaxis
#1

Hey guys, im struggeling with my VIP system, as of now i have the setvip command very simple its as mentioned below, However i wish to save the VIP data in a different table uing [pData][Playerid][ID]
and [pData][playerid][Username], i would like to check using these, however as of now it just saves in my player table, but thats not what i really wanted, i wanted to make a different table for VIP, and also making /setvip [level], granting someone one month of vip, however im not quite sure on how to do so.

In the Vip table it should contain
[ID] [Username] [Viplevel] [Granteddate] [Expirydate] [Active]
something like that,
anyone has any idea on how to realize this?

the setvip command :
Код:
CMD:setvip(playerid, params[])
{
        new lookupid, str[128], level;
        if(pData[playerid][Admin] == 6)
        {

                if(sscanf(params,"ud",lookupid,level)) return SendClientMessage(playerid, COLOR_WHITE, "{ff387a}[Admin]:{ffffff} /setvip [ID | Name] [level]");
                if(pData[lookupid][VIP] > pData[playerid][VIP]) return SendClientMessage(playerid, COLOR_WHITE, "{ff0000}[Error]: {ffffff}You are not authorized to use this command.");
                if(level < 1 ||level > 5) return SendClientMessage(playerid, COLOR_WHITE,  "{ff0000}[Error]:{ffffff} You can only set levels 1 to 5.");
                if(!IsPlayerConnected(lookupid)) return SendClientMessage(playerid, COLOR_WHITE, "{ff0000}[Error]{ffffff} This player is not connected.");
                if(level < pData[lookupid][VIP])
                {
                        format(str, sizeof(str), "{ff387a}[Admin]:{ffffff} %s (ID:%d) has demoted you to VIP level %d!",GetName(playerid), playerid, level);
                        SendClientMessage(lookupid, COLOR_WHITE, str);
                        format(str, sizeof(str),"{ff387a}[Admin]:{ffffff} You have demoted %s (ID:%d) to VIP level %d!",GetName(lookupid),lookupid,level);
                        SendClientMessage(playerid, COLOR_WHITE, str);
                        pData[lookupid][VIP] = level;
                        SavePlayerData(lookupid);
                }
                if(level > pData[lookupid][VIP])
                {
                        format(str, sizeof(str), "{ff387a}[Admin]:{ffffff} %s (ID:%d) has promoted you to VIP level %d!",GetName(playerid), playerid, level);
                        SendClientMessage(lookupid, COLOR_WHITE, str);
                        format(str, sizeof(str),"{ff387a}[Admin]:{ffffff} You have promoted %s (ID:%d) to VIP level %d!",GetName(lookupid),lookupid,level);
                        SendClientMessage(playerid, COLOR_WHITE, str);
                        pData[lookupid][VIP] = level;
                        SavePlayerData(lookupid);
                }
        }
        else return SendClientMessage(playerid, COLOR_WHITE, "{ff0000}[Error]{ffffff}You are not authorized to use this command.");
        return 1;
}
Reply


Messages In This Thread
/setvip syntaxis - by yvoms - 11.12.2015, 12:54
Re: /setvip syntaxis - by yvoms - 11.12.2015, 13:13
Re: /setvip syntaxis - by vassilis - 11.12.2015, 13:22
Re: /setvip syntaxis - by yvoms - 11.12.2015, 13:31
Re: /setvip syntaxis - by vassilis - 11.12.2015, 13:36
Re: /setvip syntaxis - by yvoms - 11.12.2015, 13:38
Re: /setvip syntaxis - by vassilis - 11.12.2015, 13:46
Re: /setvip syntaxis - by yvoms - 11.12.2015, 13:53
Re: /setvip syntaxis - by vassilis - 11.12.2015, 13:58
Re: /setvip syntaxis - by yvoms - 11.12.2015, 14:01

Forum Jump:


Users browsing this thread: 1 Guest(s)