[Tutorial] - GCPhone - Adding calls and job messages

How i use the GCPhone with OneSync ?? :frowning:
on the local server without onesync it works but on the vps with one sync it does not work because i do not hear any user

That is a big boy question!
BUMPS


I hit “F2” and it doesn’t open up the phone it just plays the emote!

Did you install the SQL for the phone? also are you using the Halcroves version or the BTN version of the phone?

wat u using for those cop peds? eup? you have relog issue when people relog the skins don’t appear and they have to relog again to fix? Almost like a sync problem?

Also what BTN said, you need the SQL prob, what version u using?

@BTNGaming I am using the phone from the link of this guide, and I do have the sql files in the SQL!

Edit gcphone/html/static/js/app.js replace fr_FR with en_US

Yeah I have the same issue as well.

after the FiveM update when calling each other, i cant hear them. Before it worked perfectly, wtf?

So i am trying to install this into my server with ESX and Async but i cant find the language change, I’ve looked in the file you said and it just shows my what the different language options are but there is no where for default language choice.

I also seem to be confused on how to install this i downloaded GcPhone-master

Alright well I got GCPhone working.

I have a question though. I don’t want people registering using the Twitter app to be able to choose a username, but to lock their username to getIdentity instead. Can anyone help me implement this?

Looking for the exact same thing! Hopefully this is do-able and we are just missing something or someone has already done it and will be kind enough to share it. If not it’s just another thing on the to-do list for me.

1 Like

It’s definitely doable, I seen it on another server which is why I thought it would be useful.

Ah yeah wasn’t very clear in my post, sorry. I meant maybe there is a setting for it already and just missing it. Just digging into it so haven’t seen every file yet.

In client/twitter.lua, you’ll see;

  TriggerServerEvent('gcPhone:twitter_login', data.username, data.password)
end)
RegisterNUICallback('twitter_changePassword', function(data, cb)
  TriggerServerEvent('gcPhone:twitter_changePassword', data.username, data.password, data.newPassword)
end)


RegisterNUICallback('twitter_createAccount', function(data, cb)
  TriggerServerEvent('gcPhone:twitter_createAccount', data.username, data.password, data.avatarUrl)
end)

RegisterNUICallback('twitter_getTweets', function(data, cb)
  TriggerServerEvent('gcPhone:twitter_getTweets', data.username, data.password)
end)

RegisterNUICallback('twitter_getFavoriteTweets', function(data, cb)
  TriggerServerEvent('gcPhone:twitter_getFavoriteTweets', data.username, data.password)
end)

RegisterNUICallback('twitter_postTweet', function(data, cb)
  TriggerServerEvent('gcPhone:twitter_postTweets', data.username or '', data.password or '', data.message)
end)

RegisterNUICallback('twitter_toggleLikeTweet', function(data, cb)
  TriggerServerEvent('gcPhone:twitter_toogleLikeTweet', data.username or '', data.password or '', data.tweetId)
end)

RegisterNUICallback('twitter_setAvatarUrl', function(data, cb)
  TriggerServerEvent('gcPhone:twitter_setAvatarUrl', data.username or '', data.password or '', data.avatarUrl)
end)

I believe changing the data.username value that pulls something from esx_identity might be the way of making it so the username is already set as your character name. I’m not 100% sure though, could you test it? I have no idea what I’m doing so I don’t want to break anything(even though I can just revert but still).

Try to replace SQL request in gcphone/server/twitter.lua in function TwitterGetTweets

function TwitterGetTweets (accountId, cb)
  if accountId == nil then
    MySQL.Async.fetchAll([===[
      SELECT twitter_tweets.*,
        CONCAT(users.NAME, " @ ", twitter_accounts.username)  as author,
        twitter_accounts.avatar_url as authorIcon
      FROM twitter_tweets
        LEFT JOIN twitter_accounts
          ON twitter_tweets.authorId = twitter_accounts.id
        LEFT JOIN users
          ON twitter_tweets.realUser = users.identifier
      ORDER BY time DESC LIMIT 130
    ]===], {}, cb)
  else
    MySQL.Async.fetchAll([===[
      SELECT twitter_tweets.*,
        CONCAT(users.NAME, " @ ", twitter_accounts.username)  as author,
        twitter_accounts.avatar_url as authorIcon,
        twitter_likes.id AS isLikes
      FROM twitter_tweets
        LEFT JOIN twitter_accounts
          ON twitter_tweets.authorId = twitter_accounts.id
        LEFT JOIN twitter_likes 
          ON twitter_tweets.id = twitter_likes.tweetId AND twitter_likes.authorId = @accountId
        LEFT JOIN users
          ON twitter_tweets.realUser = users.identifier
      ORDER BY time DESC LIMIT 130
    ]===], { ['@accountId'] = accountId }, cb)
  end
end

If this works, repeat for TwitterGetFavotireTweets and update TwitterPostTweet

-- TwitterPostTweet ( ...
--  ligne 85
      function (tweets)
        tweet = tweets[1]
        tweet['author'] = user.author -- ??? + user.name
        tweet['authorIcon'] = user.authorIcon
        TriggerClientEvent('gcPhone:twitter_newTweets', -1, tweet)
        TriggerEvent('gcPhone:twitter_newTweets', tweet)
      end)
-- ...................

Would this work for Twitter registration though? When someone registers, I want their character name to already be inputted and not able to change.

Edit: All this does is add your Steam identifier in front of the username you created with an @ as well.

This exemple if work show => " CharacterName @ TwitterPseudo "

Edit: Does it suit you?

Unfortunately not. All that’s doing is putting your Steam name in front of your Twitter username.

What I’m looking for is to, on the Twitter sign up page, lock the username to your Identity character name.

For example, I go to the Twitter app to sign up, the username already says your character name and all you have to do is enter a password and click create account.