#DeltaSCR Posted August 19, 2019 Posted August 19, 2019 Então, eu não manjo tanto de tabela, aí eu tô precisando fazer o seguinte: Quando o player passar em um Marker com veículo, vai checar se ele está na tabela (o veículo), aí tipo, se o veículo for de ID 123, vai dar tanto de dinheiro para o player, mas se for ID 234 vai dar outra quantia, porém não posso fazer em condições alternativas, pois vão ser muitos veículos. Gostaria de que me exemplificassem de não for pedir muito, rs.
[M]ister Posted August 19, 2019 Posted August 19, 2019 local values = { [234] = 100, [211] = 200 } local theMarker = createMarker(0, 0, 0, "cylinder", 1.5, 255, 255, 0, 170) addEventHandler("onPlayerMarkerHit",root, function(markerHit, matchingDimension) if (markerHit == theMarker and matchingDimension) then local veh = getPedOccupiedVehicle(source) if (veh and values[getElementModel(veh)) then givePlayerMoney(source,values[getElementModel(veh)]) end end end ) Leia: https://www.Lua.org/pil/2.5.html 1 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now