Vote reward script suggestion [SCRIPT NOW AVAILABLE]

Liking the mod, but not sure where to put in the code to add money to the player. I have tested it and it does say you received reward but didnt get the money. Any help would be greatful.

1 Like

The moneyadd command does not exist on your server.
The moneyadd command is used as an example, it depends on your server, which plugin you use…
Commands must be executable by the console. Otherwise, you will get errors.

As a note, if you get 404 responses, change the URLs listed in the Server file to be secure, so https not http.

[“status”] = “https://api.trackyserver.com/vote/?action=status&key=%s&steamid=%s”,
[“claim”] = “https://api.trackyserver.com/vote/?action=claim&key=%s&steamid=%s”

This mod would be perfect if it included some examples of addmoney with the different overrides for admin levels such as the most frequently used es_admin2. This will turn alot of people away without something, I can appreciate there are many mods out there, but with most server admins not having a software background this will just confuse them.

Ozzie

3 Likes

I’m using this and the “say” command works, but i’ve added a command to add money that doesn’t work. It say “no such command”, but when i type it in the console by hand it does work? How is this possible

I think this is a good script except, the command ‘addmoney’ doesn’t work. I’ve changed it to ‘setmoney’, ‘giveaccountmoney’ but since it only accepts normal CFX commands this won’t work. How to fix such a thing?

Have you figured it out? I’m curious to see how this works because with ESX I cant get it to work.

Config.Rewards = {
["@"] = { – @ = all votes
“xPlayer.addAccountMoney(account, 20000)”, – add 20000 money for voting
“say {playername} has voted!”
},

That’s what I thought would work and it doesn’t. Also no way to test after you have done it once

For ESX-

Server.lua

Add up top line 1.

ESX = nil

TriggerEvent(‘esx:getSharedObject’, function(obj) ESX = obj end)

Where it says “RegisterCommand(“checkvote”, function(src, args, raw)” add

local _source = source --maybe redundant but its working
local xPlayer = ESX.GetPlayerFromId(_source)

Where it says "elseif(responseText == “1”) add

xPlayer.addAccountMoney(‘bank’, 500) – Can be changed to whatever
TriggerClientEvent(“esx:showNotification”, _source, “You have recieved $500 for voting”) --Just notifies the person

Hope this helps

I think it doesnt work.

where can I get the ServerKery