Help objects
#5

Your code only checks if you're not near the first created object and not the rest.

pawn Код:
if(FarmActive[playerid] == 1)
{
    new Float:Pos[3], obj_slot = -1;
    for(new id = 0; id < createdobjects[playerid]; id++)
    {
        GetDynamicObjectPos(farmobject[playerid][id], Pos[0], Pos[1], Pos[2]);
        if(IsPlayerInRangeOfPoint(playerid, 3.0, Pos[0], Pos[1], Pos[2]))
        {
            obj_slot = id;
        }
    }
    if (obj_slot != -1)
    {
        SetPlayerAttachedObject(playerid, 0, 2901, 1, -0.022000, -0.212999, -0.007000, 0.000000, -2.099999, -2.599998, 0.612999, 0.439000, 0.607999, 0, 0);
        SCM(playerid, YELLOW, " (info) Executed !");
        DestroyDynamicObject(farmobject[playerid][obj_slot]);
        createdobjects[playerid] --;
    }
    else return SCM(playerid, TOMATO, " (greska) You're not near-by the farm object !");
}
Reply


Messages In This Thread
Help objects - by ShoortyFl - 29.04.2014, 19:05
Re: Help objects - by ShoortyFl - 29.04.2014, 20:15
Re: Help objects - by ShoortyFl - 30.04.2014, 10:40
Re: Help objects - by Vince - 30.04.2014, 10:47
Re: Help objects - by Konstantinos - 30.04.2014, 10:51
Re: Help objects - by ShoortyFl - 30.04.2014, 11:16
Re: Help objects - by ShoortyFl - 30.04.2014, 16:47

Forum Jump:


Users browsing this thread: 2 Guest(s)