GithubHelp home page GithubHelp logo

sourpatchnom / fivespn---biogen Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 6.54 MB

FiveSPN-BioGen is a FiveM resource for generating random names and dates of birth for server gameplay!

License: GNU Affero General Public License v3.0

C# 98.25% Lua 1.75%
fivem fivem-script fivem-server

fivespn---biogen's Introduction

FiveSPN-BioGen

FiveSPN-BioGen Banner

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.

Prerequisites

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

Installation

Step One: Add the resource to your server.

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

Usage

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

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Discord

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!

Licensing

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.