Calculator UI with custom prop š
Version: 1.2
Download here!
-
Github Download
-
Github Repo
-
ESX Peeps
What is this?
This is a calculator ;p That let you do what a calculator do š
- Standalone script, so it dosent require any other scripts or frameworks
How to use?
- Type /calc in the chat
Installation
- Download the resource from the link above - Drag the calculator resource into your Resources folder - Add start calculator into server.cfg
Bugs?
Not that i know of?
Do you find a bug, then you are welcome to
report
it!
Credits
Big thanks to Aswad Ali
, for giving me access to release this for you guys, since this is his work! He released the calculator on Codepen, you can find it here > Proof of permission
And not to forget my buddy, who made the custom prop for this release! @Bobo_Boss <3
Cheers.
12 Likes
Mart475
November 3, 2019, 10:01pm
2
Really cool script. Is there a way to make it an item for esx?
TerbSEC
November 3, 2019, 10:03pm
3
I donāt work with ESX, so i dont know how it works.
But i guess its easy tho.
TerbSEC
November 3, 2019, 10:15pm
6
If you PM me with the code, then i can edit a download for it on this topic with your credits;)
Mart475
November 3, 2019, 10:17pm
7
Standalone and ESX would be really cool, could also be re-worked for vrp aswell.
it is a stand alone script it will work with any framework
Woopi
November 3, 2019, 10:51pm
9
why the fu*k is that always the first thing people ask for? omgā¦
1 Like
Agree - dont get why they dont do it them self, it takes litterly like 2 min to convert this in to esx.
create server.lua
Add
ESX.RegisterUsableItem('calculator', function(source)
TriggerClientEvent('Calculator:Open', source)
end)
Open client.lua
Remove the this part.
RegisterCommand('calc', function(source, args, rawCommand)
if (oIsAnimationOn == false) then
Calculator()
end
end)
Go to the end of the script add the following
RegisterNetEvent('Calculator:Open')
AddEventHandler('Calculator:Open', Calculator)
Open __resource.lua
Add
server_scripts {
'server.lua'
}
Add Item to Items in mysql create a item called calculator, add it to your shops if you want to.
Now you got it as a item needed, and as something that can only be āopenedā up if you got the item.
This aint tested there might need to be added a piece of code to close all esx menuās down, but again this is how simple it is to make something in to an item.
1 Like
How do you exit the calculator? Pressing escape doesnāt seem to take it away
TerbSEC
November 4, 2019, 3:55am
12
Download it again from Github, and dont rename the resourceā¦
I made a mistake before;p Should be fixed, so ESC work again.
Edit : https://github.com/TerbSEC/Calculator/releases/tag/1.1
1 Like
TerbSEC
November 4, 2019, 9:39pm
15
SezayThomas:
how to close the calc ?
ESC or the Back button on the calc.
TerbSEC
November 4, 2019, 11:10pm
16
@CruelAlpha and @SezayThomas
I made a stupid mistake lol
If you download the newest version now, it should work just fine to close it;P
The folder name need to be calculator ;p Remember that.
Cheers, iāll try that. is the āCā in calculator meant to be capital or simple?
This doesnt work at all for me.
TerbSEC
November 5, 2019, 8:32pm
21
For ESX Users!
If you want the calculator as an item, follow these steps!
Add this into your Client.lua
RegisterNetEvent("Calculator:Open")
AddEventHandler("Calculator:Open", function()
Calculator()
end)
Create a new Server.lua, and put this in it!
ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
ESX.RegisterUsableItem('calculator', function(source)
TriggerClientEvent('Calculator:Open', source)
end)
And then, add this to your __resource.lua
server_scripts {
"server.lua"
}
Last step: Add ācalculatorā to the item table in database.
ez pz lemon squeezy
3 Likes
No need to do this.
Just do
RegisterNetEvent('Calculator:Open')
AddEventHandler('Calculator:Open', Calculator)
Just has to be below the function Calculator to work
It basicly just calls the function direct, insted of having to do the wrapping around a function all.
You can actually even do it with functions that require parameters like
function something(a,b,c)
print(a)
end
Then add the RegisterNetEvent.
And you are able to call
TriggerEvent(āeventNameā, a, b, c) direct, easy method to keep the code cleaned up.
1 Like
TerbSEC
November 6, 2019, 1:25am
23
The function thing is normal.
But never heard about that
AddEventHandler('Calculator:Open', Calculator)
before tho
1 Like