HG Snuuk Posted October 16, 2019 Share Posted October 16, 2019 (edited) estou tendo um problema numa loja de carro que estou editando , ele funciona com aquele sistema de dinheiro , e dinheiro vip , sacas porem o dinheiro "normal" ele funciona por elementdata , eu gostaria de apenas colocar pra quando ele comprar descontar o takemoney normal . tentei arrumar mais sempre da erro .-. ClientSide if sellVehicles[currSelected][3] > tonumber(getElementData(localPlayer, "char.money")) then exports["ph_info"]:showBox("Dinheiro insuficiente","error") else local r,g,b,r1,g1,b1 = getVehicleColor(shopVehicle, true) triggerServerEvent("onClientBuyVehicle", localPlayer, localPlayer, sellVehicles[currSelected][1], sellVehicles[currSelected][3], r, g, b, r1, g1, b1) exitShop() ServerSide addEvent("onClientBuyVehicle", true) addEventHandler("onClientBuyVehicle", root, function(playerSource, model, price, r, g, b, r1, g1, b1) if setElementData(playerSource, "char.money", getElementData(playerSource, "char.money") - price) then local regiertek = getElementData(playerSource, "char.money") local ujertek = getElementData(playerSource, "char.money") + price exports["ph_vehicle"]:createShopVehicle(playerSource, model, r, g, b, r1, g1, b1) exports["ph_info"]:showBoxS(playerSource,"Compra efetuada com sucesso","info") outputChatBox("#4169E1[LojaCarros]: #ffffffLembre-se de estacionar seu veiculo para que ele sejá salvo em nosso sistema", playerSource, 255, 255, 255, true) end end) Edited October 16, 2019 by HG Snuuk Link to comment
Other Languages Moderators Lord Henry Posted October 16, 2019 Other Languages Moderators Share Posted October 16, 2019 Qual erro aparece no debug? De cara, já está errado vc usar localPlayer 2x no triggerServerEvent. Use somente 1 vez e depois use source na função server-side. Ou então vc pode simplesmente usar client no server-side que pega automaticamente o jogador que ativou o evento. E arrume a indentação do código. 1 Link to comment
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