SA-MP Forums Archive
GetObjectIdexes? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GetObjectIdexes? (/showthread.php?tid=395827)



GetObjectIdexes? - Dragony92 - 27.11.2012

Is there any way to find out how many indexes some object have? With some function, i don't want to look at map editor for each object...
Any smart solution?


Re: GetObjectIdexes? - maramizo - 27.11.2012

pawn Код:
CMD:onear(playerid, params[])
{
    if(IsPlayerAdmin(playerid)) //Some sort of check
    {
        SendClientMessage(playerid, COLOR_TWRED, "______________________");
        SendClientMessage(playerid, COLOR_TWRED, "Listing all nearby objects");
        SendClientMessage(playerid, COLOR_TWRED, "______________________");
        new Float:X,Float:Y,Float:Z, Float:OX, Float:OY, Float:OZ;
        new str[128];
        GetPlayerPos(playerid, X,Y,Z);
        for (new i = 0; i < MAX_OBJECTS; i++)
        {
            GetObjectPos(i, OX, OY, OZ);
            if(IsPlayerInRangeOfPoint(playerid, 30.0, OX, OY, OZ))
            {
                format(str, 128, "Object (%i) is %f far away from you.", i, GetDistance(X, Y, Z, OX, OY, OZ));
                SendClientMessageEx(playerid, COLOR_WHITE, str);
            }
        }
        return 1;
    }
    return SendClientMessage(playerid, COLOR_WHITE, "You are not authorized to use this command.");
}



Re: GetObjectIdexes? - Dragony92 - 27.11.2012

That's now what i'm looking for...

https://sampwiki.blast.hk/wiki/SetObjectMaterial
materialindex The material index on the object to change

I want to know how many indexes have some object....


Re: GetObjectIdexes? - Dragony92 - 28.11.2012

BUMP