mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-16 12:58:27 +00:00
Destroy OutOfRangeDestroyer script on peds which are controlled by players
This commit is contained in:
parent
3869ff0a09
commit
f9c8a5d31f
2 changed files with 3 additions and 1 deletions
|
@ -113,6 +113,8 @@ namespace SanAndreasUnity.Behaviours
|
|||
var ped = Ped.SpawnPed(Ped.RandomPedId, spawn.position, spawn.rotation);
|
||||
player.OwnedPed = ped;
|
||||
ped.WeaponHolder.autoAddWeapon = true;
|
||||
// this ped should not be destroyed when he gets out of range
|
||||
ped.gameObject.DestroyComponent<OutOfRangeDestroyer>();
|
||||
|
||||
Debug.LogFormat("Spawned ped for player {0}, net id {1}", player.connectionToClient.address, ped.netId);
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
- change default ped sync rate to 20
|
||||
|
||||
- OutOfRangeDestroyer script should be destroyed on clients ; also, it should not be attached to peds owned by players (on server) ;
|
||||
- OutOfRangeDestroyer script should be destroyed on clients (for vehicles) ; when player controls a vehicle, it should not be destroyed ; or simply make the script destroy objects only on server (if they are network objects) ;
|
||||
|
||||
- display a message to user when network is stopped
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue