scalePhone - an iFruit Phone framework

Hello y’all :wave:

This is probably my best resource so far, up there with the lobby menu.

Behold, scalePhone - the GTA5 Phone framework

What this resource is:

  • A framework. You can build apps (read: menus), based on the different templates, like:
    • Contacts list,
    • Call Screen,
    • Message list / view
    • Email list / view
    • Numpad
    • Settings menu (prebuilt app)
    • Snapmatic (prebuilt app)
    • “To Do” list / view menus.
    • GPS (Coords and Zone Name) View (prebuilt )
    • Generic list menu.

What this resource is NOT:

  • It’s not a full phone! You can’t call / message anyone by default. You will have to build the logic yourself (or ask someone else to do it)

How it works:

You pretty much have to push the data into the phone. And I set up some nice events to help you out!

--examples. All events will be available in the github Wiki
TriggerEvent('scalePhone.BuildHomepageApp', appID, appType, appName, appIcon, appNotificationInt--[[only working on homepage apps]], openEvent, backEvent, data)
TriggerEvent('scalePhone.BuildThemeSettings', appID)
TriggerEvent('scalePhone.BuildSnapmatic', appID)
  • Every menu(app) will trigger a “openEvent” whenever it’s…opened, and a “backEvent” whenever you hit the back button in the menu (this also needs to handle moving between apps). Both triggers will pass a custom “data” param, which can be an array, bool, int, whatever.
  • Moreover, every button time you select a button, it will trigger the event connected with that button, and a button-specifi eventParams variable.

Some screenshots that showcase what you CAN do:

image
imageimage


imageimage
imageimage

Go grab it!

update: I gotta do my shout-outs now!

  • @Xinerki - Initial work on the phone stuff. A lot of code was initially based on his KGV Phone.
  • @SleepingTears - Lots of help with reading the scaleforms.

NEW! BREAKING! Want to see the phone in action? Try my App Pack!

  • People asked. I delivered. I made a resource that adds a bunch of apps to this phone.
    • You will need the framework active.
    • If you want to use the calling function you will need either pma-voice or mumble-voip(added, but not tested) (check sv_connections.lua)
  • Github link for the app pack: https://github.com/CritteRo/crit-phone
38 Likes

Nice one! Great work!

Here is a working example on how to setup a working “Numpad” app.

--[[ initial app building ]]
TriggerEvent('scalePhone.BuildHomepageApp', 7, "numpad", "Numpad", 27, 0, "scalePhone.OpenNumpad", "scalePhone.GoToHomepage", {})
local pad = 0
numpadNumber = 0
for i=1,9,1 do
    pad = {text = i, event = "scalePhone.NumpadAddNumber", eventParams = {add = i}} -- "scalePhone.NumpadAddNumber" is a prebuilt event that adds text to the numpad screen
    TriggerEvent('scalePhone.BuildAppButton', 7, pad, false, -1)
end
pad = {text = 'RES', event = "scalePhone.NumpadAddNumber", eventParams = {add = 'res'}}
TriggerEvent('scalePhone.BuildAppButton', 7, pad, false, -1)
pad = {text = 0, event = "scalePhone.NumpadAddNumber", eventParams = {add = 0}}
TriggerEvent('scalePhone.BuildAppButton', 7, pad, false, -1)
pad = {text = 'GO', event = "phone.UseNumpadNumber", eventParams = {add = 'go'}} -- "phone.UseNumpadNumber" will be our handler
TriggerEvent('scalePhone.BuildAppButton', 7, pad, false, -1)
-- [[ handlers ]] 
AddEventHandler('scalePhone.Event.GetNumpadNumber', function(number) -- prebuilt event. triggered whenever the numpad text is changed.
    numpadNumber = number --numpadNumber will be our "to use" variable
end)

AddEventHandler('phone.UseNumpadNumber', function() --event triggered by the "GO" button on numpad.
    if numpadNumber == "20121999" then
        print('you found the secret number!')
    else
        print('invalid number!')
    end
end)
2 Likes

Love it, thank you so much to share!
But email works or is just graphics ?

this is amazing bro :heartpulse:

1 Like

As mentioned in the post, the logic (actual writing, sending and receiving) needs to be created by you.

I will release a full-fledged phone based on this soonTM.

3 Likes

cant wait for this, if you could accually call or atleast text/email people with this, would be awesome.

Never actually worked with voice stuff behore. I’ll try to make something with pma-voice or similar, and share the code. But the possibility is there.

This is insane !

This looks freaking amazing. I mean, I’m too dumb to ever utilize it but I hope other people make great things out of it!

I’ll be happy to buy a phone system like this!

Just to let you know this has the free tag and the paid tag on it

Thanks! I’ll change that. I think the paid tag gets added automatically when a tebex link is present.

2 Likes

Good job, awesome

Yeah true thank you for fixing it know its a minor issue but i like to make sure people don’t confused.

Thats So Cool Tank You, But Can You Help Me To Add More App Icon For Phone (In Home Page) ?

Not sure if you can make more icons that 9 but I have the icon ID’s and images here: iFruit Phone Icons · ModoSN/fivem-wiki Wiki (github.com)

At the moment, the framework will only show the first nine homepage apps. There might be a way to increase that (I know R* does it), but for some reason the scaleform doesn’t like to load more than that.

I might need to rethink how the homepage view works…at some point.

The Wiki has (currently incomplete) examples on how to add every type of app. You can find an example of the numpad app here.

For more app icons… the scaleform most likely needs to be edited and streamed again (if that even works).

Hello all,

Update:

  • Soft Buttons!

    • For now they are hardcoded for each template, but that might change in the future.
  • Sleep Mode:

    • You can now toggle the phone’s Sleep Mode, with “scalePhone.ToggleSleepMode”, and get current Sleep Mode status with the “sleepModeStatus()” export.
      image
  • “Settings” template support for menus.

    • Buttons require (‘text’ = string, ‘icon’ = integer, ‘event’ = string, ‘eventParam’ = any)
  • “Themes” prebuilt app is now called “Settings”, and it includes support for both themes and Sleep Mode.
    image

<<| Friendly reminder that the Wiki is still being updated at the moment |>>

nice script i like it!

2 Likes