Skip to content

Commit

Permalink
docs(ENTITY/DeleteEntity): Updated C# example to resolve errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JayPaulinCodes committed Jul 26, 2024
1 parent ada4c42 commit c10488d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ENTITY/DeleteEntity.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ DeleteEntity(vehicle);
using static CitizenFX.Core.Native.API;

// Retrieve the vehicle the player is currently in.
Vehicle vehicle = GetVehiclePedIsIn(PlayerPedId(), false);
int vehicleHandle = GetVehiclePedIsIn(PlayerPedId(), false);

// Check if the vehicle exists in the game world.
if (!DoesEntityExist(vehicle))
if (!DoesEntityExist(vehicleHandle))
{
// If the vehicle does not exist, end the execution of the code here.
return;
}

// If the vehicle does exist, delete the vehicle entity from the game world.
DeleteEntity(vehicle);
DeleteEntity(ref vehicleHandle);
```

0 comments on commit c10488d

Please sign in to comment.