Is this possible ? After a cmd done, You can't repeat that CMD..
#1

The title says, is that possible for example, he typed /buyvip.. After he get his FREE VIP then he cannot repeat it again for entire life of his account.. I mean if he typed it again .. There will be a word that saying ... You already got your FREE VIP.. Here's my code..

Код:
CMD:buyvip(playerid, params[])
{
	{
	ShowPlayerDialogEx(playerid, BUYVIP, DIALOG_STYLE_LIST, "Buy Personal Donator Package", "Bronze Donator - {00FF00}Free\n{FFFFFF}Silver Donator - {00FF00}Free\n{FFFFFF}Gold Donator - {00FF00}Free", "Select", "Cancel");
	}
	return 1;
}
Код:
if(dialogid == BUYVIP)
    {
        if(response)
	    {
   			if(listitem == 0)
      		{
        		PlayerInfo[playerid][pDonator] = 1;
    			SendClientMessage(playerid, COLOR_YELLOW,"Server : You bought a free 31 days Bronze Donator Package!");
                new adminmessss[128];
				format(adminmessss, sizeof(adminmessss), "AdmCmd: %s has just get his/her free Bronze Donator Package!.", GetPlayerNameEx(playerid));
				ABroadCast(COLOR_LIGHTRED,adminmessss,1);
			  }
   			if(listitem == 1)
      		{

			PlayerInfo[playerid][pDonator] = 2;
    		SendClientMessage(playerid, COLOR_YELLOW,"Server : You have bought a free 31 days Silver Donator Package.");
            new vipmesss[128];
			format(vipmesss, sizeof(vipmesss), "AdmCmd: %s has just get his/her free Silver Donator Package!", GetPlayerNameEx(playerid));
			ABroadCast(COLOR_LIGHTRED,vipmesss,1);
			}
			if (listitem == 2)
			{
			
			PlayerInfo[playerid][pDonator] = 3;
			SendClientMessage(playerid, COLOR_YELLOW,"Server : You have bought a free 31 days Gold Donator Package.");
			new goldmess[128];
			format(goldmess, sizeof(goldmess), "AdmCmd: %s has just get his/her free Gold Donator Package!", GetPlayerNameEx(playerid));
			ABroadCast(COLOR_LIGHTRED,goldmess,1);
			}
		}
	}
+1 Reputation for who helps me.!
Reply
#2

Yes it is possible, by adding / saving / loading an additional bool variable.

new bool:Something[MAX_PLAYERS];
When he buys a vip :
Something[playerid] = true;
when he tries to access the cmd : check if(Something[playerid]==true) return sendclientmessage(playerid, -1, "already bought vip");

save and load it, done.
Reply
#3

LOL if its about a VIP system,you just check if he already bought VIP lol.Whats so hard?
Reply
#4

Код:
CMD:buyvip(playerid, params[])
{
	if(PlayerInfo[playerid][pDonator] >= 1)
	{
		SendClientMessage(playerid, COLOR_YELLOW, "    You are already a VIP-Player!.");
		return 1;
	}

	ShowPlayerDialogEx(playerid, BUYVIP, DIALOG_STYLE_LIST, "Buy Personal Donator Package", "Bronze Donator - {00FF00}Free\n{FFFFFF}Silver Donator - {00FF00}Free\n{FFFFFF}Gold Donator - {00FF00}Free", "Select", "Cancel");
	
	return 1;
}
Reply
#5

@Patrik,

he wants it so they can't type it again ever... Not if they have VIP already...

Basically do something like this, #OP:
pawn Код:
CMD:buyvip(playerid, params[])
{
    if(PlayerInfo[playerid][pDonateGotten] >= 1)
    {
        SendClientMessage(playerid, COLOR_YELLOW, "    You are already a VIP-Player!.");
        return 1;
    }

    ShowPlayerDialogEx(playerid, BUYVIP, DIALOG_STYLE_LIST, "Buy Personal Donator Package", "Bronze Donator - {00FF00}Free\n{FFFFFF}Silver Donator - {00FF00}Free\n{FFFFFF}Gold Donator - {00FF00}Free", "Select", "Cancel");
    return 1;
}
Then...
pawn Код:
if(dialogid == BUYVIP)
    {
        if(response)
        {
            if(listitem == 0)
            {
                PlayerInfo[playerid][pDonator] = 1;
                        PlayerInfo[playerid][pDonateGotten] = 1;
                SendClientMessage(playerid, COLOR_YELLOW,"Server : You bought a free 31 days Bronze Donator Package!");
                new adminmessss[128];
                format(adminmessss, sizeof(adminmessss), "AdmCmd: %s has just get his/her free Bronze Donator Package!.", GetPlayerNameEx(playerid));
                ABroadCast(COLOR_LIGHTRED,adminmessss,1);
              }
            if(listitem == 1)
            {

            PlayerInfo[playerid][pDonator] = 2;
                        PlayerInfo[playerid][pDonateGotten] = 1;
            SendClientMessage(playerid, COLOR_YELLOW,"Server : You have bought a free 31 days Silver Donator Package.");
            new vipmesss[128];
            format(vipmesss, sizeof(vipmesss), "AdmCmd: %s has just get his/her free Silver Donator Package!", GetPlayerNameEx(playerid));
            ABroadCast(COLOR_LIGHTRED,vipmesss,1);
            }
            if (listitem == 2)
            {
           
            PlayerInfo[playerid][pDonator] = 3;
                        PlayerInfo[playerid][pDonateGotten] = 1;
            SendClientMessage(playerid, COLOR_YELLOW,"Server : You have bought a free 31 days Gold Donator Package.");
            new goldmess[128];
            format(goldmess, sizeof(goldmess), "AdmCmd: %s has just get his/her free Gold Donator Package!", GetPlayerNameEx(playerid));
            ABroadCast(COLOR_LIGHTRED,goldmess,1);
            }
        }
    }
Make sure you incorporate the DonateGotten variable into your loading / saving system.
Reply
#6

Thanks Abagail +1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)