SA-MP Forums Archive
Help with VIP tokens - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with VIP tokens (/showthread.php?tid=443830)



Help with VIP tokens - Grooty - 14.06.2013

Help, I'm getting the materials but it's not taking away or using my VIP tokens, OR giving me the string it's supposed to.
Here's the code.

Код:
	        {

    			if(PlayerInfo[playerid][pDonateRank] < 1)
			    {
			        if(PlayerInfo[playerid][pTokens] < 1)
			        {
			            SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You do not have enough tokens for the materials.");
			            return 1;
			        }
		    		PlayerInfo[playerid][pTokens] -= 1;
					format(string, sizeof(string), "VIP: You have traded 1 token for 1000 materials, you now have %d token(s).", PlayerInfo[playerid][pTokens]);
			        SendClientMessageEx(playerid, COLOR_YELLOW, string);
				}
				new currentmats = PlayerInfo[playerid][pMats];
				PlayerInfo[playerid][pMats] = currentmats +1000;
	        }



Re: Help with VIP tokens - Goldilox - 14.06.2013

I would do something like this.

pawn Код:
PlayerInfo[playerid][pTokens] = PlayerInfo[playerid][pTokens] - 1;
+rep if worked please!


Re: Help with VIP tokens - Grooty - 14.06.2013

Quote:
Originally Posted by Goldilox
Посмотреть сообщение
I would do something like this.

pawn Код:
PlayerInfo[playerid][pTokens] = PlayerInfo[playerid][pTokens] - 1;
+rep if worked please!
Nope, didn't work :/


Re: Help with VIP tokens - Goldenfox - 14.06.2013

Try:
Код:
	        {

    			if(PlayerInfo[playerid][pDonateRank] < 1)
			    {
			        if(PlayerInfo[playerid][pTokens] < 1)
			        {
			            SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You do not have enough tokens for the materials.");
			            return 1;
			        }
		    		PlayerInfo[playerid][pTokens] -= 1;
					format(string, sizeof(string), "VIP: You have traded 1 token for 1000 materials, you now have %d token(s).", PlayerInfo[playerid][pTokens]);
			        SendClientMessageEx(playerid, COLOR_YELLOW, string);
				new currentmats = PlayerInfo[playerid][pMats];
				PlayerInfo[playerid][pMats] = currentmats +1000;
                        }
	        }



Re: Help with VIP tokens - Grooty - 15.06.2013

Quote:
Originally Posted by Goldenfox
Посмотреть сообщение
Try:
{

if(PlayerInfo[playerid][pDonateRank] < 1)
{
if(PlayerInfo[playerid][pTokens] < 1)
{
SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You do not have enough tokens for the materials.");
return 1;
}
PlayerInfo[playerid][pTokens] -= 1;
format(string, sizeof(string), "VIP: You have traded 1 token for 1000 materials, you now have %d token(s).", PlayerInfo[playerid][pTokens]);
SendClientMessageEx(playerid, COLOR_YELLOW, string);
new currentmats = PlayerInfo[playerid][pMats];
PlayerInfo[playerid][pMats] = currentmats +1000;
}
}
Can you put that in [code] tags please?


Re: Help with VIP tokens - ToiletDuck - 15.06.2013

pawn Код:
{

                if(PlayerInfo[playerid][pDonateRank] < 1)
                {
                    if(PlayerInfo[playerid][pTokens] < 1)
                    {
                        SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You do not have enough tokens for the materials.");
                        return 1;
                    }
                        PlayerInfo[playerid][pTokens] --;
                    format(string, sizeof(string), "VIP: You have traded 1 token for 1000               materials, you now have %d token(s).", PlayerInfo[playerid][pTokens]);
                        new currentmats = PlayerInfo[playerid][pMats];
                        PlayerInfo[playerid][pMats] = currentmats +1000;
                }
            }