SA-MP GetObjectId of all objects
#1

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
Reply
#2

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.
Reply
#3

I dont really understand, I have latest streamer...

please show me the example which will delete all objects with ID 2995
Reply
#4

PHP код:
for (new 1Streamer_CountItems(STREAMER_TYPE_OBJECT); != j; ++i)
{
    if (
Streamer_GetIntData(STREAMER_TYPE_OBJECTiE_STREAMER_MODEL_ID) == 2995DestroyDynamicObject(i);

Reply
#5

Ty +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)