@@ -16,6 +16,7 @@ namespace ActivityGhosts
16
16
public class ActivityGhosts : Script
17
17
{
18
18
private List < Ghost > ghosts ;
19
+ private Blip start ;
19
20
private System . DateTime lastTime ;
20
21
private Keys menuKey ;
21
22
public static PointF initialGPSPoint ;
@@ -51,6 +52,7 @@ private void DeleteGhosts()
51
52
foreach ( Ghost g in ghosts )
52
53
g . Delete ( ) ;
53
54
ghosts . Clear ( ) ;
55
+ start ? . Delete ( ) ;
54
56
}
55
57
56
58
private void RegroupGhosts ( )
@@ -123,6 +125,8 @@ private void CreateMenu()
123
125
LoadGhosts ( ) ;
124
126
if ( ghosts . Count > 0 )
125
127
{
128
+ start = World . CreateBlip ( Game . Player . Character . Position ) ;
129
+ start . Sprite = BlipSprite . RaceBike ;
126
130
loadMenuItem . Enabled = false ;
127
131
regroupMenuItem . Enabled = true ;
128
132
deleteMenuItem . Enabled = true ;
@@ -161,6 +165,7 @@ public class Ghost
161
165
VehicleDrivingFlags . AllowMedianCrossing |
162
166
VehicleDrivingFlags . AvoidEmptyVehicles |
163
167
VehicleDrivingFlags . AvoidObjects |
168
+ VehicleDrivingFlags . AvoidPeds |
164
169
VehicleDrivingFlags . AvoidVehicles |
165
170
VehicleDrivingFlags . IgnorePathFinding ;
166
171
@@ -183,6 +188,7 @@ public Ghost(List<GeoPoint> pointList)
183
188
Vector3 start = GetPoint ( index ) ;
184
189
vehicle = World . CreateVehicle ( vModel , start ) ;
185
190
vModel . MarkAsNoLongerNeeded ( ) ;
191
+ vehicle . IsInvincible = true ;
186
192
vehicle . Mods . CustomPrimaryColor = Color . FromArgb ( random . Next ( 255 ) , random . Next ( 255 ) , random . Next ( 255 ) ) ;
187
193
Model pModel ;
188
194
pModel = new Model ( availableCyclists [ random . Next ( availableCyclists . Length ) ] ) ;
@@ -193,6 +199,7 @@ public Ghost(List<GeoPoint> pointList)
193
199
Script . Wait ( 10 ) ;
194
200
ped = World . CreatePed ( pModel , start ) ;
195
201
pModel . MarkAsNoLongerNeeded ( ) ;
202
+ ped . IsInvincible = true ;
196
203
ped . SetIntoVehicle ( vehicle , VehicleSeat . Driver ) ;
197
204
vehicle . Heading = GetHeading ( index ) ;
198
205
blip = vehicle . AddBlip ( ) ;
@@ -206,6 +213,8 @@ public void Update()
206
213
{
207
214
if ( points . Count > index + 1 )
208
215
{
216
+ if ( ! ped . IsOnBike )
217
+ ped . SetIntoVehicle ( vehicle , VehicleSeat . Driver ) ;
209
218
float speed = points [ index ] . Speed ;
210
219
float distance = vehicle . Position . DistanceTo2D ( GetPoint ( index ) ) ;
211
220
if ( distance > 20f )
@@ -219,8 +228,6 @@ public void Update()
219
228
ped . Task . ClearAll ( ) ;
220
229
ped . Task . DriveTo ( vehicle , GetPoint ( index ) , 0f , speed , ( DrivingStyle ) customDrivingStyle ) ;
221
230
vehicle . Speed = speed ;
222
- ped . IsInvincible = true ;
223
- ped . CanBeKnockedOffBike = true ;
224
231
}
225
232
else if ( ped . IsOnBike )
226
233
{
0 commit comments