@@ -7,7 +7,7 @@ local Calls = {}
77local Adverts = {}
88local GeneratedPlates = {}
99local WebHook = ' '
10- local FivemerrApiToken = ' API_KEY_HERE '
10+ local FivemerrApiToken = ' '
1111local bannedCharacters = { ' %' , ' $' , ' ;' }
1212local TWData = {}
1313
@@ -34,14 +34,6 @@ local function escape_sqli(source)
3434 return source :gsub (" ['\" ]" , replacements )
3535end
3636
37- local function round (num , numDecimalPlaces )
38- if numDecimalPlaces and numDecimalPlaces > 0 then
39- local mult = 10 ^ numDecimalPlaces
40- return math.floor (num * mult + 0.5 ) / mult
41- end
42- return math.floor (num + 0.5 )
43- end
44-
4537function QBPhone .AddMentionedTweet (citizenid , TweetData )
4638 if MentionedTweets [citizenid ] == nil then
4739 MentionedTweets [citizenid ] = {}
@@ -298,7 +290,7 @@ QBCore.Functions.CreateCallback('qb-phone:server:PayInvoice', function(source, c
298290
299291 if exists [1 ] and exists [1 ][" count" ] == 1 then
300292 if SenderPly and Config .BillingCommissions [society ] then
301- local commission = round (amount * Config .BillingCommissions [society ])
293+ local commission = QBCore . Shared . Round (amount * Config .BillingCommissions [society ])
302294 SenderPly .Functions .AddMoney (' bank' , commission )
303295 invoiceMailData = {
304296 sender = ' Billing Department' ,
613605QBCore .Functions .CreateCallback (' qb-phone:server:UploadToFivemerr' , function (source , cb )
614606 local src = source
615607
616- if Config .Fivemerr == ' ' then
608+ if Config .Fivemerr == true and FivemerrApiToken == ' ' then
617609 print (" ^1--- Fivemerr is enabled but no API token has been specified. ---^7" )
618610 return cb (nil )
619611 end
@@ -841,31 +833,18 @@ end)
841833
842834RegisterNetEvent (' qb-phone:server:UpdateTweets' , function (NewTweets , TweetData )
843835 local src = source
844- if Config .Linux then
845- MySQL .insert (' INSERT INTO phone_tweets (citizenid, firstName, lastName, message, date, url, picture, tweetid) VALUES (?, ?, ?, ?, ?, ?, ?, ?)' , {
846- TweetData .citizenid ,
847- TweetData .firstName ,
848- TweetData .lastName ,
849- TweetData .message ,
850- TweetData .date ,
851- TweetData .url :gsub (' [%<>\" ()\' $]' , ' ' ),
852- TweetData .picture :gsub (' [%<>\" ()\' $]' , ' ' ),
853- TweetData .tweetId
854- })
855- TriggerClientEvent (' qb-phone:client:UpdateTweets' , - 1 , src , NewTweets , TweetData , false )
856- else
857- MySQL .insert (' INSERT INTO phone_tweets (citizenid, firstName, lastName, message, date, url, picture, tweetid) VALUES (?, ?, ?, ?, ?, ?, ?, ?)' , {
858- TweetData .citizenid ,
859- TweetData .firstName ,
860- TweetData .lastName ,
861- TweetData .message ,
862- TweetData .time ,
863- TweetData .url :gsub (' [%<>\" ()\' $]' , ' ' ),
864- TweetData .picture :gsub (' [%<>\" ()\' $]' , ' ' ),
865- TweetData .tweetId
866- })
867- TriggerClientEvent (' qb-phone:client:UpdateTweets' , - 1 , src , NewTweets , TweetData , false )
868- end
836+
837+ MySQL .insert (' INSERT INTO phone_tweets (citizenid, firstName, lastName, message, date, url, picture, tweetid) VALUES (?, ?, ?, ?, ?, ?, ?, ?)' , {
838+ TweetData .citizenid ,
839+ TweetData .firstName ,
840+ TweetData .lastName ,
841+ TweetData .message ,
842+ TweetData .time ,
843+ TweetData .url :gsub (' [%<>\" ()\' $]' , ' ' ),
844+ TweetData .picture :gsub (' [%<>\" ()\' $]' , ' ' ),
845+ TweetData .tweetId
846+ })
847+ TriggerClientEvent (' qb-phone:client:UpdateTweets' , - 1 , src , NewTweets , TweetData , false )
869848end )
870849
871850RegisterNetEvent (' qb-phone:server:TransferMoney' , function (iban , amount )
@@ -888,7 +867,7 @@ RegisterNetEvent('qb-phone:server:TransferMoney', function(iban, amount)
888867 end
889868 else
890869 local moneyInfo = json .decode (result [1 ].money )
891- moneyInfo .bank = round (( moneyInfo .bank + amount ) )
870+ moneyInfo .bank = QBCore . Shared . Round ( moneyInfo .bank + amount )
892871 MySQL .update (' UPDATE players SET money = ? WHERE citizenid = ?' ,
893872 { json .encode (moneyInfo ), result [1 ].citizenid })
894873 sender .Functions .RemoveMoney (' bank' , amount , ' phone-transfered' )
0 commit comments