Giter Site home page Giter Site logo

davedumas0 / fivem-ifruit-phone Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pappaniels/fivem-ifruit-phone

0.0 0.0 0.0 97 KB

The standard phone from Grand Theft Auto Online by Rockstar Games for FiveM.

Home Page: https://forum.cfx.re/t/ifruit-phone-standalone/4892391

License: Other

Lua 100.00%

fivem-ifruit-phone's Introduction

FiveM-iFruit-Phone

This is the only phone you need in FiveM! The original iFruit phone from Grand Theft Auto Online. With almost all the capabilities from the original phone (Still missing: internet, quick job, camera, securoserv and the call option). And the most amazing part, it is 3% thinner, 3% faster and comes with a 30 hour queue.

How to use

Resource wise it is like every other resource. Put it into your resource folder and add the resource in your server config. This resource has no dependencies, so you can use it in any server (if the controls and event are not already used ;) ).

The controls are like the phone from GTA:O. Arrow keys, enter and escape are controls that are used but can be changed if desired (Native: IsControlJustPressed(), Key hashes: https://https://docs.fivem.net/docs/game-references/controls/. The main settings can be changed in the config.lua. For example, if you don't want the standard GTA:O contacts.

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)
  • 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, returnEvent, 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)

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 https://docs.fivem.net/docs/game-references/blips/#blip-colors for the colour ids)
  • useExtraBlip = If a extra blip needs to be created for the entity (bool)
  • sprite = The blip icon (integer) (See https://docs.fivem.net/docs/game-references/blips 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

TriggerClientEvent("cl:ifruit:setSecuroServ", 1, obj, 10.0, 1, true, 1, "myServerEvent", true)

Contributing

If you want to add a feature that is missing, add a non-existing feature or optimize the code, feel free to make a pull request. And if there is something that does not work as intended you can make an issue or make a pull request to fix it. Every kind of help will be much appreciated <3.

fivem-ifruit-phone's People

Contributors

pappaniels avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.