Why objects are not destroying?
#5

Made an improved version for you. Try it out :
PHP Code:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    new 
SmokeObjectCreated;
    if(
newkeys KEY_YES)
    {
        if(
IsPlayerInRangeOfPoint(playerid2.0, -1756.19006768.19061168.47099))
          {
              if(
DJ[playerid] == )
              {
                    if( 
SmokeObjectCreated == ) return SendClientMessage(playerid, -1"Location already have smokes.");
                    
SmokeObjectCreated 1;
                       
p1 CreateDynamicObject(2780, -1763.72510780.92908174.22932,   88.000002.00000, -6.00000);
                    
p2 CreateDynamicObject(2780, -1752.37158780.15802174.22932,   88.000002.00000, -6.00000);
                    
p3 CreateDynamicObject(2780, -1744.06750779.74738174.22932,   88.000002.00000, -6.00000);
                    
p4 CreateDynamicObject(2780, -1766.28955764.69904168.54120,   0.000000.00000, -179.00000);
                    
p5 CreateDynamicObject(2780, -1743.22437764.93964168.54120,   0.000000.00000, -179.00000);
                    
p6 CreateDynamicObject(2780, -1766.28955764.69904168.54120,   0.000000.00000, -179.00000);
                    
p7 CreateDynamicObject(2780, -1743.22437764.93964168.54120,   0.000000.00000, -179.00000);
                    
p8 CreateDynamicObject(2780, -1774.05896774.17719168.39337,   0.000000.0000084.00000);
                    
p9 CreateDynamicObject(2780, -1774.03223784.32123168.39337,   0.000000.0000084.00000);
                    
p10 CreateDynamicObject(2780, -1774.00366794.26978168.39337,   0.000000.0000084.00000);
                    
p11 CreateDynamicObject(2780, -1774.07361805.47406168.39337,   0.000000.0000084.00000);
                    
p12 CreateDynamicObject(2780, -1766.94690795.36481166.59729,   -88.000000.000000.00000);
                    
p13 CreateDynamicObject(2780, -1767.67834789.19318166.59729,   -88.000000.000000.00000);
                    
p14 CreateDynamicObject(2780, -1767.58838782.20294166.59729,   -88.000000.000000.00000);
                    
p15 CreateDynamicObject(2780, -1742.22107795.15344166.60779,   -98.000000.000000.00000);
                    
p16 CreateDynamicObject(2780, -1742.22778789.51678166.60779,   -98.000000.000000.00000);
                    
p17 CreateDynamicObject(2780, -1742.17041782.18506166.60779,   -98.000000.000000.00000);
                    
p18 CreateDynamicObject(2780, -1734.08972806.35828168.23134,   0.000003.00000, -99.00000);
                    
p19 CreateDynamicObject(2780, -1733.98816796.45825168.23134,   0.000003.00000, -99.00000);
                    
p20 CreateDynamicObject(2780, -1734.02966785.73511168.23134,   0.000003.00000, -99.00000);
                    
p21 CreateDynamicObject(2780, -1734.39221773.08496168.23134,   0.000003.00000, -99.00000);
                    
p22 CreateDynamicObject(2780, -1755.33472803.83698166.60779,   -98.000000.000000.00000);
                    
p23 CreateDynamicObject(2780, -1746.55688801.01849174.27007,   90.000000.000000.00000);
                    
p24 CreateDynamicObject(2780, -1752.35779801.12927174.27007,   90.000000.000000.00000);
                    
p25 CreateDynamicObject(2780, -1748.36548789.42651166.60779,   -98.000000.000000.00000);
                    
p26 CreateDynamicObject(2780, -1761.39917789.22473166.59729,   -88.000000.000000.00000);
                    
p27 CreateDynamicObject(2780, -1766.02844815.00385167.98318,   0.000000.000000.00000);
                    
p28 CreateDynamicObject(2780, -1753.73547814.99573167.98318,   0.000000.000000.00000);
                    
p29 CreateDynamicObject(2780, -1744.25513815.03125167.98318,   0.000000.000000.00000);
                    
p30 CreateDynamicObject(2780, -1748.68921795.19330166.60779,   -98.000000.000000.00000);
                    
p31 CreateDynamicObject(2780, -1761.43872795.26221166.59729,   -88.000000.000000.00000);
                    
p32 CreateDynamicObject(2780, -1761.31079782.31293166.59729,   -88.000000.000000.00000);
                    
p33 CreateDynamicObject(2780, -1748.67859782.21063166.60779,   -98.000000.000000.00000);
                    
p34 CreateDynamicObject(2780, -1753.37720794.05072174.23012,   88.000002.00000, -6.00000);
                    
p35 CreateDynamicObject(2780, -1753.27991787.92670174.34773,   88.000002.00000, -6.00000);
                    
p36 CreateDynamicObject(2780, -1755.48560768.98016166.96951,   0.00000, -1.00000170.00000);
                    
Update3DTextLabelText(smoke0x2222FFFF"Press 'N' to stop smoke!");
              }
           }
    }
    if(
newkeys KEY_NO)
    {
        if(
IsPlayerInRangeOfPoint(playerid2.0, -1756.19006768.19061168.47099))
          {
              if(
DJ[playerid] == 1)
            {
                if( 
SmokeObjectCreated == ) return SendClientMessage(playerid, -1"No smokes here.");
                
SmokeObjectCreated 0;
                
DestroyDynamicObject(p1);
                
DestroyDynamicObject(p2);
                
DestroyDynamicObject(p3);
                
DestroyDynamicObject(p4);
                
DestroyDynamicObject(p5);
                
DestroyDynamicObject(p6);
                
DestroyDynamicObject(p7);
                
DestroyDynamicObject(p8);
                
DestroyDynamicObject(p9);
                
DestroyDynamicObject(p10);
                
DestroyDynamicObject(p11);
                
DestroyDynamicObject(p12);
                
DestroyDynamicObject(p13);
                
DestroyDynamicObject(p14);
                
DestroyDynamicObject(p15);
                
DestroyDynamicObject(p16);
                
DestroyDynamicObject(p17);
                
DestroyDynamicObject(p18);
                
DestroyDynamicObject(p19);
                
DestroyDynamicObject(p20);
                
DestroyDynamicObject(p21);
                
DestroyDynamicObject(p22);
                
DestroyDynamicObject(p23);
                
DestroyDynamicObject(p24);
                
DestroyDynamicObject(p25);
                
DestroyDynamicObject(p26);
                
DestroyDynamicObject(p27);
                
DestroyDynamicObject(p28);
                
DestroyDynamicObject(p29);
                
DestroyDynamicObject(p30);
                
DestroyDynamicObject(p31);
                
DestroyDynamicObject(p32);
                
DestroyDynamicObject(p33);
                
DestroyDynamicObject(p34);
                
DestroyDynamicObject(p35);
                
DestroyDynamicObject(p36);
                
Update3DTextLabelText(smoke0x2222FFFF"Press 'Y' to make smoke!");
            }
         
        }
    }
    return 
1;

Reply


Messages In This Thread
Why objects are not destroying? - by akib - 14.06.2017, 22:07
Re: Why objects are not destroying? - by Kane - 14.06.2017, 22:09
Re: Why objects are not destroying? - by akib - 14.06.2017, 22:13
Re: Why objects are not destroying? - by akib - 14.06.2017, 22:26
Re: Why objects are not destroying? - by SoFahim - 15.06.2017, 05:10
Re: Why objects are not destroying? - by iLearner - 15.06.2017, 07:15
Re: Why objects are not destroying? - by Whatname - 15.06.2017, 07:18
Re: Why objects are not destroying? - by akib - 15.06.2017, 07:20
Re: Why objects are not destroying? - by Whatname - 15.06.2017, 07:23
Re: Why objects are not destroying? - by akib - 15.06.2017, 07:30
Re: Why objects are not destroying? - by Whatname - 15.06.2017, 07:32
Re: Why objects are not destroying? - by akib - 15.06.2017, 09:20

Forum Jump:


Users browsing this thread: 5 Guest(s)