Help job farmer (plantation)
#1

making a huge spam by creating objects ...
// I noticed that all objects created once
PHP код:
enum fInfo
{
    
OwnedPlantation,
    
ObjectOne,
    
ObjectTwo
}
new 
FarmInfoMAX_PLANTATIONS ][ fInfo ];
forward Farmer( );
public 
Farmer( )
{
    for( new 
0MAX_PLAYERSi++ )
    {
        new 
vehicle GetPlayerVehicleID(i);
        if( 
vehicle == FarmerJob] || vehicle == FarmerJob] || vehicle == FarmerJob] || vehicle == FarmerJob] || vehicle == FarmerJob] || vehicle == FarmerJob] || vehicle == FarmerJob] )
        {
            for(new 
0MAX_PLANTATIONSx++)
            {
                new 
FloatXFloatYFloatZ;
                
GetPlayerPosiXY);
                   
FarmInfo][ ObjectOne ]= CreateObject872XYZ-10.000000.000000.00000 );
                   
FarmInfo][ OwnedPlantation ] = i;
               }
           }
    }
    return 
1;
}
forward LoadFarmer( );
public 
LoadFarmer( )
{
    for( new 
0MAX_PLAYERSi++ )
    {
        new 
vehicle GetPlayerVehicleID(i);
        if( 
vehicle == FarmerJob] || vehicle == FarmerJob] || vehicle == FarmerJob] || vehicle == FarmerJob] )
        {
            for(new 
0MAX_PLANTATIONSx++)
            {
                   new 
FloatpXFloatpYFloatpZ;
                
GetObjectPosFarmInfo][ ObjectOne ], pXpYpZ );
                if( 
PlayerToPoint 10.0ipXpYpZ ) )
                {
                    
DestroyObjectFarmInfo][ ObjectOne ]);
                       new 
FloatXFloatYFloatZ;
                    
GetPlayerPosiXY);
                    
FarmInfo][ ObjectTwo ] = CreateObject2901XYZ0.000000.000000.00000 );
                }
            }
        }
    }
    return 
1;

Reply
#2

Help, please!!

I offer +1 person who helps me.

Let me explain, I took a job with the farmer and plantation instead of creating a plant to 10 seconds planted all MAX_PLANTATIONS (= 100) ... how could I do to plant only 1 each
Reply
#3

Hello!

After you create this object you have to put break; so that the loop stoped and don't create 100 plants.
I hope you understand me.
Reply
#4

// Now is not spam, it's good but the problem is that "LoadFarmer" only works on the last object created, if you know what I mean ..

PHP код:
forward Farmer( );
public 
Farmer( )
{
    for( new 
0MAX_PLAYERSi++ )
    {
        new 
vehicle GetPlayerVehicleID(i);
        if( 
vehicle == FarmerJob] || vehicle == FarmerJob] || vehicle == FarmerJob] || vehicle == FarmerJob] || vehicle == FarmerJob] || vehicle == FarmerJob] || vehicle == FarmerJob] )
        {
            new 
FloatXFloatYFloatZ;
            
GetPlayerPosiXY);
            for(new 
0MAX_PLANTATIONSx++)
            {
                   
FarmInfo][ ObjectOne ]  = CreateObject872XYZ-10.000000.000000.00000 );
                   
FarmInfo][ OwnedPlantation ] = i;
                   break;
               }
           }
    }
    return 
1;
}
forward LoadFarmer( );
public 
LoadFarmer( )
{
    for( new 
0MAX_PLAYERSi++ )
    {
        new 
vehicle GetPlayerVehicleID(i);
        if( 
vehicle == FarmerJob] || vehicle == FarmerJob] || vehicle == FarmerJob] || vehicle == FarmerJob] )
        {
            new 
FloatXFloatYFloatZ;
            
GetPlayerPosiXY);
            for(new 
0MAX_PLANTATIONSx++)
            {
                   new 
FloatpXFloatpYFloatpZ;
                
GetObjectPosFarmInfo][ ObjectOne ], pXpYpZ );
                if( 
PlayerToPoint 10.0ipXpYpZ ) )
                {
                    
DestroyObjectFarmInfo][ ObjectOne ]);
                    
FarmInfo][ ObjectTwo ] = CreateObject2901XYZ0.000000.000000.00000 );
                    break;
                }
            }
        }
    }
    return 
1;

Reply
#5

please help!!
offer +1
Reply
#6

helpp please!!
Reply
#7

Use timers instead of a loop
Reply
#8

Another solution?
Can someone help?
it collects only the last plantation done.
Reply
#9

Try:

if( PlayerToPoint ( 1000.0, i, pX, pY, pZ ) )
{
DestroyObject( FarmInfo[ x ][ ObjectOne ]);
FarmInfo[ x ][ ObjectTwo ] = CreateObject( 2901, X, Y, Z, 0.00000, 0.00000, 0.00000 );
break;
}

Put a higher value.
Reply
#10

Quote:
Originally Posted by DarkLouis
Посмотреть сообщение
Try:

if( PlayerToPoint ( 1000.0, i, pX, pY, pZ ) )
{
DestroyObject( FarmInfo[ x ][ ObjectOne ]);
FarmInfo[ x ][ ObjectTwo ] = CreateObject( 2901, X, Y, Z, 0.00000, 0.00000, 0.00000 );
break;
}

Put a higher value.
Your idea is not very good, because plantations are close, not to 1000m
wait ideas
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)