Nickqq

Members
  • Content Count

    21
  • Joined

  • Last visited

Community Reputation

1 Neutral

About Nickqq

  • Rank
    Civilian

Details

  • Gang
    ThugLife
  • Location
    Brazil

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hello! I'm trying to make a system where the player needs to answer a few questions before registering. I'm having trouble doing the part where the player selects a CheckBox an answer and clicks the Confirm button. can anybody help me? 'etapas' means the step of the menu (false is the intro menu and true is the questions menu) Client etapas = {}; acertou = {}; function Prova(button) local quantidade = acertou[localPlayer] if button == "left" then if etapas[localPlayer] == false then FecharProva etapas[localPlayer] = true AbrirProva elseif etapas[localPlayer] == true then if Pergunta == false then FecharProva Pergunta = 1 AbrirProva elseif Pergunta == 1 then if source == opcaoC then if guiCheckBoxGetSelected(source) then acertou[localPlayer] = quantidade+1 end end FecharProva Pergunta = 2 AbrirProva elseif Pergunta == 2 then if source == opcaoC then if guiCheckBoxGetSelected(source) then acertou[localPlayer] = quantidade+1 end end FecharProva Pergunta = 3 AbrirProva end elseif Pergunta == 3 then if source == opcaoC then if guiCheckBoxGetSelected(source) then acertou[localPlayer] = quantidade+1 end end FecharProva if quantidade >= 2 then outputChatBox ( "[TLRP] #34eb3dVocê passou na prova com "..quantidade.." acertos. Parabéns!!", 255, 255, 255, true ) acertou[localPlayer] = 0 etapas[localPlayer] = false; triggerServerEvent(localPlayer, "NSCR:TerminouProva", localPlayer) else outputChatBox ( "[TLRP] #ff0000Você falhou na prova com "..quantidade.." acertos e foi kickado. (Maximo de erros: 3)", 255, 255, 255, true ) kickPlayer(localPlayer) end end end end end Error: '=' expected near 'etapas' --Error line: etapas[localPlayer] = true Thanks!!!!
  2. Nickqq

    Toplist problem

    I'm current number 1 in the waiting list, but i changed my server IP adress. Is there any way of change the IP adress on the waiting list instead of going back to the last position? Thanks!!
  3. I disabled every vehicle mod and still crashing =/
  4. I will try to remove some mods to see if it stops crashing, thanks for your reply
  5. After 5 minutes playing on my server, the players are crashing.. No clue about what is doing it, can someone help me? On clientscript says: [2019-10-15 17:58:11] ERROR: not enough memory [2019-10-15 17:58:16] ERROR: not enough memory [DUP x562] [2019-10-15 17:58:17] ERROR: not enough memory [2019-10-15 17:58:23] ERROR: not enough memory [DUP x546] [2019-10-15 17:58:23] ERROR: not enough memory MTA Diag: https://pastebin.mtasa.com/889301804 Thanks!!
  6. Hello!! I want to change the shooting style to some that dont need to shoot steady like the original GTA. How can i do it? Any idea? Actual shooting style:
  7. I'm making a create faction command, but it return's WARNING into console. (example of the command that should work but returns error/criarfaccao 2 1 Test) "dbPoll failed; You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups SET Name='Test', balance='0', type1='2', type2='1'' at line 1" I tryed everything to fix it but without success. Any idea of what is wrong? (#Line 1) local connection = exports.sas_mysql:getConnection() Server-side function createGroup(playerSource, commandName, typ1, typ2, ...) if getElementData(playerSource,"adminlevel") >= 8 then if typ1 and typ2 and ... then typ1 = tonumber(typ1) typ2 = tonumber(typ2) groupName = table.concat({...}, " ") local theTeam = createTeam(tostring(groupName)) if theTeam then local query, _, id = dbPoll ( dbQuery( connection, "INSERT INTO groups SET Name=?, balance='0', type1='?', type2='?'", groupName, typ1, typ2), -1 ) if query then outputChatBox("#7cc576[TLRP V2 - Grupo]: #4aabd0"..groupName.." #fffffffacção criada com sucesso! #7cc576(ID: ".. id .. " - Tipo 1: ".. typ1 .." - Tipo 2: ".. typ2 ..")", playerSource, 124, 197, 118, true) else outputChatBox("#7cc576[TLRP V2 - erro]: Falha na criação SQL.", playerSource, 255, 0, 0,true) end else outputChatBox("#7cc576[TLRP V2 - erro]: Este grupo já existe. #4aabd0(" .. tostring(groupName) .. ")", playerSource, 255, 0, 0,true) end else outputChatBox("#7cc576[TLRP V2 - Uso]: #ffffff/" .. commandName .. " [Tipo 1] [Tipo 2] [Nome]", playerSource, 124, 197, 118, true) outputChatBox("#7cc576[Tipo 1]: #ffffffGang/Mafia = 2, Outro tipo = 1", playerSource, 124, 197, 118, true) outputChatBox("#7cc576[Tipo 2]: #ffffffPolicial = 1, Bombeiro = 2, SAMU = 3, Conselho = 4, Mafia = 5, Gang = 6, Organização = 7", playerSource, 124, 197, 118, true) end end end addCommandHandler("criarfaccao", createGroup)
  8. Thanks! I will take a look 😃
  9. Is there any way of a player walk while he is with hands up?
  10. I'm using a script that changes the original sound of GTA vehicles. However, I can't destroy the sound when the vehicle is destroyed. Can anybody help me? Client-side local sound = {} addEventHandler("onClientWorldSound", root, function() if getElementType(source) == "vehicle" then cancelEvent() end end) addEventHandler("onClientElementDestroy", getRootElement(), function () if getElementType(source) == "vehicle" and getPedOccupiedVehicle(getLocalPlayer()) == source then if isElement(sound[veh]) then destroyElement(sound[veh]) end end end) function updateEngineSound() local allVehicles = getElementsByType("vehicle") for index, veh in ipairs (allVehicles) do local model = getElementModel(veh) if model == 411 then if getVehicleEngineState(veh) then if isElement(sound[veh]) then local gear = getVehicleCurrentGear ( veh ) or 1 local velocityX, velocityY, velocityZ = getElementVelocity(veh) local actualspeed = ((velocityX^2 + velocityY^2 + velocityZ^2)^(0.5)) * ((11 - gear) /10) local mph = actualspeed * 70 * 111.847 local minSoundSpeed = 0.15 local soundSpeed = mph/(1000+1000/minSoundSpeed) + minSoundSpeed setSoundSpeed (sound[veh], soundSpeed) else local x, y, z = getElementPosition(veh) sound[veh] = playSound3D("sounds/engine.wav", x, y, z, true) setSoundVolume(sound[veh], 0.2) attachElements(sound[veh], veh) end else if isElement(sound[veh]) then destroyElement(sound[veh]) end end end end end addEventHandler("onClientPreRender", root, updateEngineSound)
  11. That was as close as I could get to making it work =/ do you have any recommendation? Maybe local vehicleTrunkItems = {} function saveItemInVehicleTrunk (vehicle, item) local trunk = vehicleTrunkItems[vehicle] if not trunk then trunk = {} vehicleTrunkItems[vehicle] = trunk end for i=0,12 do local weapon = getPedWeapon(source, i) local ammo = getPedTotalAmmo(source, i) trunk[#trunk + 1] = weapon trunk[#trunk + 1] = ammo --setAccountData(account,"w"..tonumber(i), weapon) --setAccountData(account,"a"..tonumber(i), ammo) end trunk[#trunk + 1] = item takeAllWeapons(source) end ??
  12. Thanks for the asnwer!! I made it 😃 thanks.. but now i need to find a way to a cop see the weapons stored at the players car. Can you help me? There is my script function getNearestVehicle( player ) local x, y, z = getElementPosition( player ) local prevDistance local nearestVehicle for i, v in ipairs( getElementsByType( "vehicle" ) ) do local distance = getDistanceBetweenPoints3D( x, y, z, getElementPosition( v ) ) if distance <= ( prevDistance or distance + 1 ) then prevDistance = distance nearestVehicle = v end end return nearestVehicle or false end local playerWeapons = { } function doSomethingWithTheNearestVeh( player ) local vehicle = getNearestVehicle( player ) local x1, y1, z1 = getElementPosition ( vehicle ) local x2, y2, z2 = getElementPosition ( player ) if vehicle then if not getPedOccupiedVehicle( player ) then local accName = getAccountName ( getPlayerAccount ( player ) ) if getDistanceBetweenPoints3D ( x1, y1, z1, x2, y2, z2 ) < 5 then local Guardou = getElementData(player, "GuardouArmas") if Guardou == false then for slot = 0, 12 do local weapon = getPedWeapon ( player, slot ) local ammo = getPedTotalAmmo ( player, slot ) if weapon > 0 then if ammo > 0 then if ( not playerWeapons [ player ] ) then playerWeapons [ player ] = { } end outputDxBox(player, 'Você está guardando a(s) arma(s) no porta-malas.', "info") setTimer( outputDxBox, 5000, 1, player, 'Você guardou a(s) arma(s) no porta-malas.', "success") playerWeapons [ player ] [ weapon ] = ammo weapon_nome = getWeaponNameFromID ( weapon ) setTimer(outputChatBox, 5000, 1, "#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffff"..weapon_nome.." com "..ammo.." Bala(s) guardado!", player, 255, 255, 255, true ) --takeAllWeapons(player) setTimer(takeAllWeapons, 5000, 1, player) setPedAnimation( player, "FLAME", "FLAME_fire" ) setTimer( setPedAnimation, 5000, 1, player ) setElementData(player, "GuardouArmas", true) end end end else outputDxBox(player, 'Você já guardou suas armas. /pegararmas para pega-las.', "warning") end else outputDxBox(player, 'Não existem veículos próximos.', "error") end else outputDxBox(player, 'Não existem veículos próximos.', "error") end end end addCommandHandler( "guardararmas", doSomethingWithTheNearestVeh ) addEventHandler("onResourceStart", resourceRoot, function() setElementData(root, "GuardouArmas", false) end) addEventHandler( "onResourceStop", root, function( resource ) setElementData(root, "GuardouArmas", false) end ) function PegarArmas(player) local vehicle = getNearestVehicle( player ) local x1, y1, z1 = getElementPosition ( vehicle ) local x2, y2, z2 = getElementPosition ( player ) if vehicle then if not getPedOccupiedVehicle( player ) then local accName = getAccountName ( getPlayerAccount ( player ) ) if getDistanceBetweenPoints3D ( x1, y1, z1, x2, y2, z2 ) < 5 then local Guardou = getElementData(player, "GuardouArmas") if Guardou == true then if ( playerWeapons [ player ] ) then outputDxBox(player, 'Você está retirando a(s) arma(s) do porta-malas!', "info") setTimer( outputDxBox, 5000, 1, player, 'Você pegou suas armas no porta-malas.', "success") for weapon, ammo in pairs ( playerWeapons [ player ] ) do giveWeapon ( player, tonumber ( weapon ), tonumber ( ammo ) ) setPedAnimation( player, "FLAME", "FLAME_fire" ) setTimer( setPedAnimation, 5000, 1, player ) setTimer(outputChatBox, 5000, 1, "#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffff"..weapon_nome.." com "..ammo.." Bala(s) retirado!", player, 255, 255, 255, true ) setElementData(player, "GuardouArmas", false) end end else outputDxBox(player, 'Você não possui armas guardadas.', "warning") end else outputDxBox(player, 'Não existem veículos próximos.', "error") end else outputDxBox(player, 'Não existem veículos próximos.', "error") end end playerWeapons [ player ] = nil end addCommandHandler( "pegararmas", PegarArmas ) function saveWeapons(player, account) if player and account then for i=0,12 do local weapon = getPedWeapon(player, i) local ammo = getPedTotalAmmo(player, i) setAccountData(account,"w"..tonumber(i), weapon) setAccountData(account,"a"..tonumber(i), ammo) end takeAllWeapons(player) end end addEventHandler("onPlayerQuit",root,function () saveWeapons(source, getPlayerAccount(source)) end) addEventHandler("onPlayerLogout",root,function(prev) saveWeapons(source, prev) end) addEventHandler("onPlayerLogin",root, function () local account = getPlayerAccount(source) if not account or isGuestAccount(account) then return end for i=0,12 do local weapon = getAccountData(account,"w"..tonumber(i)) local ammo = getAccountData(account,"a"..tonumber(i)) if weapon and ammo then setTimer(giveWeapon, 1000, 1, source, tonumber(weapon), tonumber(ammo), true) end end end) function outputDxBox(thePlayer, text, type) exports.Scripts_Dxmessages:outputDx(thePlayer, text, type) end
  13. I am developing a system of storing the player's weapons in the trunk of his vehicle. I would like some help on how I should make the stored weapon variables. Here is the server: function getNearestVehicle( player ) local x, y, z = getElementPosition( player ) local prevDistance local nearestVehicle for i, v in ipairs( getElementsByType( "vehicle" ) ) do local distance = getDistanceBetweenPoints3D( x, y, z, getElementPosition( v ) ) if distance <= ( prevDistance or distance + 1 ) then prevDistance = distance nearestVehicle = v end end return nearestVehicle or false end function doSomethingWithTheNearestVeh( player ) local vehicle = getNearestVehicle( player ) local x1, y1, z1 = getElementPosition ( vehicle ) local x2, y2, z2 = getElementPosition ( player ) if vehicle then if not getPedOccupiedVehicle( player ) then --local accName = getAccountName ( getPlayerAccount ( player ) ) if getDistanceBetweenPoints3D ( x1, y1, z1, x2, y2, z2 ) < 5 then for slot = 0, 12 do local Armas = getPedWeapon ( player, slot ) local Municao = getPedTotalAmmo ( player, slot ) if Armas > 0 then if Municao > 0 then weapon_nome = getWeaponNameFromID ( Armas ) outputChatBox ("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffff"..weapon_nome.." com "..Municao.." Bala(s) !", player, 255, 255, 255, true ) else outputChatBox ( "Você não possui armas para serem guardadas.", player, 125, 0, 0 ) end end end else outputChatBox ( "Não existem veículos próximos.", player, 125, 0, 0 ) end else outputChatBox ( "Não existem veículos próximos.", player, 125, 0, 0 ) end end end addCommandHandler( "portamalas", doSomethingWithTheNearestVeh )
  14. It worked! How did I not realize that ?! hahaha Thank you so much!
  15. Hello! I made a speedometer to show some vehicle parameters. however, it is lagging players when enabled. I can not find a solution. can anybody help me? This is my Client-side local rx, ry = guiGetScreenSize ( ) function vehiclestatus ( ) if ( isPedInVehicle ( localPlayer ) == false ) then return false end local x, y, z = getElementPosition( localPlayer ) local car = getPedOccupiedVehicle ( localPlayer ) local sx, sy, sz = getElementVelocity ( car ) local kphSpeed = math.ceil( ( ( sx^2 + sy^2 + sz^2 ) ^ ( 0.5 ) ) * 161 ) local mphSpeed = math.ceil( ( ( ( sx^2 + sy^2 + sz^2 ) ^ ( 0.5 ) ) * 161 ) / 1.61 ) local health = getElementHealth ( car ) --local name = getVehicleName ( car ) local currenthealth = math.floor( health/10 ) getElementHealth ( vehicle ) dxDrawRectangle( ( rx-205 ), ( ry-78 ), 199, 65, tocolor(0, 0, 0, 180), true) dxDrawText ( "#1e90ffVelocidade: #FFFFFF"..tostring(kphSpeed).." Kmh / "..tostring(mphSpeed).." Mph", ( rx - 199 ), ( ry - 77 ), 1280, 887, tocolor ( 255, 255, 255, 255 ), 1,"default-bold", "left", "top", false, false, true, true, false ) dxDrawText ( "#1e90ffDurabilidade: #FFFFFF"..tostring(currenthealth).."/100", ( rx - 199 ), ( ry - 53 ), 1280, 887, tocolor ( 255, 255, 255, 255 ), 1,"default-bold", "left", "top", false, false, true, true, false ) dxDrawText ( "#1e90ffLocalidade: #FFFFFF" .. getZoneName(x, y, z), (rx - 199 ), ( ry - 29), 1280, 887, tocolor ( 255, 255, 255, 255 ), 1, "default-bold", "left", "top", false, false, true, true, false ) end addEventHandler ( "onClientRender", root, vehiclestatus )