SHOP System problem
#1

Код:
if(dialogid == DIALOG_VSHOP) // Misc
	{
		if(response)
		{
			if(listitem == 0)
			{
			if(PlayerInfo[playerid][Cookies] < 10000) return SendClientMessage(playerid,  -1, "{FF0000}ERROR : You dont have enough cookies to be V.I.P 1!");
			if(PlayerInfo[playerid][LoggedIn] == 1 && PlayerInfo[playerid][Vip] == 0)//logged is an example.Replace it with your login variable.
			{
                PlayerInfo[playerid][Vip] = 1;
                PlayerInfo[playerid][Cookies] -= 10000;
                GameTextForPlayer(playerid,"Vip Promoted", 2000, 3);
                SendClientMessage(playerid, -1, "{00FF40}You have received {FF0000}V.I.P {00FF40}Status 1");
                SendClientMessage(playerid, -1, "{00FF40}Use /vcmds or /vcmd1 to see {FF0000}/VIPS {00FF40}Commands");
                SavePlayer(playerid);
			}
			else SendClientMessage(playerid, -1, "{FF0000}ERROR : {00FF40}You already received {FF0000}V.I.P {00FF40}Status 1");
			}
			if(listitem == 1)
			{
			if(PlayerInfo[playerid][Cookies] < 20000) return SendClientMessage(playerid,  -1, "{FF0000}ERROR : You dont have enough cookies to be V.I.P 2!");
			if(PlayerInfo[playerid][LoggedIn] == 1 && PlayerInfo[playerid][Vip] == 1)//logged is an example.Replace it with your login variable.
			{
                PlayerInfo[playerid][Vip] = 2;
                PlayerInfo[playerid][Cookies] -= 20000;
                GameTextForPlayer(playerid,"Vip Promoted", 2000, 3);
                SendClientMessage(playerid, -1, "{00FF40}You have received {FF0000}V.I.P {00FF40}Status 2");
                SendClientMessage(playerid, -1, "{00FF40}Use /vcmds or /vcmd1 to see {FF0000}/VIPS {00FF40}Commands");
                SavePlayer(playerid);
			}
			else SendClientMessage(playerid, -1, "{FF0000}ERROR : {00FF40}You already received {FF0000}V.I.P {00FF40}Status 2");
			}
			if(listitem == 2)
			{
			if(PlayerInfo[playerid][Cookies] < 30000) return SendClientMessage(playerid,  -1, "{FF0000}ERROR : You dont have enough cookies to be V.I.P 3!");
			if(PlayerInfo[playerid][LoggedIn] == 1 && PlayerInfo[playerid][Vip] == 2)//logged is an example.Replace it with your login variable.
			{
                PlayerInfo[playerid][Vip] = 3;
                PlayerInfo[playerid][Cookies] -= 30000;
                GameTextForPlayer(playerid,"Vip Promoted", 2000, 3);
                SendClientMessage(playerid, -1, "{00FF40}You have received {FF0000}V.I.P {00FF40}Status 3");
                SendClientMessage(playerid, -1, "{00FF40}Use /vcmds or /vcmd1 to see {FF0000}/VIPS {00FF40}Commands");
                SavePlayer(playerid);
			}
			else SendClientMessage(playerid, -1, "{FF0000}ERROR : {00FF40}You already received {FF0000}V.I.P {00FF40}Status 3");
			}
		}
		return 1;
	}
they must buy v.i.p 1/2 before buy v.i.p 3

so how to make someone with non vip clan buy v.i.p 3 without buy v.i.p 1/2 ?

coz it said i already received v.i.p status 3
Reply
#2

