How Can I Delete Spawned Objects?
#1

title says all! i can spawn objects, but i can't delete it! because the filterscripts doesn't have /deleteobjects or etc... but it has /object [id]

Код:
dcmd_object(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 5 || IsPlayerAdmin(playerid))
	{
	    if(!strlen(params)) return
	    SendClientMessage(playerid, LIGHTBLUE2, "Usage: /object [ObjectID]") &&
		SendClientMessage(playerid, orange, "Function: Will created a specified Object");
		
	    new ObjID = strval(params), string[128];
		new Float:X, Float:Y, Float:Z, Float:Ang;
	    SendCommandToAdmins(playerid,"Object");
		GetPlayerPos(playerid, X, Y, Z);
		GetPlayerFacingAngle(playerid, Ang);
		X += (3 * floatsin(-Ang, degrees));
		Y += (3 * floatcos(-Ang, degrees));
		CreateObject(ObjID, X, Y, Z, 0.0, 0.0, Ang);
		format(string, sizeof(string), "CreateObject(%d, %0.2f, %0.2f, %0.2f, 0.00, 0.00, %0.2f);", ObjID, X, Y, Z, Ang);
       	SaveIn("CreatedObjects",string);
		format(string, sizeof(string), "|- Object Created: (Id: %d) (Position: X: %0.2f, Y: %0.2f, Z: %0.2f) (Angle: %0.2f) -|", ObjID, X, Y, Z, Ang);
		return SendClientMessage(playerid,yellow, string);
	}
	else return ErrorMessages(playerid, 1);
}
Reply
#2

Well just put this:
pawn Код:
DestroyObject(ObjID);
Reply
#3

where im gonna put it? do it will automatically removes those things i created if i quit?
Reply
#4

If you restart the server they will automatically destroy. You can add it anywhere you want, you can create a command, asign a button that will delete the object, etc. Its up to you.
Reply
#5

i want a command please.. coz i can't restart my server.. i don't have /restartserver etc cmd in my gamemode..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)