Jump to content

PashaBiceps

Members
  • Posts

    115
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by PashaBiceps

  1. @andr0xy I tried but i dont know how to use it ?
  2. @andr0xy if tonumber(vehFuel[1]["Fuel"]) > 0 then ( Attempt to compare number with table ) ?
  3. @andr0xy Ty for the reply, but replacing this i got an error ( attemp to compare number with string )
  4. Im having an error ( attempt to compare number with nil ), i need some help to fix it! Thanks for all help local vehFuel = dbPoll(dbQuery(database, "SELECT * FROM playersConce WHERE Account = ?", getAccountName(getPlayerAccount(source))), -1) if vehFuel["Fuel"] > 0 then <<---- Line with the error setElementData(vehicleConces[source], "DNL:Combustivel", vehFuel) else setElementData(vehicleConces[source], "DNL:Combustivel", 100) end
  5. @Erlkonig Thank you a lot
  6. Hello, im having a problem to saving fuel from cars. It's giving me an error on debug in this next line ( Bad Argument 'SetElementData' [expect element at argument 1] ) Thanks for all help! setElementData(vehicleConces[source], "DNL:Combustivel", vehFuel) Code: addEvent("Tic.addVeh", true) addEventHandler("Tic.addVeh", root, function(source, model) local query = dbPoll(dbQuery(database, "SELECT * FROM playersConce WHERE Account = ?", getAccountName(getPlayerAccount(source))), -1) if query and #query > 0 then if vehicleConces[source] then if isPedInVehicle(source) then local r1, g1, b1, r2, g2, b2, r3, g3, b3 = getVehicleColor(vehicleConces[source], true) local conceSQL = { vehLife = getElementHealth(vehicleConces[source]), vehColor = { r1, g1, b1, r2, g2, b2, r3, g3, b3, }, vehTunning = {}, vehUpgrade = {}, } removeElementData(vehicleConces[source], "Tic.vehicleBank") destroyElement(vehicleConces[source]) local vehFuel = dbPoll(dbQuery(database, "SELECT * FROM playersConce WHERE Account = ?", getAccountName(getPlayerAccount(source))), -1) setElementData(vehicleConces[source], "DNL:Combustivel", vehFuel) dxMsg(source, "Your vehicle was saved in the garage!", "success") dbExec(database, "UPDATE playersConce SET Estado = ?, Dados = ? WHERE Account = ? AND Model = ?", "Garage", toJSON(conceSQL), getAccountName(getPlayerAccount(source)), model) dbExec(database, "UPDATE playersConce SET Fuel = ? WHERE Account = ?", getElementData(source, "DNL:Combustivel"), getAccountName(getPlayerAccount(source))) else dxMsg(source, "Get inside the vehicle and try again.", "info") end else dxMsg(source, "Your not have a vehicle!", "info") end end end )
  7. Olá boa tarde! Gostaria de solicitar ajuda para o seguinte erro. ( Attempt to perform Arithmetic on field '?' a nil value). Ás vezes funciona, outras vezes dá esse erro! O que poderá ser? Agradeço a ajuda desde já. function Entregar_Caixas (source) local Emprego = getElementData ( source, "Emprego" ) local Occupied_Veh = getPedOccupiedVehicle(source) local Cargas = tonumber(getElementData(source, "DNL:Cargas")) or 0 local Random_Pos = math.random ( #Marker_Aleatorios ) if isPedInVehicle ( source ) then if (getElementModel (Occupied_Veh) == 413) then if Cargas >= 1 then if Emprego == "Carteiro" then if getElementData ( source, "Entrega_Acionada" ) == false then if isElement( Object_Caixa[source] ) then destroyElement( Object_Caixa[source] ) end if isElement( Marker_Entregar[source] ) then destroyElement( Marker_Entregar[source] ) end if isElement( Blip_Entregar[source] ) then destroyElement( Blip_Entregar[source] ) end setElementData(source, "Entrega_Acionada", true) Linha do ERRO ---> Marker_Entregar[source] = createMarker ( Marker_Aleatorios[Random_Pos][1], Marker_Aleatorios[Random_Pos][2], Marker_Aleatorios[Random_Pos][3] -1, "cylinder", 2, 255 ,255 ,255, 50) Blip_Entregar[source] = createBlipAttachedTo( Marker_Entregar[source], 0 ) setElementVisibleTo ( Marker_Entregar[source], root, false ) setElementVisibleTo ( Marker_Entregar[source], source, true ) setElementVisibleTo ( Blip_Entregar[source], root, false ) setElementVisibleTo ( Blip_Entregar[source], source, true ) addEventHandler("onMarkerHit", Marker_Entregar[source], Entregar_Caixa_Casa) exports.YM_DxMessages:addBox(source, "Entregue todas as caixas que pegou no correio!", "info") else exports.YM_DxMessages:addBox(source, "Você já está em uma rota, entregue todas primeiro!", "warning") end else exports.YM_DxMessages:addBox(source, "Apenas funcionários dos CTT, podem trabalhar aqui!", "warning") end else exports.YM_DxMessages:addBox(source, "Você não tem caixas para entregar!", "error") end end end end addCommandHandler("smt_command", Entregar_Caixas)
  8. Eu gostaria de colocar avatar na tela de login que ao escrevesse o nome, aparecesse o avatar desse usuário. Eu tenho isto, e está funcionando porém apenas quando o jogador faz login. Como posso colocar para aparecer o avatar ao escrever o nome no login? Obrigado pela ajuda desde já. local playername = getPlayerName(getLocalPlayer()) local avatar = getElementData(getLocalPlayer(), "avatar") or 1 if playername then if avatar >= 1 then dxDrawImage(x*639,y*306.5,x*94,y*94, "avatars/"..avatar..".png") end end
  9. I would like to check a part of my function, he works good but he is not checking and updating. local playername = getPlayerName(getLocalPlayer()) local avatar = getElementData(getLocalPlayer(), "avatar") if playername then if avatar >= 1 then dxDrawImage(x*639,y*306.5,x*94,y*94, "avatars/"..avatar..".png") else dxDrawImage(x*639,y*306.5,x*94,y*94,"gfx/avatar0.png") end end What i want is check this part of the function and when he don't detect the player name on log in, his avatar change immediately. I tried to use a timer but when i put it, this part of the script stopped work. Can you guys help?
  10. The point is.. I have an inventory that u press the item and the player wear a skin, if you press it again the item will give the old skin back to the player with a 10 seconds block to avoid bugs. But if the player leaves the game with the skin from the item that the player used before and the server don't give the old skin back when the player leaves, the old skin will dissapear forever.
  11. I would like to return it to the old skin when the player leaves the game, but it is not working. addEventHandler("onPlayerQuit",getRootElement(),function() local outskin = tonumber(getElementData(source, "skinout")) setElementModel(source, outskin) end) It's working good in-game!
  12. @IIYAMA Perfect! You're the best!
  13. elseif itemData["id"] == 34 then if checkPassiveTimer( "limit-item-id-34", true, 10000 ) then local emveiculo = getPedOccupiedVehicle ( localPlayer ) local outskin = tonumber(getElementData(localPlayer, "skinout")) if not emveiculo then if getElementData(localPlayer, "Male") == true then if getElementData(localPlayer, "WearingSkin") == false then skinatual = getElementModel(localPlayer) setElementData(localPlayer, "skinout", skinatual) setElementData(localPlayer, "WearingSkin", true) triggerServerEvent("itemAnims",localPlayer,localPlayer,34) else triggerServerEvent("itemAnims",localPlayer,localPlayer,400) end else exports.YM_DxMessages:addBox("Male stuff!", "error") end else exports.YM_DxMessages:addBox("U cant do that!", "error") end else exports.YM_DxMessages:addBox("Wait 10 secs!", "warning") end
  14. Is giving me a nil value
  15. What i want is block this elseif itemData["id"] == 34 then for 10 seconds, but is not working
  16. PashaBiceps

    Timer

    Hello guys, the timer is not working very well. I think he is working just one time, when the player go into the server. What i did wrong? elseif itemData["id"] == 34 then local emveiculo = getPedOccupiedVehicle ( localPlayer ) local outskin = tonumber(getElementData(localPlayer, "skinout")) if not emveiculo then if getElementData(localPlayer, "Male") == true then if getElementData(localPlayer, "WearingSkin") == false then setTimer ( function(localPlayer) skinatual = getElementModel(localPlayer) setElementData(localPlayer, "skinout", skinatual) setElementData(localPlayer, "WearingSkin", true) triggerServerEvent("itemAnims",localPlayer,localPlayer,34) end, 10000, 0 ) else setTimer ( function(localPlayer) triggerServerEvent("itemAnims",localPlayer,localPlayer,400) end, 10000, 0 ) end else exports.YM_DxMessages:addBox("Male Stuff!", "error") end else exports.YM_DxMessages:addBox("U cant do that!", "error") end
  17. Resolveu, obrigado!
  18. PashaBiceps

    Old Skin

    Hello guys, I am trying to return the old skin to the player, but is not working, the player dont receive the old skin back ! Can you guys help me? local emveiculo = getPedOccupiedVehicle ( localPlayer ) local outskin tonumber(getElementData(localPlayer, "skinout")) if not emveiculo then if getElementData(localPlayer, "Male") == true then if getElementData(localPlayer, "WearingSkin") == false then skinatual = getElementModel(localPlayer) setElementData(localPlayer, "skinout", skinatual) setElementData(localPlayer, "WearingSkin", true) setTimer ( function() setElementModel (localPlayer, 34 ) end, 3500, 1 ) triggerServerEvent("itemAnims",localPlayer,localPlayer,34) else triggerServerEvent("itemAnims",localPlayer,localPlayer,34) setTimer ( function() setElementModel(localPlayer, outskin) end, 3500, 1 ) end else exports.YM_DxMessages:addBox("Male Stuff!", "error") end else exports.YM_DxMessages:addBox("U can't do that right now!", "error") end
  19. Omg kkkkkk, thanks you. Worked
  20. Hello, can you guys help me?? Invehicle, getElementData and setElementModel is not working. I don't understand why... Gave me an error ( Bad Argument ) local invehicle = getPedOccupiedVehicle ( localplayer ) if not invehicle then if getElementData(localplayer, "Male") == true then setTimer ( function() setElementModel (localplayer, 34 ) end, 4000, 1 ) triggerServerEvent("itemAnims",localPlayer,localPlayer,34) else exports.YM_DxMessages:addBox("You're not a man!", "error") end else exports.YM_DxMessages:addBox("You can't change your clothes here!", "error") end
  21. Hi guys im trying to put a dxDrawTextOnElement in a specific dimension but is not working. If i remove the dimension and interior verification, works fine but appears in all dimensions. Can u guys help me ? Thanks! function wolrdTexts() if getElementInterior(source) == 6 and getElementDimension(source) == 90 then dxDrawTextOnElement(john,"#FFFFFFStore #0099ffJohn #ccffcc(Frentista)\n #FFFFFFClick 'N' and press on me!",1,20,255,255,255,255,1,comy1) end end addEventHandler("onClientRender",root, wolrdTexts) function dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font, ...) local x, y, z = getElementPosition(TheElement) local x2, y2, z2 = getCameraMatrix() local distance = distance or 20 local height = height or 1 local value1 = 2 local value2 = 2 if (isLineOfSightClear(x, y, z+2, x2, y2, z2, ...)) then local sx, sy = getScreenFromWorldPosition(x, y, z+height) if(sx) and (sy) then local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distanceBetweenPoints < distance) then dxDrawText(text, sx+value1, sy+value2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or "arial", "center", "center", false, false, false, true, false) end end end end Solved!
×
×
  • Create New...