FiveSPN-BioGen is a FiveM resource for generating random names and dates of birth for online server gameplay. These names can be used to quickly create personas for role-players or to generate information given to game AI. FiveSPN-Persona and FiveSPN-Ai use this resource.
For best performance and monitoring, make sure the FiveSPN--Logger resource is utilized properly. This resource is available in the Full Suite or from the Source
Copy the folder inside of the FiveMResource folder into your server's resources folder and add it to the server.cfg with the following line.
start FiveSPN-BioGen
Client based request - receive event handlers examples:
EventHandlers["FiveSPN-BioGen-ClientGetName"] += new Action<string, string>(ClientRxName);
EventHandlers["FiveSPN-BioGen-ClientGetDob"] += new Action<string>(ClientRxDob);
EventHandlers["FiveSPN-BioGen-ClientGetAll"] += new Action<string, string, string, bool>(ClientRxAll);
Client based request - event triggers examples:
TriggerServerEvent("FiveSPN-BioGen-ClientGetName", true);
TriggerServerEvent("FiveSPN-BioGen-ClientGetDob");
TriggerServerEvent("FiveSPN-BioGen-ClientGetAll", true);
Server based request - receive event handlers examples:
EventHandlers["FiveSPN-BioGen-RxName"] += new Action<string, string, string>(ClientRxName);
EventHandlers["FiveSPN-BioGen-RxDob"] += new Action<string, string>(ClientRxDob);
EventHandlers["FiveSPN-BioGen-RxAll"] += new Action<string, string, string, string, bool>(ClientRxAll);
private void ClientRxName(string target, string arg1, string arg2)
{
if (target != API.GetCurrentResourceName()) return;
Debug.WriteLine("Received Name: "+arg1+" "+arg2);
}
private void ClientRxDob(string target, string dateString)
{
if (target != API.GetCurrentResourceName()) return;
var date = DateTime.Parse(dateString);
Debug.WriteLine("Received DOB: "+ date.Date.ToString("d"));
}
private void ClientRxAll(string target, string arg1, string arg2, string dateString, bool arg4)
{
if (target != API.GetCurrentResourceName()) return;
var date = DateTime.Parse(dateString);
Debug.WriteLine("Received All: "+ arg1 +" "+ arg2+" "+ date.Date.ToString("d") + " " + (arg4?"Male":"Female"));
}
Server based request - event triggers examples:
TriggerEvent("FiveSPN-BioGen-TxName", API.GetCurrentResourceName(), true);
TriggerEvent("FiveSPN-BioGen-TxDob", API.GetCurrentResourceName());
TriggerEvent("FiveSPN-BioGen-TxProfile", API.GetCurrentResourceName(), true);
Sample output:
Received Name: Leland Laico
Received Name: Joella Nanneman
Received DOB: 01/03/1965
Received DOB: 05/09/1964
Received All: Bilal Lovig 05/26/1971 Male
Received All: Viviana Paulini 11/11/1986 Female
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
FiveM development can be even more amazing if we work together to grow the open source community!
Lets Collab! Join the project discord at itsthenom.com!
Copyright ©2022 Owen Dolberg (SourPatchNom)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
In the hopes that the greater community may benefit, you may use this code under the GNU Affero General Public License v3.0.
This resource distribution utilizes the Newtonsoft.JSON Library under the MIT License.
Source data for random name generation is collected from the 1883-2000 U.S. Census and was originally sourced from rossgoodwin and used under the Freedom of Information Act (FOIA).
All names and dates of birth generated by this software are fictitious. No identification with actual persons (living or deceased) is intended or should be inferred.
This software references the CitizenFX.Core.Server and CitizenFX.Core.Client nuget packages (c) 2017-2020 the CitizenFX Collective used under license and under the FiveM Service Agreement
Never heard of FiveM? Learn more about the CitizenFX FiveM project here