Giter Club home page Giter Club logo

model-menu's People

Contributors

frazzie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

model-menu's Issues

couchDB port

can you make a port for couchDB because essentials uses it now

please :)

Loadout Problem

Can you make it saving the Weapon Loadout ?

because when the players changing ped they loosing their guns

model-menu

Are you still going to modify on this script or?

Source scoping - Send informations to the wrong person

I have notice a potential bug in your code that can appears, you often do that :

AddEventHandler("mm:spawn", function()
	TriggerEvent("es:getPlayerFromId", source, function(target)
		MySQL.Async.fetchAll("SELECT * FROM modelmenu WHERE identifier = @identifier", { ['@identifier'] = target.identifier}, function (result)
			if(not result[1]) then
				MySQL.Async.execute("INSERT INTO modelmenu (`identifier`) VALUES (@identifier)", { ['@identifier'] = target.identifier})
				TriggerClientEvent("mm:firstspawn", source)
			else

This can be problem if the async resolution is slower than having a second call on the same event (mm:spawn). As in the case when your async will be resolved the source variable will not have the same value as before (it will be the last that throws an event)

IMO this code should be done as following

AddEventHandler("mm:spawn", function()
	local sourcePlayer = source
	TriggerEvent("es:getPlayerFromId", sourcePlayer, function(target)
		MySQL.Async.fetchAll("SELECT * FROM modelmenu WHERE identifier = @identifier", { ['@identifier'] = target.identifier}, function (result)
			if(not result[1]) then
				MySQL.Async.execute("INSERT INTO modelmenu (`identifier`) VALUES (@identifier)", { ['@identifier'] = target.identifier})
				TriggerClientEvent("mm:firstspawn", sourcePlayer)
			else

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.