IsPlayerInRangePoint Help.... +Rep
#3

Quote:
Originally Posted by Gammix
Посмотреть сообщение
1) Use arrays for storing object position. For example:
pawn Код:
enum objectsenum
{
    Float:ox,
    Float:oy,
    Float:oz
}
new Objects[MAX_OBJECTS][objectsenum];
MAX_OBJECTS can be your own value too.

Now when you create a object, just save the coords of position of object while creating. For example:
pawn Код:
CreateObject(model, X, Y, Z, rX, rY, r)
Objects[i][ox] = X, Objects[i][oy] = Y, Objects[i][oz] = Z;
You can also hook CeateObject.

Now onplayerupdate, i don't recommend onplayerupdate though.
pawn Код:
public OnPlayerUpdate(playerid)
{
    for(new i; i < MAX_OBJECTS; i++)
    {
        if(IsValidObject(i))
        {
            if(IsPlayerInRangeOfPoint(playerid, 5.0, Objects[i][ox], Objects[i][oy], Objects[i][oz]))
            {
                SendClientMessage(playerid, -1, "your msg");
            }
        }
    }
    return 1;
}
I think this will work only for one object
i want it to work for all the created objects

and what you recommend otherthan onplayerupdate?
Reply


Messages In This Thread
IsPlayerInRangePoint Help.... +Rep - by kesarthakur - 12.04.2015, 05:06
Re: IsPlayerInRangePoint Help.... +Rep - by Gammix - 12.04.2015, 05:30
Re: IsPlayerInRangePoint Help.... +Rep - by kesarthakur - 12.04.2015, 05:34
Re: IsPlayerInRangePoint Help.... +Rep - by Crayder - 12.04.2015, 05:44
Re: IsPlayerInRangePoint Help.... +Rep - by kesarthakur - 12.04.2015, 05:46
Re: IsPlayerInRangePoint Help.... +Rep - by Crayder - 12.04.2015, 05:51
Re: IsPlayerInRangePoint Help.... +Rep - by Gammix - 12.04.2015, 05:51
Re: IsPlayerInRangePoint Help.... +Rep - by Crayder - 12.04.2015, 05:56
Re: IsPlayerInRangePoint Help.... +Rep - by kesarthakur - 12.04.2015, 08:01

Forum Jump:


Users browsing this thread: 1 Guest(s)