SA-MP Forums Archive
not finding gamerscore - 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: not finding gamerscore (/showthread.php?tid=562993)



not finding gamerscore - semaj - 13.02.2015

alright folks an having an issue with this command, when i try by a business it says i dont have enough score


Код:
CMD:buybus(playerid,params[])
{
	if(IsJailedOrMuted(playerid))return 1;
    for(new i=1;i<BusinessCount+1;i++)
    {
 		new string[100];
		if(BankID[playerid]==0)return SendClientMessage(playerid,GREY,"You need a bank account");
        if(GetPlayerScore(playerid)<4)return SendClientMessage(playerid,GREY,"You need a score of atleast Level 4");
        if(!IsPlayerInRangeOfPoint(playerid,1.0,Business[i][bX],Business[i][bY],Business[i][bZ]))continue;
        if(GetPlayerMoneyEx(playerid) < Business[i][bCost]) return SendClientMessage(playerid,GREY,"You don't have enough money");
       	if(strcmp(Business[i][bOwner],"None") !=0) return SendClientMessage(playerid,GREY,"This business is already owned by someone");
		if(BID[playerid]>0)return SendClientMessage(playerid,GREY,"You already own a business");
		BID[playerid]=i;
       	format(Business[i][bOwner],24,"%s",PlayerName(playerid));
       	GivePlayerMoneyEx(playerid,-Business[i][bCost]);
		format(string,sizeof(string),"You've purchased the %s of Cost $%i",Business[i][bName],Business[i][bCost]);
		SendClientMessage(playerid,YELLOW,string);
		format(string,sizeof(string),"You will receive a payout of $%i from your business",Business[i][bProfit]);
		SendClientMessage(playerid,-1,string);
		if(PlayerAwards[playerid][Buss]==0)
		{
		    PlayerAwards[playerid][Buss]=1;
		    GivePlayerMoneyEx(playerid,1000);
			GamerScore[playerid]=GamerScore[playerid]+60;
		    SendClientMessage(playerid,YELLOW,"Achievement Unlocked: {FFFFFF}I Am Involved In One!");
  			SendClientMessage(playerid,LGREEN,"BONUS: $1000 || +60 Gamer Score");
		}
		format(string,sizeof(string),"~r~-$%i",Business[i][bCost]);
		GameTextForPlayer(playerid,string,800,1);
        return 1;
    }
    return 1;
}



Re: not finding gamerscore - HazardouS - 13.02.2015

Your algorithm is wrong. You should first find the closest business, stop the "for" loop and to the rest, like score checking etc.


Re: not finding gamerscore - semaj - 13.02.2015

my score is GamerScore=90 tho so whys it not finding it