PHP код:
if(dialogid == DIALOG_VSHOP// Misc
    
{
        if(
response)
        {
            if(
listitem == 0)
            {
            if(
PlayerInfo[playerid][Cookies] < 10000) return SendClientMessage(playerid,  -1"{FF0000}ERROR : You dont have enough cookies to be V.I.P 1!");
            if(
PlayerInfo[playerid][LoggedIn] == && PlayerInfo[playerid][Vip] == 0)//logged is an example.Replace it with your login variable.
            
{
                
PlayerInfo[playerid][Vip] = 1;
                
PlayerInfo[playerid][Cookies] -= 10000;
                
GameTextForPlayer(playerid,"Vip Promoted"20003);
                
SendClientMessage(playerid, -1"{00FF40}You have received {FF0000}V.I.P {00FF40}Status 1");
                
SendClientMessage(playerid, -1"{00FF40}Use /vcmds or /vcmd1 to see {FF0000}/VIPS {00FF40}Commands");
                
SavePlayer(playerid);
            }
            else 
SendClientMessage(playerid, -1"{FF0000}ERROR : {00FF40}You already received {FF0000}V.I.P {00FF40}Status 1");
            }
            if(
listitem == 1)
            {
            if(
PlayerInfo[playerid][Cookies] < 20000) return SendClientMessage(playerid,  -1"{FF0000}ERROR : You dont have enough cookies to be V.I.P 2!");
            if(
PlayerInfo[playerid][LoggedIn] == && PlayerInfo[playerid][Vip] == 1)//logged is an example.Replace it with your login variable.
            
{
                
PlayerInfo[playerid][Vip] = 2;
                
PlayerInfo[playerid][Cookies] -= 20000;
                
GameTextForPlayer(playerid,"Vip Promoted"20003);
                
SendClientMessage(playerid, -1"{00FF40}You have received {FF0000}V.I.P {00FF40}Status 2");
                
SendClientMessage(playerid, -1"{00FF40}Use /vcmds or /vcmd1 to see {FF0000}/VIPS {00FF40}Commands");
                
SavePlayer(playerid);
            }
            else 
SendClientMessage(playerid, -1"{FF0000}ERROR : {00FF40}You already received {FF0000}V.I.P {00FF40}Status 2");
            }
            if(
listitem == 2)
            {
            if(
PlayerInfo[playerid][Cookies] < 30000) return SendClientMessage(playerid,  -1"{FF0000}ERROR : You dont have enough cookies to be V.I.P 3!");
            if(
PlayerInfo[playerid][LoggedIn] == 1)//logged is an example.Replace it with your login variable.
            
{
                
PlayerInfo[playerid][Vip] = 3;
                
PlayerInfo[playerid][Cookies] -= 30000;
                
GameTextForPlayer(playerid,"Vip Promoted"20003);
                
SendClientMessage(playerid, -1"{00FF40}You have received {FF0000}V.I.P {00FF40}Status 3");
                
SendClientMessage(playerid, -1"{00FF40}Use /vcmds or /vcmd1 to see {FF0000}/VIPS {00FF40}Commands");
                
SavePlayer(playerid);
            }
            else 
SendClientMessage(playerid, -1"{FF0000}ERROR : {00FF40}You already received {FF0000}V.I.P {00FF40}Status 3");
            }
        }
        return 
1;
    } 
With this, it will no longer require you to be vip 2 in order to be vip 3.
Reply
#3

Quote:
Originally Posted by iLearner
Посмотреть сообщение
PHP код:
if(dialogid == DIALOG_VSHOP// Misc
    
{
        if(
response)
        {
            if(
listitem == 0)
            {
            if(
PlayerInfo[playerid][Cookies] < 10000) return SendClientMessage(playerid,  -1"{FF0000}ERROR : You dont have enough cookies to be V.I.P 1!");
            if(
PlayerInfo[playerid][LoggedIn] == && PlayerInfo[playerid][Vip] == 0)//logged is an example.Replace it with your login variable.
            
{
                
PlayerInfo[playerid][Vip] = 1;
                
PlayerInfo[playerid][Cookies] -= 10000;
                
GameTextForPlayer(playerid,"Vip Promoted"20003);
                
SendClientMessage(playerid, -1"{00FF40}You have received {FF0000}V.I.P {00FF40}Status 1");
                
SendClientMessage(playerid, -1"{00FF40}Use /vcmds or /vcmd1 to see {FF0000}/VIPS {00FF40}Commands");
                
SavePlayer(playerid);
            }
            else 
SendClientMessage(playerid, -1"{FF0000}ERROR : {00FF40}You already received {FF0000}V.I.P {00FF40}Status 1");
            }
            if(
listitem == 1)
            {
            if(
PlayerInfo[playerid][Cookies] < 20000) return SendClientMessage(playerid,  -1"{FF0000}ERROR : You dont have enough cookies to be V.I.P 2!");
            if(
PlayerInfo[playerid][LoggedIn] == && PlayerInfo[playerid][Vip] == 1)//logged is an example.Replace it with your login variable.
            
{
                
PlayerInfo[playerid][Vip] = 2;
                
PlayerInfo[playerid][Cookies] -= 20000;
                
GameTextForPlayer(playerid,"Vip Promoted"20003);
                
SendClientMessage(playerid, -1"{00FF40}You have received {FF0000}V.I.P {00FF40}Status 2");
                
SendClientMessage(playerid, -1"{00FF40}Use /vcmds or /vcmd1 to see {FF0000}/VIPS {00FF40}Commands");
                
SavePlayer(playerid);
            }
            else 
SendClientMessage(playerid, -1"{FF0000}ERROR : {00FF40}You already received {FF0000}V.I.P {00FF40}Status 2");
            }
            if(
listitem == 2)
            {
            if(
PlayerInfo[playerid][Cookies] < 30000) return SendClientMessage(playerid,  -1"{FF0000}ERROR : You dont have enough cookies to be V.I.P 3!");
            if(
PlayerInfo[playerid][LoggedIn] == 1)//logged is an example.Replace it with your login variable.
            
{
                
PlayerInfo[playerid][Vip] = 3;
                
PlayerInfo[playerid][Cookies] -= 30000;
                
GameTextForPlayer(playerid,"Vip Promoted"20003);
                
SendClientMessage(playerid, -1"{00FF40}You have received {FF0000}V.I.P {00FF40}Status 3");
                
SendClientMessage(playerid, -1"{00FF40}Use /vcmds or /vcmd1 to see {FF0000}/VIPS {00FF40}Commands");
                
SavePlayer(playerid);
            }
            else 
SendClientMessage(playerid, -1"{FF0000}ERROR : {00FF40}You already received {FF0000}V.I.P {00FF40}Status 3");
            }
        }
        return 
1;
    } 
With this, it will no longer require you to be vip 2 in order to be vip 3.
and now,i must buy V.I.P 1 Before buy V.I.P 2
or it will say
Код:
SendClientMessage(playerid, -1, "{FF0000}ERROR : {00FF40}You already received {FF0000}V.I.P {00FF40}Status 2");
Reply
#4

You know, if you indented the code correctly, you'd likely see what you need to edit...

What iLearner has put up should work looking over it.

Is there maybe something else that is altering the VIP level in the enum outside of this code?

Such as a countdown timer or something...
Reply
#5

PHP код:
if(dialogid == DIALOG_VSHOP// Misc
    
{
        if(
response)
        {
            if(
listitem == 0)
            {

                if(
PlayerInfo[playerid][Cookies] < 10000) return SendClientMessage(playerid,  -1"{FF0000}ERROR : You dont have enough cookies to be V.I.P 1!");
                if(
PlayerInfo[playerid][LoggedIn] == && PlayerInfo[playerid][Vip] != 1)//logged is an example.Replace it with your login variable.
                
{
                    
PlayerInfo[playerid][Vip] = 1;
                    
PlayerInfo[playerid][Cookies] -= 10000;
                    
GameTextForPlayer(playerid,"Vip Promoted"20003);
                    
SendClientMessage(playerid, -1"{00FF40}You have received {FF0000}V.I.P {00FF40}Status 1");
                    
SendClientMessage(playerid, -1"{00FF40}Use /vcmds or /vcmd1 to see {FF0000}/VIPS {00FF40}Commands");
                    
SavePlayer(playerid);
                }
                else 
SendClientMessage(playerid, -1"{FF0000}ERROR : {00FF40}You already have {FF0000}V.I.P {00FF40}Status 1");
            }
            if(
listitem == 1)
            {
            if(
PlayerInfo[playerid][Cookies] < 20000) return SendClientMessage(playerid,  -1"{FF0000}ERROR : You dont have enough cookies to be V.I.P 2!");
            if(
PlayerInfo[playerid][LoggedIn] == && PlayerInfo[playerid][Vip] != 2)//logged is an example.Replace it with your login variable.
            
{
                
PlayerInfo[playerid][Vip] = 2;
                
PlayerInfo[playerid][Cookies] -= 20000;
                
GameTextForPlayer(playerid,"Vip Promoted"20003);
                
SendClientMessage(playerid, -1"{00FF40}You have received {FF0000}V.I.P {00FF40}Status 2");
                
SendClientMessage(playerid, -1"{00FF40}Use /vcmds or /vcmd1 to see {FF0000}/VIPS {00FF40}Commands");
                
SavePlayer(playerid);
            }
            else 
SendClientMessage(playerid, -1"{FF0000}ERROR : {00FF40}You already received {FF0000}V.I.P {00FF40}Status 2");
            }
            if(
listitem == 2)
            {
            if(
PlayerInfo[playerid][Cookies] < 30000) return SendClientMessage(playerid,  -1"{FF0000}ERROR : You dont have enough cookies to be V.I.P 3!");
            if(
PlayerInfo[playerid][LoggedIn] == && PlayerInfo[playerid][Vip] != 3)//logged is an example.Replace it with your login variable.
            
{
                
PlayerInfo[playerid][Vip] = 3;
                
PlayerInfo[playerid][Cookies] -= 30000;
                
GameTextForPlayer(playerid,"Vip Promoted"20003);
                
SendClientMessage(playerid, -1"{00FF40}You have received {FF0000}V.I.P {00FF40}Status 3");
                
SendClientMessage(playerid, -1"{00FF40}Use /vcmds or /vcmd1 to see {FF0000}/VIPS {00FF40}Commands");
                
SavePlayer(playerid);
            }
            else 
SendClientMessage(playerid, -1"{FF0000}ERROR : {00FF40}You already received {FF0000}V.I.P {00FF40}Status 3");
            }
        }
        return 
1;
    } 
Reply
#6

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
You know, if you indented the code correctly, you'd likely see what you need to edit...
Код:
if(PlayerInfo[playerid][LoggedIn] == 1 && PlayerInfo[playerid][Vip] <= 1)
for V.I.P 2

but

Код:
			if(PlayerInfo[playerid][Cookies] < 30000) return SendClientMessage(playerid,  -1, "{FF0000}ERROR : You dont have enough cookies to be V.I.P 3!");
			if(PlayerInfo[playerid][LoggedIn] == 1)//logged is an example.Replace it with your login variable.
			{
                PlayerInfo[playerid][Vip] = 3;
                PlayerInfo[playerid][Cookies] -= 30000;
                GameTextForPlayer(playerid,"Vip Promoted", 2000, 3);
                SendClientMessage(playerid, -1, "{00FF40}You have received {FF0000}V.I.P {00FF40}Status 3");
                SendClientMessage(playerid, -1, "{00FF40}Use /vcmds or /vcmd1 to see {FF0000}/VIPS {00FF40}Commands");
                SavePlayer(playerid);
			}
			else SendClientMessage(playerid, -1, "{FF0000}ERROR : {00FF40}You already received {FF0000}V.I.P {00FF40}Status 3");
			}
		}
if they already V.I.P 3 and click V.I.P 3 ,so they just waste their cookie .. so what should i do
Reply
#7

That should work
Reply
#8

Quote:
Originally Posted by AlexMSK
Посмотреть сообщение
PHP код:
if(PlayerInfo[playerid][LoggedIn] == && PlayerInfo[playerid][Vip] != 1)//logged is an example.Replace it with your login variable. 
This alone will fuck all the code...

If it's 0, it'll fire... If it's 1, it won't... If it's 2 it will again, and if it's 3 it will do so.


Effectively making code inaccessible.

Quote:
Originally Posted by KyNe
Посмотреть сообщение
Код:
if(PlayerInfo[playerid][LoggedIn] == 1 && PlayerInfo[playerid][Vip] <= 1)
Why are you even using this? This isn't what was pasted to you.
Reply
#9

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
This alone will fuck all the code...

If it's 0, it'll fire... If it's 1, it won't... If it's 2 it will again, and if it's 3 it will do so.


Effectively making code inaccessible.
0 should be none i guess? so if the player doesnt have that vip rank it'll give him, if he does then it wont, i dont know what's the problem with you acting like pro around here but i tried to help.
Reply
#10

Quote:
Originally Posted by AlexMSK
Посмотреть сообщение
0 should be none i guess? so if the player doesnt have that vip rank it'll give him, if he does then it wont, i dont know what's the problem with you acting like pro around here but i tried to help.
Код:
	if(dialogid == DIALOG_VSHOP) // Misc
	{
		if(response)
		{
			if(listitem == 0)
			{
			if(PlayerInfo[playerid][Cookies] < 2500) return SendClientMessage(playerid,  -1, "{FF0000}ERROR : You dont have enough cookies to be V.I.P 1!");
			if(PlayerInfo[playerid][LoggedIn] == 1 && PlayerInfo[playerid][Vip] == 0)//logged is an example.Replace it with your login variable.
			{
                PlayerInfo[playerid][Vip] = 1;
                PlayerInfo[playerid][Cookies] -= 2500;
                GameTextForPlayer(playerid,"Vip Promoted", 2000, 3);
                SendClientMessage(playerid, -1, "{00FF40}You have received {FF0000}V.I.P {00FF40}Status 1");
                SendClientMessage(playerid, -1, "{00FF40}Use /vcmds or /vcmd1 to see {FF0000}/VIPS {00FF40}Commands");
                SavePlayer(playerid);
			}
			else SendClientMessage(playerid, -1, "{FF0000}ERROR : {00FF40}You already received {FF0000}V.I.P {00FF40}Status 1");
			}
			if(listitem == 1)
			{
			if(PlayerInfo[playerid][Cookies] < 5000) return SendClientMessage(playerid,  -1, "{FF0000}ERROR : You dont have enough cookies to be V.I.P 2!");
            if(PlayerInfo[playerid][LoggedIn] == 1 && PlayerInfo[playerid][Vip] <= 1)
			{
                PlayerInfo[playerid][Vip] = 2;
                PlayerInfo[playerid][Cookies] -= 5000;
                GameTextForPlayer(playerid,"Vip Promoted", 2000, 3);
                SendClientMessage(playerid, -1, "{00FF40}You have received {FF0000}V.I.P {00FF40}Status 2");
                SendClientMessage(playerid, -1, "{00FF40}Use /vcmds or /vcmd1 to see {FF0000}/VIPS {00FF40}Commands");
                SavePlayer(playerid);
			}
			else SendClientMessage(playerid, -1, "{FF0000}ERROR : {00FF40}You already received {FF0000}V.I.P {00FF40}Status 2");
			}
			if(listitem == 2)
			{
			if(PlayerInfo[playerid][Cookies] < 7500) return SendClientMessage(playerid,  -1, "{FF0000}ERROR : You dont have enough cookies to be V.I.P 3!");
            if(PlayerInfo[playerid][LoggedIn] == 1 && PlayerInfo[playerid][Vip] != 3)
			{
                PlayerInfo[playerid][Vip] = 3;
                PlayerInfo[playerid][Cookies] -= 7500;
                GameTextForPlayer(playerid,"Vip Promoted", 2000, 3);
                SendClientMessage(playerid, -1, "{00FF40}You have received {FF0000}V.I.P {00FF40}Status 3");
                SendClientMessage(playerid, -1, "{00FF40}Use /vcmds or /vcmd1 to see {FF0000}/VIPS {00FF40}Commands");
                SavePlayer(playerid);
			}
			else SendClientMessage(playerid, -1, "{FF0000}ERROR : {00FF40}You already received {FF0000}V.I.P {00FF40}Status 3");
			}
		}
		return 1;
	}
nvm,all solved,its worked fine

i tried 3 method
btw,thanks Alex and iLearner
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)