multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.42k stars 438 forks source link

Add playCrimeReportSound function #2231

Open gta191977649 opened 3 years ago

gta191977649 commented 3 years ago

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)

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 3 years ago

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

gta191977649 commented 3 years ago

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.

patrikjuvonen commented 3 years ago

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

gta191977649 commented 3 years ago

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 3 years ago

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

gta191977649 commented 3 years ago

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

Yeah, definitely that sounds good :p

LosFaul commented 3 years ago

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 3 years ago

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.

LosFaul commented 3 years ago

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 3 years ago

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

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?

Pirulax commented 3 years ago

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

Lpsd commented 3 years ago

Why? It's nothing like playSFX

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

Lpsd commented 3 years ago

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

Commendatore1 commented 3 years ago

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