Skip to content

Commit

Permalink
fix I18N issue #2 & fix esx example #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Metrakit committed May 10, 2019
1 parent c183a51 commit 4352f38
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
3 changes: 3 additions & 0 deletions vote/example.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Ceci est un exemple basique permettant un affiche des détails du vote en console
-- C'est seulement une demo, à vous de modifier à votre convenance.

AddEventHandler('onPlayerVote', function (playername, ip, date)
print(playername)
print(ip)
Expand Down
29 changes: 24 additions & 5 deletions vote/example_esx.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-- Ceci est un exemple basique utilisant ESX.
-- C'est seulement une demo, à vous de modifier à votre convenance.

ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)

local function getPlayerByName(playername)
local xPlayers = ESX.GetPlayers()
for i=1, #xPlayers, 1 do
Expand All @@ -11,12 +17,25 @@ end

AddEventHandler('onPlayerVote', function (playername, ip, date)
local player = getPlayerByName(playername)
if player then
player.addMoney(100)
if Player then
Player.addMoney(100)

-- Pour notifier (requiert pNotify) :
-- TriggerClientEvent("pNotify:SendNotification", -1, {
-- text = ""..playername.. " a voté pour le serveur</br>Il a gagné <b style='color:green'>100$</b>",
-- type = "info",
-- timeout = 15000,
-- layout = "centerRight"
-- })
else
print("Joueur introuvable !")

-- Pour notifier (requiert pNotify) :
-- TriggerClientEvent("pNotify:SendNotification", -1, {
-- text = "Un inconnu a voté pour le serveur !",
-- type = "info",
-- timeout = 15000,
-- layout = "centerRight"
-- })
end
print(playername)
print(ip)
print(date)
end)
Binary file modified vote/lib/VotePlugin.net.dll
Binary file not shown.

0 comments on commit 4352f38

Please sign in to comment.