Valentine90 Posted June 23, 2013 Author Share Posted June 23, 2013 **Sorry my English**If you have a target and he leaves the game or dies, it is not cleaned of your player, you will continue with a selected target even if that player is no longer online or live on that map.**1** - In **modPlayer**, search for:```Call SetPlayerVital(index, Vitals.HP, 0)```**2**- Beneath add:``` ' Loop through entire map and purge NPC from targets For i = 1 To Player_HighIndex If IsPlaying(i) And IsConnected(i) Then If GetPlayerMap(i) = GetPlayerMap(index) Then If TempPlayer(i).targetType = TARGET_TYPE_PLAYER Then If TempPlayer(i).target = index Then TempPlayer(i).target = 0 TempPlayer(i).targetType = TARGET_TYPE_NONE SendTarget i End If End If End If End If Next```**3 -** Search for:```TempPlayer(index).InGame = False```**4 -** Beneath add:``` ' Loop through entire map and purge NPC from targets For i = 1 To Player_HighIndex If IsPlaying(i) And IsConnected(i) Then If GetPlayerMap(i) = GetPlayerMap(index) Then If TempPlayer(i).targetType = TARGET_TYPE_PLAYER Then If TempPlayer(i).target = index Then TempPlayer(i).target = 0 TempPlayer(i).targetType = TARGET_TYPE_NONE SendTarget i End If End If End If End If Next```**Credits:**Valentine Link to comment Share on other sites More sharing options...
Zopto Posted June 23, 2013 Share Posted June 23, 2013 nice find tnx! Link to comment Share on other sites More sharing options...
lel Posted June 24, 2013 Share Posted June 24, 2013 I noticed this too, but I didn't see where it would cause an error or any problems. Could it cause any problems if left undone? If so, what? Link to comment Share on other sites More sharing options...
Zeno Posted June 24, 2013 Share Posted June 24, 2013 > I noticed this too, but I didn't see where it would cause an error or any problems. > > Could it cause any problems if left undone? If so, what?In certain engines you can get RTE9\. Usually there is an IsPlaying(index) check to stop a sub if the player is offline. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now