[Release] VK_Main : Useful functions | 0.1.0

VK_Main didn’t find a better name, so I put the folder’s name from my server. If you have any ideas…

VK_main is a sort of framework for your script, it will help you and make you save precious time. The time of copy/paste functions like “tablelenght” is over.

Our goals

To provide a list of useful functions for any resources.
Regrouping copy/pasted functions in one place.
Make functions as events, to be called from server.
That the community will add dozen of functions, to make it the most complete as possible.

Submiting functions
Just make a pull request on GitHub or send me the code if you want :wink:


Functions list I didn’t make all the functions, it’s a community project and I don’t know the authors

  1. drawNotification(text)
  2. displayHelpText(text)
  3. getClosestPlayer()
  4. getPlayers()
  5. drawAdvancedText(x,y ,w,h,sc, text, r,g,b,a,font,jus) : [Release] GUI Editor v0.2 [Updated 15 January 2017 (+7 UTC)]
  6. f(n)
  7. localPed()
  8. try(f, catch_f)
  9. firstToUpper(str)
  10. tablelength(T)
  11. round(num, idp)
  12. stringstarts(String,Start)

Use of functions

exports.vk_main:function_name(arguments)

Example

exports.vk_main:drawNotification("Hello word") -- Will display "Hello world", in the bottom-left corner

Download from GitHub

Made for this awesome Community

4 Likes

thanks for regrouping this stuff :slight_smile:
but TableLenght({1,2}) = #{1,2} in Lua, isn’t it ?

Not if you are using Keys :wink:

I’m finding myself having to restart this resource rather frequently to get it to work =/

Do you know how I can solve problems?
No such export localped in resource vk_main

just rename the resources to lowercase vk_main and vk_interiors :slight_smile: