SA-MP Forums Archive
Show the nearest checkpoint - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Show the nearest checkpoint (/showthread.php?tid=139110)



Show the nearest checkpoint - Takumi.WS - 04.04.2010

Well, I have this business system, each business has a checkpoint near of it
Code :
Код:
stock LoadBizInfo(b)
{
	  new biz[50],string[128],Float:x,Float:y,Float:z;
	  new bname[50],pname[MAX_PLAYER_NAME],bprice,bbenefit;

    format(biz,sizeof(biz),"%iBusinessname",b);
		format(bname,sizeof(bname),"%s",dini_Get("Business.ini",biz));

		format(biz,sizeof(biz),"%iOwnerName",b);
    format(pname,sizeof(pname),"%s",dini_Get("Business.ini",biz));

	  format(biz,sizeof(biz),"%iCost",b);
		bprice = dini_Int("Business.ini",biz);

		format(biz,sizeof(biz),"%iPayment",b);
		bbenefit = dini_Int("Business.ini",biz);

		format(biz,sizeof(biz),"%iX",b);
	  x = dini_Float("Business.ini",biz);

    format(biz,sizeof(biz),"%iY",b);
    y = dini_Float("Business.ini",biz);

    format(biz,sizeof(biz),"%iZ",b);
    z = dini_Float("Business.ini",biz);

    format(string,sizeof(string),"Business system\nBusiness Name : %s\nOwner : %s\nPrice : %d USD\nProfit per 10mins : %d USD",bname,pname,bprice,bbenefit);
    blabel[b] = Create3DTextLabel(string,0xFFFF00AA,x,y,z,40.0,0);

    	foreach(PlayerEx,i){
		bCPS[b] = SetPlayerCheckpoint(i, x, y, z, 0);
		}

	return 1;
}
But when i have more of one business, only the last business's checkpoint show !
How to make nearest business checkpoint show ?

Thanks