SA-MP Forums Archive
purchase items biz - dialog and press button problem - 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: purchase items biz - dialog and press button problem (/showthread.php?tid=525330)



purchase items biz - dialog and press button problem - uTorrent - 11.07.2014

PHP код:
#define MAX_BUYPOS                              (500)
enum buypossysteminfo
{
    
Float:buypos[3],
    
pickbuy,
}
new 
buyposcount,dutyposcount,bancomatcount;
new 
BuyPos[MAX_BUYPOS][buypossysteminfo];
// BuyPos
    
AddBuyPos(375.7177,-118.8130,1001.4995);
    
AddBuyPos(295.9521,-80.7968,1001.5156);
    
AddBuyPos(369.5416,-6.0184,1001.8589);
    
AddBuyPos(377.4379,-67.4404,1001.5078);
    
AddBuyPos(-31.1618,-29.0340,1003.5573);
    
AddBuyPos(499.9659,-20.7101,1000.6797);
    
AddBuyPos(496.4948,-76.0404,998.7578);
    
AddBuyPos(-2237.0244,130.1843,1035.4141);
    
AddBuyPos(-103.8858,-22.6746,1000.7188);
    
AddBuyPos(236.4729,-32.5258,963.8596);
    
AddBuyPos(822.0098,6.2074,1004.1797);
    
AddBuyPos(681.4807,-453.8216,-25.6172);
    
AddBuyPos(1914.6147,-1862.7678,229.7374);
    
AddBuyPos(1854.0283,-1840.8131,17.6146);
    
AddBuyPos(3030.0103,-1837.6888,578.8859);
    
AddBuyPos(1288.5613,-678.5092,1084.0792);
    
AddBuyPos(-28.9872,-185.1319,1003.5469);
    
AddBuyPos(2.0855,-29.0140,1003.5494);
    
AddBuyPos(-28.0792,-89.9525,1003.5469);
    
AddBuyPos(1207.2344,-28.1829,1000.9531);
    
AddBuyPos(-2653.1226,1410.0734,906.2734);
    
AddBuyPos(379.2913,-190.4099,1000.6328);
    for(new 
x=1;x<MAX_BUYPOS;x++)
    {
      if(
IsPlayerInRangeOfPoint(playerid2.0BuyPos[x][buypos][0],BuyPos[x][buypos][1],BuyPos[x][buypos][2]))
      {
        
ShowClientBox(playerid,"Premi ~k~~VEHICLE_ENTER_EXIT~ per acquistare, vendere o ordinare qualcosa");
      }
    }
f(newkeys KEY_SECONDARY_ATTACK)
     {
        for(new 
1x<MAX_BUYPOS;x++)
        {
            if(
IsPlayerInRangeOfPoint(playerid1.0BuyPos[x][buypos][0],BuyPos[x][buypos][1],BuyPos[x][buypos][2]))
            {
                new 
bizid GetCurrentBiz(playerid);
                if(
bizid != -1)
                {
                    if(
BusinessInfo[bizid][bBuy] && BusinessInfo[bizid][bStatus] == 0)return GameTextForPlayer(playerid,"~r~Chiuso",5000,5);
                    else return 
ShowPlayerBizMenuDialog(playeridbizid);
                }
            }
        }
        return 
1;
     }
stock AddBuyPos(Float:exFloat:eyFloat:ez)
{
    if(
buyposcount>=MAX_BUYPOS)return -1;
    
BuyPos[buyposcount][buypos][0] = ex;
       
BuyPos[buyposcount][buypos][1] = ey;
    
BuyPos[buyposcount][buypos][2] = ez;
    
BuyPos[buyposcount][pickbuy] = CreateDynamicPickup(1239,23,ex,ey,ez, -1,-1,-1,50.0);
    
buyposcount++;
    return 
buyposcount-1;

The dialog appears, the problem is that when I press the return key ... Do not open any dialog where to buy the items available in the biz