Giter Club home page Giter Club logo

cfx-vote-plugin's Introduction

Votes plugin for FiveM / RedM servers (Cfx)

This is the Top-Games/Top-Serveurs (https://top-games.net / https://top-serveurs.net) new votes plugin which is used to receive votes directly on your FiveM/RedM server. When a player votes, Top-Games directly notifies your server and you can thus reward your players or make a ranking of the best voters (by example), the possibilities are endless.

But what is FiveM for? FiveM allows you to create a GTA server, you can find in particular a GTA 5 RP on our site.

Features

  • Event onPlayerVote allowing the reception of the votes cast on your server file in real time! This therefore allows actions to be taken accordingly. Example: rewarding voters.

Installation

  1. Copy the cfx-vote-plugin directory to the resources directory of your FiveM/RedM server

  2. Remember to open the chosen port (for example 8192) in UDP on your server/firewall.

  3. Configure the voting plugin in your server.cfg file like this:

ensure cfx-vote-plugin
# The token is mandatory. It is the token of your server file available on your panel https://top-games.net
set vote_token "XXXXXXXXX"
# The listening port of the plugin. Default is port 8192 but you can specify which one you want. Do not forget to configure it also on the management panel of your server on https://top-games.net/gta
set vote_port "8192"
  1. Use the onPlayerVote event to receive the votes cast. Some examples are available in the example.lua file, in the example_esx.lua file for a small example with ESX and in the example_vorp.lua file for an example with the VORP framework (remember to delete the example files you don't need). Also, here is a basic example:
AddEventHandler('onPlayerVote', function (playername, ip, date)
    -- Add actions here when a vote is received.
    -- For example: give In-Game money, give points, save in DB, ...
    print(playername)
    print(ip)
    print(date)
end)
  1. Start your server. If you see the message [VotePlugin] Voting plugin active on port xxxx, everything is fine!

  2. Last step: activate the voting plugin on the management panel of your server file. Go to https://top-games.net/gta in your server management, at the bottom there is a Voting plugin section. You need to activate the plugin and specify the port you indicated above in your server.cfg file. Once the plugin is activated, you can click on the button to test the connectivity and then it's up to you!

Help & Suggestions

If you need help setting up the plugin or if you have any suggestions, do not hesitate to contact us here: https://top-games.net/contact or at [email protected].

Contributors

Thanks to our contributors who help us improve the plugin:

cfx-vote-plugin's People

Contributors

dolutattoo avatar metrakit avatar xboubou avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cfx-vote-plugin's Issues

[Redm] Vorp example

hello the team. it would be possible to make it compatible with the vorp framework please. THANKS

Untrusted IP

Trusted IP list need to be updated.
If ever I reupload the trusted ip list to add new one I get token error.

unable to connect

I follow instruction, the console said "all is done" the port is good, the token is good too but when i try to test connectivity nothing append, and same for votes, idk why, no errors

Port Issues

Hello, i use plugin v2,
i have set in server.cfg new port and the key, i opened the port in the firewall but there's no communication between the API and the script.
i try with the basic port and it's the same...

Purpose of UDP + trusted IPS

Hello,

I’ve just read the source code but I don’t really understand the point of making the server in UDP, furthermore if the only source check is by IP address, as they can be spoofed really easily, so basically someone can grant anyone infinite rewards, you know.

Wouldn’t it be better to rewrite it using tcp / http ? Securing this in UDP would need a bit of over engineering signatures etc.

I would be proud to make a PR fixing this, of course.

Name of resource

Hi,

Please be aware that the vote resource NEEDS to be name exactly 'vote' else the plugin will never be called and will never connect to the website.

it has to do with line 3891 of the vote.js

if (resourceName === 'vote') {

Maybe use this native

GetCurrentResourceName();

witch returns the name of the resource folder

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.