The all new iFruit 9ix is here! Now 3% thinner, 3% faster and a 30 hour queue.
This is the well known phone from Grand Theft Auto Online! I needed this phone for my upcoming resource, but i decided to share this one in advance!
What is so special about this phone?
It is an iFruit! Duhh… Everyone wants an iFruit nowadays. It is THE phone to have right now.
All jokes aside, it is a phone that every GTA player that is familiar with. Some of the current ‘apps’ of the phone like the internet, do not have a function yet, but the basic things like texts, emails, contacts and settings are there. Using the events that are listed below or you can find in the read me, can you utilise most of the phone’s options.
The events
Send a e-mail
To send an email you need to trigger the following event:
TriggerClientEvent("cl:ifruit:receiveEmail", player, sender, title, message, withFile) -- or TriggerEvent if you are triggering it client-sided (remove the player parameter)
-
player = The server id that receives the email (integer)
-
sender = The server id that sent the email (integer or string)
-
title = The title of the mail (string)
-
message = The message the mail contains (string)
-
withFile = If the email has a picture attached to it (boolean) (no images can be attached yet)
Example
TriggerClientEvent("cl:ifruit:receiveEmail", 2, 1, "This is a title", "This is the message", false)
Send a text
To send a text you need to trigger the following event:
TriggerClientEvent("cl:ifruit:receiveText", player, sender, title, message, hour, minute, avatar) -- or TriggerEvent if you are triggering it client-sided (remove the player parameter)
-
player = The server id that receives the text (integer)
-
sender = The server id that sent the text (integer or string)
-
title = The title of the text (string)
-
message = The message the text contains (string)
-
hour = The hour that the text was sent (integer). You can use GetClockHours() to get the current hour.
-
minute = The minute that the text was sent (integer). You can use GetClockMinutes() to get the current minutes.
-
avatar = The avatar of the certain person (string). Default is char_default, but you can use others, like those from the contacts (see contacts.lua).
Example
TriggerClientEvent("cl:ifruit:receiveText", 2, "Ms. Baker", "This is a title", "This is a message", GetClockHours(), GetClockMinutes(), "char_casino_manager")
Add the ‘Detonate Bomb’ contact
This part will add or remove the 'Detonate Bomb 'contact. This only adds or removes the contact for now.
TriggerClientEvent("cl:ifruit:setBombContact", player, addContact, eventName, isServerEvent) -- or TriggerEvent if you are triggering it client-sided (remove the player parameter)
-
player = The server id that gets or loses the ‘Detonate Bomb’ contact (integer)
-
addContact = If the contact gets added or removed (boolean)
-
eventName = The event that triggers when you ‘call’ the bomb (string)
-
isServerEvent = If the event is a server event (boolean)
Example
TriggerClientEvent("cl:ifruit:setBombContact", 1, true, "myClientEvent", false)
Invite to job
To add an job invite you need to trigger the following event:
TriggerClientEvent("cl:ifruit:invitePlayer", player, sender, title, description, colour, avatar, returnEvent, isServerEvent) -- or TriggerEvent if you are triggering it client-sided (remove the player parameter)
-
player = The server id that receives the job invite (integer)
-
sender = The server id that sent the job invite (integer or string)
-
title = The title of the job (string)
-
description = The description of the job (string). The heists all start with 'Heist : ’ and all the others start with 'Invite to ', but is not mandatory.
-
colour = The colour of the field (integer). See research.md for all the known colours.
-
avatar = The avatar of the certain person (string). Default is char_default, but you can use others, like those from the contacts (see contacts.lua).
-
returnEvent = The event that triggers when you accept the job invite (string)
-
isServerEvent = If the event is a server event (boolean)
Example
TriggerClientEvent("cl:ifruit:invitePlayer", 1, 2, "The Diamond Casino Heist", " Heist : Diamond Casino Heist", 1, "char_lester", "myClientEvent", false)
Activate the SecuroServ Hack system
To use the hack system, use the following event:
TriggerClientEvent("cl:ifruit:setSecuroServ", player, entity, radius, colour, useExtraBlip, sprite, returnEvent, isServerEvent) -- or TriggerEvent if you are triggering it client-sided (remove the player parameter)
-
player = The server id that receives the job invite (integer)
-
entity = The entity that the player needs to be close to in order to use the hack (entity). You can put 0 here to ignore the radius. The blips will also not be created.
-
radius = The radius that the person needs to be in (float)
-
colour = The colour of the blip (integer) (See Blips - Cfx.re Docs for the colour ids)
-
useExtraBlip = If a extra blip needs to be created for the entity (bool)
-
sprite = The blip icon (integer) (See Blips - Cfx.re Docs for the blip ids) (If useExtraBlip is false, you can put 0 here)
-
returnEvent = The event that gets triggered when the hack is completed (string)
-
isServerEvent = If the return event is a server event (bool)
Example
local modelHash = "prop_weed_01"
RequestModel(modelHash)
while not HasModelLoaded(modelHash) do
Wait(1)
end
obj = CreateObject(GetHashKey(modelHash), -1004.0, 4963.12, 194.5, false, false, false) -- Weed plant at the cult fort
-- This is TriggerEvent, because the code above is client-sided
TriggerEvent("cl:ifruit:setSecuroServ", obj, 10.0, 1, true, 1, "myServerEvent", true)
I like the phone, but i want to give my own twist to it. Is that possible?
Yes! The entire code is open source, so you can make it your own!. It comes with a file called research.md, so you can change certain icons, apps and their purposes.
There are some things missing and I made them or I can improve the code of the resource
Good! If you want, you can make a pull request on my github repo, so we can make this resource like the one from GTA.
And yes I am not the best scripter, so there might be a better way to make this script (I am sorry)… If you want, you can make a pull request to improve the code.
Download
Download the resource here (version 1.2) or download it via Github. The latest version is always on github.
You told us that you needed this phone for another resource, what kind of resource will that be?
Some of you already know it, but i will give you a hint. Cheese and Crackers. Stay tuned!