DeleteObject

From GT-MP
Jump to: navigation, search
DeleteObject
Shared Function
Utilities-terminal.png Server-Side System-users.png Client-Side
Csharp.png C# Javascript.png JavaScript

Deletes a prop with the specified model at the specified position for the specified player. (Serverside)

Deletes a prop with the specified model at the specified position for the local player. (Clientside)

Icon-info.png
Deleted prop will automatically be restored if you walk away and come back.

Syntax

In C#
Server-Side Function

API.deleteObject(Client client, Vector3 position, int modelHash, float radius = 1f);

Required Arguments

  • client: the client to delete the objects for. Parameter input should be in Client type.
  • position: parameter input should be in Vector3 type.
  • modelHash: parameter input should be in int type. You could use getHashKey for this.

Optional Arguments

  • radius: this parameter is optional, the default value of this parameter is 1f, parameter input should be in float type.

In Javascript
Client-Side Function

Dialog-warning.png Note: This feature is currently not in the API, or is currently not accurate on the wiki due to upcoming API changes. New API functions and changes will be released with the next update.
API.deleteObject(Vector3 position, int modelHash, double radius = 1.0);

Required Arguments

  • position: parameter input should be in Vector3 type.
  • modelHash: parameter input should be in int type. You could use getHashKey for this.

Optional Arguments

  • radius: this parameter is optional, the default value of this parameter is 1.0, parameter input should be in double type.

Usage example(s)

In C#
Server-Side Function

API.deleteObject(Client client, Vector3 position, int modelHash);

In Javascript
Client-Side Function

API.deleteObject(Vector3 position, int modelHash);

References