/Buylevel command problem.
#1

Hi

So i have my level system ready and i wans that so people could export cars and buy levels.

I have my /buylevel command ready but each time i write /buylevel it buys all 3 levels. How could i make it buy one level at a time?

Код:
	if(strcmp(cmdtext,"/buylevel",true)==0)
       {
 	if(GetPlayerMoney(playerid) >= 100000 && GetPlayerScore(playerid) == 0)
       {
       SetPlayerRank(playerid, 1);
       SetPlayerScore(playerid, 1);
       GivePlayerMoney(playerid, -100000);
       SendClientMessage(playerid, COLOR_GREEN,"Apsveicam! Tu iegādājies 1. līmeni.");
	   }
    else {
	   if(GetPlayerMoney(playerid) < 100000 && GetPlayerScore(playerid) == 0)
       {
	   SendClientMessage(playerid, COLOR_BRIGHTRED, "Tev nav pietiekami daudz naudas.");
       }
       return 1;
    }
   	if(GetPlayerMoney(playerid) >= 200000 && GetPlayerScore(playerid) == 1)
       {
       SetPlayerRank(playerid, 2);
       SetPlayerScore(playerid, 2);
       GivePlayerMoney(playerid, -200000);
       SendClientMessage(playerid, COLOR_GREEN,"Apsveicam! Tu iegādājies 2. līmeni.");
	   }
    else {
	   if(GetPlayerMoney(playerid) < 200000 && GetPlayerScore(playerid) == 1)
       {
	   SendClientMessage(playerid, COLOR_BRIGHTRED, "Tev nav pietiekami daudz naudas.");
       }
       return 1;
    }
   	if(GetPlayerMoney(playerid) >= 300000 && GetPlayerScore(playerid) == 2)
       {
       SetPlayerRank(playerid, 3);
       SetPlayerScore(playerid, 3);
       GivePlayerMoney(playerid, -300000);
       SendClientMessage(playerid, COLOR_GREEN,"Apsveicam! Tu iegādājies 3. līmeni.");
	   }
    else {
	   if(GetPlayerMoney(playerid) < 300000 && GetPlayerScore(playerid) == 2)
       {
	   SendClientMessage(playerid, COLOR_BRIGHTRED, "Tev nav pietiekami daudz naudas.");
       }
       return 1;
    }
    return 1;
    }
Reply


Messages In This Thread
/Buylevel command problem. - by FreЉ - 11.02.2011, 01:12
Re: /Buylevel command problem. - by Memoryz - 11.02.2011, 01:16
Re: /Buylevel command problem. - by FreЉ - 11.02.2011, 01:23
Re: /Buylevel command problem. - by Zack9764 - 11.02.2011, 01:53
Re: /Buylevel command problem. - by California - 11.02.2011, 02:07
Re: /Buylevel command problem. - by Unknown123 - 11.02.2011, 02:08
Re: /Buylevel command problem. - by FreЉ - 11.02.2011, 02:17
Re: /Buylevel command problem. - by Antonio [G-RP] - 11.02.2011, 02:45

Forum Jump:


Users browsing this thread: 1 Guest(s)