SA-MP GetObjectId of all objects - 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: SA-MP GetObjectId of all objects (
/showthread.php?tid=575418)
SA-MP GetObjectId of all objects -
MafiaOink - 26.05.2015
Hey guys I wanna delete all the objects which have 2995 as the object id, Can you tlel me how?
Код:
COMMAND:clearlastbullets(playerid, params[])
{
if(PlayerInfo[playerid][playerteam] == FBI || PlayerInfo[playerid][playerteam] == HITMAN)
{
for(new i = 0; i < MAX_OBJECTS; i++) if(IsValidObject(i))
{
if(i == 2995 // I want to get the object ID , How will I?
}
}
else SendClientError(playerid, "You are not allowed to use that command!");
return 1;
}
Is my command
Re: SA-MP GetObjectId of all objects -
Konstantinos - 26.05.2015
Just use Incognito's steamer plugin and with:
pawn Код:
Streamer_GetIntData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_MODEL_ID)
you can get the modelid of the object. I guess you can loop and use Streamer_CountItems for the max value.
Re: SA-MP GetObjectId of all objects -
MafiaOink - 26.05.2015
I dont really understand, I have latest streamer...
please show me the example which will delete all objects with ID 2995
Re: SA-MP GetObjectId of all objects -
Konstantinos - 26.05.2015
PHP код:
for (new i = 1, j = Streamer_CountItems(STREAMER_TYPE_OBJECT); i != j; ++i)
{
if (Streamer_GetIntData(STREAMER_TYPE_OBJECT, i, E_STREAMER_MODEL_ID) == 2995) DestroyDynamicObject(i);
}
Re: SA-MP GetObjectId of all objects -
MafiaOink - 26.05.2015
Ty +rep