Skip to content

Commit

Permalink
Merge pull request #2 from YonLiud/dev
Browse files Browse the repository at this point in the history
4221 Patch & Update
  • Loading branch information
YonLiud authored Feb 4, 2021
2 parents 1725e2a + a68bc2f commit fe87d28
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 23 deletions.
17 changes: 12 additions & 5 deletions EmergencyCallerClient/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,35 +65,42 @@ private void OnClientResourceStart(string resourceName)
Debug.WriteLine(text);
string playername = Game.Player.Name;
TriggerServerEvent("sent911", playername, text, Game.PlayerPed.Position);
cooldown();
cooldown(); // 🡠 remove this line to disable cooldown
}), false);
}
private void OnRecieve911(string name, string args, Vector3 location)
{
string street = World.GetStreetName(location);
SendMessage(name, args, street); // 🡠 remove line to disbale 911 message
MakeBlip(location, name); // 🡠 remove line to disable blip
}
private void SendMessage(string name, string args, string street)
{
TriggerEvent("chat:addMessage", new
{
color = new[] { 0, 204, 204 },
multiline = true,
args = new[] { "911", $"Caller: ^*{name} | Location: {street} | ^*Transcript: {args}" }
args = new[] { "911", $"^4Caller: ^0^*{name} | ^4Location: ^0{street} | ^4^*Transcript: ^0{args}" }
});
}
private void MakeBlip(Vector3 location, string name)
{
Blip blip = World.CreateBlip(location);

blip.Sprite = BlipSprite.ArmoredTruck;
blip.Color = BlipColor.Blue;
blip.Name = $"{name}'s Emergency Call";
removeBlip(blip);
}
private async void removeBlip(Blip blip)
{
await Delay(60000);
await Delay(60000); // 🡠 change this to the amount of exparation
blip.Delete();
}
private async void cooldown()
{
onCooldown = true;
Debug.WriteLine("Cooldown Set");
await Delay(15000);
await Delay(15000); // 🡠 change this to the amount of delay between calls
onCooldown = false;
Debug.WriteLine("Your Cooldown has expired");

Expand Down
8 changes: 5 additions & 3 deletions EmergencyCallerClient/EmergencyCallerClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CitizenFX.Core, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:\Games\FiveM\FiveM.app\citizen\clr2\lib\mono\4.5\CitizenFX.Core.dll</HintPath>
<Reference Include="CitizenFX.Core">
<HintPath>B:\Games\FiveM\FiveM.app\citizen\clr2\lib\mono\4.5\CitizenFX.Core.dll</HintPath>
</Reference>
<Reference Include="CitizenFX.Core.Client">
<HintPath>B:\Games\FiveM\FiveM.app\citizen\clr2\lib\mono\4.5\CitizenFX.Core.Client.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
5 changes: 2 additions & 3 deletions EmergencyCallerServer/EmergencyCallerServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CitizenFX.Core, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\FXServer\citizen\clr2\lib\mono\4.5\CitizenFX.Core.dll</HintPath>
<Reference Include="CitizenFX.Core">
<HintPath>B:\FXServer\citizen\clr2\lib\mono\4.5\CitizenFX.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,30 @@

Emergency Caller is a C# Script for [FiveM](https://fivem.net/).

Emergency Caller allows the players inside the session to call Police/EMS for a Roleplay Scene. Emergency Caller will display the message of the calling suspect in chat and will create a temporary blips on map to ease on the officers to locate the caller
Emergency Caller allows the players inside the session to call 911 for a Roleplay Scene. Emergency Caller will display the message of the calling suspect in chat and will create a temporary blips on map to ease on the officers to locate the caller
## Download
[Click Here To Download](https://github.com/YonLiud/Emergency-Caller/releases/)
<br /><b>NEW! UK Version (999)</b> [Source is unavailable]

## Screenshots

## Installation
#### Chat Message:
![chat message](https://upload.vaa.red/i/EZvSY.png)

#### Map Blip:
![map image](https://upload.vaa.red/i/oAsGV.png)

#### Description in Map:
![desc](https://upload.vaa.red/i/YVHFR.png)

#### Cooldown Message (Visible only on client side):
![err](https://upload.vaa.red/i/2u5nkM.png)


<hr>

## Installation

1) Inside your server.cfg, type the following command:

```
Expand All @@ -37,13 +52,4 @@ If you have any suggestions or ideas, feel free to contact me by my Discord <b>
To report a bug or any issue you encounter, open a github issue ticket, and I will fix the issue hopefully the following commit and releases

## Authors and acknowledgment
Created by Yonatan Mark Liudmirsky



## License
[MIT](https://choosealicense.com/licenses/mit/)

## Project Status

Emergency Caller is currently in development and is a work in progress, everything in the project is a subject to get removed or changed
Created by [@YonLiud](https://github.com/YonLiud)

0 comments on commit fe87d28

Please sign in to comment.