multitheftauto/mtasa-blue

Add playCrimeReportSound function

gta191977649 opened this issue ยท 14 comments

Is your feature request related to a problem? Please describe.
A crime report is always good to have especially for the roleplayer server since the SA engine has already implemented on that as a function, so why not add them into the MTA.

Describe the solution you'd like
Like the SA-MP does, add a shared function playCrimeReportForPlayer, for server-side it would be playCrimeReportForPlayer(thePlayer,suspected,crimeid) and client-side playCrimeReportForPlayer(suspected,crimeid)

  • thePlayer - which player will hear the crime report
  • suspected - The ID of the suspect player whom will be described in the crime report.
  • crimeid - The crime ID, which will be reported as a 10-code (i.e. 10-16 if 16 was passed as the crimeid).

Describe alternatives you've considered

Additional context
The detailed documentation you can find it on their wiki:
https://sampwiki.blast.hk/wiki/PlayCrimeReportForPlayer
Also the SA Native can be obtain on the GTA-reversed project:
https://github.com/codenulls/gta-reversed/blob/master/source/game_sa/CCrime.cpp
and the SA-MP implementation can obained in:
https://github.com/dashr9230/SA-MP/blob/849d523d39b8ef81dd1ccf8d2b43210f1d2df939/client/game/game.cpp#L1133

Lpsd commented

What does this actually do? Is it just the cop radio sound when you get a wanted level?

What does this actually do? Is it just the cop radio sound when you get a wanted level?

Yeah, exactly
It plays a crime report based on the player's current location and status, e.g. on foot or vehicles, same as the one you get wanted in single player.

Reason why it's not in MTA is because you can use playSFX to accomplish this already.

Reason why it's not in MTA is because you can use playSFX to accomplish this already.

I agree with you this approach is feasible, however in order to map all of them it's really a time-consuming work, since it already been implemented in-game why don't we just add it and let the devs can focus more on programming the game-play itself?

Lpsd commented

Seems reasonable enough. How about playCrimeReportSound instead of playCrimeReportForPlayer? "ForPlayer" seems to be a SAMP thing.

Seems reasonable enough. How about playCrimeReportSound instead of playCrimeReportForPlayer? "ForPlayer" seems to be a SAMP thing.

Yeah, definitely that sounds good :p

Reason why it's not in MTA is because you can use playSFX to accomplish this already.

+1 it would redundant with the existing functionality

Lpsd commented

Reason why it's not in MTA is because you can use playSFX to accomplish this already.

+1 it would redundant with the existing functionality

I can't find any information on where the sounds are located (which container or bank?).

How many police radio sounds are there? Even if you knew the IDs in the sound bank, if there's many it could take forever to match up with the correct areas, especially if you're not 100% familiar with the SA map.

This is easy to implement, it will not only save scripters time but MTA developers too (until someone wants to commit to documenting every sound bank).

We should improve our documentation on sound banks, but that's for another issue.

Reason why it's not in MTA is because you can use playSFX to accomplish this already.

+1 it would redundant with the existing functionality

I can't find any information on where the sounds are located (which container or bank?).

How many police radio sounds are there? Even if you knew the IDs in the sound bank, if there's many it could take forever to match up with the correct areas, especially if you're not 100% familiar with the SA map.

This is easy to implement, it will not only save scripters time but MTA developers too (until someone wants to commit to documenting every sound bank).

We should improve our documentation on sound banks, but that's for another issue.

there is a resource sfx browser or something where you cna checkout all sounds

Lpsd commented

I've just checked using that resource, individual crime reports are made up of multiple sounds from different banks:

  • Place names (163 sounds)
  • Vehicle colors (14 sounds)
  • Directions (4 sounds)
  • Locations (8 sounds)
  • 10-code pieces (13 sounds)
  • Vehicle types (57 sounds)

That's a lot of possible combinations (plus, no doubt there are other sound banks i've missed). Good luck if you want to use playSFX for this.

We've literally got the native SA function right there, so why not?

Maybe add some option to playSFX to play the crime report sound stuff?
Not sure if thats a good idea.

Lpsd commented

Why? It's nothing like playSFX

You can see Discord for a bit more info https://discord.com/channels/801330706252038164/801330706252038170/847560048120430602

Lpsd commented

I've already got this working btw, as playCrimeReportSound(int crimeId, player suspectedPlayer). Just need to clean a few things up.

As mentioned in the Discord, we have now made our resource public that does this, using playSFX: https://github.com/prime-community/pcgpolicecode