Mido stream creating and destroying
#1

Hi, i need help with making a cmd that spawns the objects and then another cmd to destroy them, i can't figure out how
here is my spawn object code
pawn Код:
if(strcmp(cmd, "/test", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
            CreateStreamObject(1238, 2585.6965332031, -2390.3012695313, 12.866736412048, 0.000000, 0.000000, 0.000000, 90.0); // I think i have to add a name to this object, but how
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "[Error] You are not authorized to use that command");
            }
        }
        return 1;
    }
pawn Код:
if(strcmp(cmd, "/destroytest", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
            // What am i gonna do here to destroy the first object?
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "[Error] You are not authorized to use that command");
            }
        }
        return 1;
    }
Reply
#2

Its the same as the regular way you create and destroy objects.

You need to keep a record somewhere of the object identity;

new objectid;


objectid = CreateStreamObject(1238, 2585.6965332031, -2390.3012695313, 12.866736412048, 0.000000, 0.000000, 0.000000, 90.0);

DestroyStreamObject(objectid);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)