Öncelikle sistemin sorunsuz calışması icin ilk önce log sistemini kuralım ve daha sonra bazı yerleri değiştirelim.
Kod:
--KONUM : gcphone\server\twitter.lua
-- BU KODLARI BULUP
function TwitterPostTweet (username, password, message, sourcePlayer, realUser, cb)
getUser(username, password, function (user)
if user == nil then
if sourcePlayer ~= nil then
TwitterShowError(sourcePlayer, 'Twitter Info', 'APP_TWITTER_NOTIF_LOGIN_ERROR')
end
return
end
MySQL.Async.insert("INSERT INTO twitter_tweets (`authorId`, `message`, `realUser`) VALUES(@authorId, @message, @realUser);", {
['@authorId'] = user.id,
['@message'] = message,
['@realUser'] = realUser
}, function (id)
MySQL.Async.fetchAll('SELECT * from twitter_tweets WHERE id = @id', {
['@id'] = id
}, function (tweets)
tweet = tweets[1]
tweet['author'] = user.author
tweet['authorIcon'] = user.authorIcon
TriggerClientEvent('gcPhone:twitter_newTweets', -1, tweet)
end)
end)
end)
end
-- BU ŞEKİL DE DEĞİŞTİRİYORUZ
function TwitterPostTweet (username, password, message, sourcePlayer, realUser, cb)
getUser(username, password, function (user)
if user == nil then
if sourcePlayer ~= nil then
TwitterShowError(sourcePlayer, 'Twitter Info', 'APP_TWITTER_NOTIF_LOGIN_ERROR')
end
return
end
MySQL.Async.insert("INSERT INTO twitter_tweets (`authorId`, `message`, `realUser`) VALUES(@authorId, @message, @realUser);", {
['@authorId'] = user.id,
['@message'] = message,
['@realUser'] = realUser
}, function (id)
MySQL.Async.fetchAll('SELECT * from twitter_tweets WHERE id = @id', {
['@id'] = id
}, function (tweets)
tweet = tweets[1]
tweet['author'] = user.author
tweet['authorIcon'] = user.authorIcon
TriggerClientEvent('gcPhone:twitter_newTweets', -1, tweet)
local txxxt = "*? Twitter* \nOyuncu Hex : `".. realUser .. "`\nHesap Adı : (`" .. user.author .. "`) \nMesajı : " .. message .." \nID : (`" .. sourcePlayer .. "`)"
TriggerEvent('android:sendToDiscord2', txxxt, "webhook gir")
end)
end)
end)
end
-- KONUM : gcphone\server\yellow.lua
-- BU KODLARI BULUP
function YellowPostPages (phone_number, firstname, lastname, message, sourcePlayer, cb)
getUserYellow(phone_number, firstname, function (user)
if user == nil then
if sourcePlayer ~= nil then
TwitterShowError(sourcePlayer, 'Twitter Info', 'APP_TWITTER_NOTIF_LOGIN_ERROR')
end
return
end
MySQL.Async.insert("INSERT INTO yellow_tweets (`phone_number`, `firstname`, `lastname`, `message`) VALUES(@phone_number, @firstname, @lastname, @message);", {
['@phone_number'] = phone_number,
['@firstname'] = firstname,
['@lastname'] = lastname,
['@message'] = message
}, function (id)
MySQL.Async.fetchAll('SELECT * from yellow_tweets WHERE id = @id', {
['@id'] = id
}, function (pagess)
pages = pagess[1]
pages['firstname'] = user.firstname
pages['phone_number'] = user.phone_number
TriggerClientEvent('gcPhone:yellow_newPagess', -1, pages)
TriggerEvent('gcPhone:yellow_newPagess', pages)
end)
end)
end)
end
-- BU ŞEKİL DE DEĞİŞİYORUZ.
function YellowPostPages (phone_number, firstname, lastname, message, sourcePlayer, cb)
getUserYellow(phone_number, firstname, function (user)
if user == nil then
if sourcePlayer ~= nil then
TwitterShowError(sourcePlayer, 'Twitter Info', 'APP_TWITTER_NOTIF_LOGIN_ERROR')
end
return
end
MySQL.Async.insert("INSERT INTO yellow_tweets (`phone_number`, `firstname`, `lastname`, `message`) VALUES(@phone_number, @firstname, @lastname, @message);", {
['@phone_number'] = phone_number,
['@firstname'] = firstname,
['@lastname'] = lastname,
['@message'] = message
}, function (id)
MySQL.Async.fetchAll('SELECT * from yellow_tweets WHERE id = @id', {
['@id'] = id
}, function (pagess)
pages = pagess[1]
pages['firstname'] = user.firstname
pages['phone_number'] = user.phone_number
TriggerClientEvent('gcPhone:yellow_newPagess', -1, pages)
TriggerEvent('gcPhone:yellow_newPagess', pages)
local txxxt = "*? Sarı Sayfalar* \nOyuncu No : `".. phone_number .. "`\nHesap Adı : (`" .. firstname .. "`) \nMesajı : " .. message .." \nID : (`" .. sourcePlayer .. "`)"
TriggerEvent('android:sendToDiscord2', txxxt, "webhook gir")
end)
end)
end)
end