SoManyTears

Members
  • Content Count

    16
  • Joined

  • Last visited

Community Reputation

0 Neutral

Recent Profile Visitors

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

  1. then I explain the logic in me.I created a simple wanted level save with SetAccountData.I'm really new to Lua and couldn't do any other save system.ı did it : function onQuit() local acc = getPlayerAccount(source) if not isGuestAccount(acc) then local wantedLevel = getPlayerWantedLevel (source) setAccountData(acc, "wlevel", wantedLevel) end end addEventHandler("onPlayerQuit", getRootElement(), onQuit) function onLogin(_, acc) local acc = getPlayerAccount(source) local wantedLevel = getAccountData(acc, "wlevel") setTimer (setPlayerWantedLevel,500,1,source,wantedLevel) end addEventHandler("onPlayerLogin", getRootElement(), onLogin) and I created a logic.If this player has a star, I wrote a code to teleport him to jail.and I didnt write codes for every star, because I don't know how to make a table right now.Anyway I can edit this in the future.these are all the codes i have and i can't get results.Maybe it is easy for you but I wrote something as much as I know about Lua and it is negative ...
  2. Hello The-GTA ! I used setAccountData to save wanted levels and succeeded.I give myself a star from execute commands.I enter the game, I have a star, but I am not teleported anywhere I really don't know what the problem is.my resource will be ready when i solve this problem: / There is a map where I teleport.you will go into the SKY when you are teleported.
  3. it works when I use this event as onPlayerWasted.but the player does not teleport while login.am i using a wrong event? local warps = { { 2,2577.3100585938, -1329.7434082031, 1058.2553710938 }, { 2,2573.6740722656, -1353.0935058594, 1058.2553710938 }, { 2,2581.5959472656, -1343.3308105469, 1054.0562744141 } } addEventHandler( "onPlayerLogin", getRootElement( ), function() local rnd = math.random( 1, #warps ) local level = getPlayerWantedLevel ( source ) if ( level == 1 ) then setPedWeaponSlot ( source, 0 ) fadeCamera(source,false, 1.0) setTimer(fadeCamera, 1000, 1,source,true) setTimer ( setElementInterior, 1000, 1, source, warps[rnd][1], warps[rnd][2], warps[rnd][3], warps[rnd][4], warps[rnd][5], warps[rnd][6], warps[rnd][7], warps[rnd][8] ) triggerClientEvent(source, "jailTime1", source) setTimer(function(freeman) if isElement(freeman) then fadeCamera(freeman,false, 1.0) setTimer(fadeCamera, 1000, 1,freeman,true) setTimer (setElementPosition, 1000, 1, freeman, 1803.2666015625, -1575.6591796875, 13.408905029297 ) setElementInterior ( freeman, 0 ) setPlayerWantedLevel ( freeman, 0 ) end end,1000*20,1,source) end end )
  4. ı am really blind.I become careless when I spend a lot of time at the pc.thank you man.
  5. Hello The-Gta.Thanks for answer.ı dont know how to reset it. ı cant use resetTimer or killTimer for it.really ı have not any idea.ı am still stuck.
  6. ı wrote something.everything works good.When the player goes to jail for the second time, time comes down and doesn't work.we can remove the jail time text with removeEventHandler when the player gets out of jail, but countdown is still working.and when the player goes to jail for the second time, a bug occurs in countdown.How can I restart the time as the player goes back to prison? I'm really stuck.can you help me please? thanks. local start = getTickCount() local countDown = 20 function render() local now = getTickCount() if now-start > 1000 then countDown = countDown-1 start = getTickCount() if countDown < 1 then removeEventHandler("onClientRender",root,render) end end end function convertTime ( time ) local min = math.floor ( time / 60 ) local sec = ( time %60 ) return string.format("%02d:%02d", min, sec) end addEvent ( "jailTime1", true ) addEventHandler ( "jailTime1", root, function ( ) addEventHandler("onClientRender",root,render) addEventHandler("onClientRender",root,jailText) render() setTimer(function() removeEventHandler("onClientRender",root,jailText) end, 20000, 1) end ) local screenW, screenH = guiGetScreenSize() local refx,refy = 1920,1080 function jailText() dxDrawText("Time out of jail: "..convertTime(countDown).."",screenW*((refx/2+2)/refx),screenH*((refy/2+54)/refy),_,_, tocolor(0,0,0), screenH*(1.7/refy), "bankgothic", "center", "center", false, true, false, true, false) dxDrawText("Time out of jail: "..convertTime(countDown).."",screenW*((refx/2)/refx),screenH*((refy/2+55)/refy),_,_, tocolor(200,200,200), screenH*(1.7/refy), "bankgothic", "center", "center", false, true, false, true, false) dxDrawText("Time out of jail: "..convertTime(countDown).."",screenW*((refx/2+2)/refx),screenH*((refy/2+94+2)/refy),_,_, tocolor(0,0,0), screenH*(0.9/refy), "bankgothic", "center", "center", false, true, false, true, false) dxDrawText("Time out of jail: "..convertTime(countDown).."",screenW*((refx/2)/refx),screenH*((refy/2+95)/refy),_,_, tocolor(200,200,200), screenH*(0.9/refy), "bankgothic", "center", "center", false, true, false, true, false) end
  7. I want to save the player wanted level, but it doesn't work.can someone help me ? thanks. function onQuit() local acc = getPlayerAccount(source) if not isGuestAccount(acc) then local wantedLevel = getPlayerWantedLevel (source) setAccountData(acc, "wlevel", wantedLevel) end end addEventHandler("onPlayerQuit", getRootElement(), onQuit) function onLogin(_, acc) local acc = getPlayerAccount(source) local wantedLevel = getAccountData(acc, "wlevel") setTimer (setPlayerWantedLevel,500,1,acc,wantedLevel) end addEventHandler("onPlayerLogin", getRootElement(), onLogin)
  8. The sound still does not play when I enter the cities.what's wrong ? can someone help? cities = { ["Bone County"] = true, ["Tierra Robada"] = true, } addEventHandler('onClientResourceStart', localPlayer, function () local x,y,z = getElementPosition(localPlayer) local city = getZoneName(x,y,z, true) if cities[city] then playSound("sound.mp3",true) end end )
  9. problem solved.topic may be closed.
  10. Hello, I'm trying to add text on the ped.everything is good.text appears but when I approach the ped, the error comes from debug. ERROR :[Resources]\missionsped\client.Lua:199: attempt to perform arithmetic on local 'sy' (a nil value) How can ı solve this problem ? function pedText() local x, y, z = getElementPosition( dealer ) --ped position local x2, y2, z2 = getElementPosition(localPlayer) --player position local yakinlas = getDistanceBetweenPoints3D(x,y,z, x2, y2, z2) if yakinlas < 4 then local x2, y2, z2 = getElementPosition(localPlayer) lcal sx, sy = getScreenFromWorldPosition(x, y, z+0.9, 0.06) local yakinlas = getDistanceBetweenPoints3D(x,y,z, x2, y2, z2) local yaziboyut = 0.9 dxDrawText ( "Drug Dealer" , sx, sy - 30, sx, sy - 30, tocolor(255,255,255), math.min ( 0.3*(150/yakinlas)*1.4,1.3 - (0.5 + math.sin(math.rad(getTickCount())) / 3) / 12) * yaziboyut, "default-bold", "center", "bottom", false, false, false, true ) end end --end addEventHandler("onClientRender", root, pedText)
  11. Hello, I installed an mta server in ubuntu.How do I get back to the mta terminal after shutdown?I am new yet and if anyone knows, can you tell me?I installed screen, but screen -r doesn't work after the shutdown
  12. How can I turn a texture ON and OFF with just one command?Texture needs to be active when they enter the server.This is what confuses me. addEventHandler('onClientResourceStart', resourceRoot, function() shader = dxCreateShader('shader.fx') terrain = dxCreateTexture('img/road.jpg') dxSetShaderValue(shader, 'gTexture', terrain) engineApplyShaderToWorldTexture(shader, 'cj_rubbish1') engineApplyShaderToWorldTexture(shader, 'sf_junction2') engineApplyShaderToWorldTexture(shader, ':Oroad01_law') engineApplyShaderToWorldTexture(shader, 'des_1line256') engineApplyShaderToWorldTexture(shader, 'concretebig4256128') end )
  13. I tried a few more events but failed.I just want the health bar to appear when I "aim" on ped.Now health bar looks without aim with gun! how can ı really do that ?Please help someone? function pedHealthbar() for k, peds in pairs(getElementsByType("ped", root, true)) do if getElementData(peds, "type") == "Secur.ped" then target = getPedTarget(peds) if ( target ) then local recBar = dxDrawRectangle(sX+420, sY-600,150, 12, tocolor(0, 0, 0, 200)) local health = getElementHealth(peds) local lineLength = 144 * (health / 100) local healthBar = dxDrawRectangle(sX+423, sY-597,lineLength, 7, tocolor(46, 139, 87, 210)) dxDrawText("Security", sX+460, sY-627, sX+155, sY-19-(32*7), tocolor(0,0,0, 255), 1.6, font, "left", "top") dxDrawText("Security", sX+461.5, sY-625.5, sX+153.5, sY-17.5-(32*7), tocolor(255, 255, 255, 255), 1.6, font, "left", "top") end end end addEventHandler("onClientRender", root, pedHealthbar)