Get amount of near objects
#1

Hi,

I'm trying to get the near objects for my inventory scripts.

This is the command to get the near objects
PHP код:
CMD:pick(playeridparams[])
{
    new 
nearobj[216];
    
printf("get object %i"GetLastInvID());
        for(new 
iGetLastInvID(); i++)
        {
            new 
Float:xFloat:yFloat:z;
            
GetObjectPos(Dropped[i], xyz);
            if(
IsPlayerInRangeOfPoint(playerid5.0xyz))
            {
                for(new 
jGetLastInvID(); j++)
                {
                    if(
GetNearObjects(playeridGetObjectIDFromInvID(i)))
                    {
                        
format(nearobjsizeof(nearobj), "%s\n%s"nearobjGetObjectNameFromInvID(i));
                    }
                    
                }
            }
        }
        
Dialog_Show(playeridpickitemDIALOG_STYLE_LIST"Near objects"nearobj"Select""Cancel");
        return 
1;

I need a funtion that returns the amount of objects that are near the player. ( Dropped[MAX_OBJECTS] )
PHP код:
stock GetNearObjects(playerid,id)
{
    new 
amountofnearobjects;
    return 
amountofnearobjects;
    
// I need a funtion that returns the amount of objets nearby

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)