SA-MP Forums Archive
Mido stream creating and destroying - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Mido stream creating and destroying (/showthread.php?tid=126983)



Mido stream creating and destroying - Perker12345 - 11.02.2010

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;
    }



Re: Mido stream creating and destroying - mansonh - 11.02.2010

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);