[Tutorial] How to make Airdrop system? (using Mapandreas)
#7

I already gave you the key, use OnObjectMoved.

In order to detect the airdrop id, you may notice that i return the index in CreateAirdrop. SO in order to detect the locations from ids, you can make vars for airdrops and use them in callback.

For example we are creating airdrop in BigEar.
pawn Код:
new Airdrop_BigEar;
Now create your airdrop anywhere like this:
pawn Код:
Airdrop_BigEar = CreateAirdrop(...);
Now in order to detect the airdrop has landed on the ground, use this:
pawn Код:
public OnObjectMoved(objectid)
{
    //looping through all airdrops
    for(new i; i < MAX_AIRDROPS; i++)
    {
        //if the airdrop slot is occupied
        //i.e. the airdrop exists
        if(gAirdrop[i][a_exist])
        {
            //if the object id is that of airdrop
            if(objectid == gAirdrop[i][a_object])
            {

                if(i == Airdrop_BigEar)
                {
                    SendClientMessageToAll(-1, "Airdroped at BigEar");
                }
               
                //from now the airdrop is on the ground and players can pick it
                gAirdrop[i][a_droped] = true;
               
                //start a timer after which the airdrop will be destroyed
                //the interval here is 1 minute (60000 ms), You may use a custom value if you wish
                gAirdrop[i][a_expire_timer] = SetTimerEx("OnAirdropExpire", (60 * 1000), false, "i", i);
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
How to make Airdrop system? (using Mapandreas) - by Gammix - 08.06.2015, 17:14
Re: How to make Airdrop system? (using Mapandreas) - by Excel™ - 09.06.2015, 15:56
Re: How to make Airdrop system? (using Mapandreas) - by Q_Lite - 12.06.2015, 08:47
Re: How to make Airdrop system? (using Mapandreas) - by justice96 - 21.06.2015, 15:30
Re: How to make Airdrop system? (using Mapandreas) - by Gammix - 21.06.2015, 16:26
Re: How to make Airdrop system? (using Mapandreas) - by justice96 - 21.06.2015, 16:36
Re: How to make Airdrop system? (using Mapandreas) - by Gammix - 22.06.2015, 04:06
Re: How to make Airdrop system? (using Mapandreas) - by justice96 - 22.06.2015, 04:15
Re: How to make Airdrop system? (using Mapandreas) - by Gammix - 22.06.2015, 07:15
Re: How to make Airdrop system? (using Mapandreas) - by justice96 - 22.06.2015, 07:18
Re: How to make Airdrop system? (using Mapandreas) - by $$inSane - 10.07.2015, 12:07

Forum Jump:


Users browsing this thread: 3 Guest(s)