Jump to content

PashaBiceps

Members
  • Posts

    115
  • Joined

  • Last visited

  • Days Won

    1

PashaBiceps last won the day on March 14 2019

PashaBiceps had the most liked content!

1 Follower

About PashaBiceps

  • Birthday December 24

Recent Profile Visitors

1,220 profile views

PashaBiceps's Achievements

Sucka

Sucka (13/54)

19

Reputation

  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!
×
×
  • Create New...