• Announcements

    • jhxp

      Forums are online again after a maintenance.   18/03/17

      MTA Forums maintenance is completed, although some automatic time-heavy tasks are still in process and will be finished eventually in background. Expect some features such as Forum Search to not display all results until all processes are finished. Please let us know if you spot a forum feature that worked correctly before the maintenance but does not work anymore now. Thanks. --MTA Team
    • jhxp

      Multi Theft Auto: San Andreas 1.5.4 is out!   21/04/17

      Click the link in the announcement for more details.  

Ayush Rathore

Members
  • Content count

    100
  • Joined

  • Last visited

  • Days Won

    1

Ayush Rathore last won the day on March 11

Ayush Rathore had the most liked content!

Community Reputation

30 Good

1 Follower

About Ayush Rathore

  • Rank
    Punk-@ss B*tch
  • Birthday April 27

Details

  • Gang
    NONE
  • Location
    India
  • Occupation
    Killing People
  • Interests
    Scripting(server,client,gui,sql),Mapping
  1. projectile

    function attackIntruderA51 () local t={} t[#t+1] = createProjectile (localPlayer, 20, 15.49994, 1719.1, 25.5, 5, localPlayer, 0, 0, 0, 0, 0, 1) t[#t+1] = createProjectile (localPlayer, 20, 237.7, 1696.8, 25.5, 5, localPlayer, 0, 0, 0, 0, 0, 1) for _,projectile in pairs (t) do for i,v in pairs(getAttachedElements(projectile)) do if (getElementType(v)=='blip') then setBlipColor(v,255,0,0,255); end end end end addCommandHandler ("attack", attackIntruderA51) Use this it might fulfill your need
  2. @JanKy mix your "onClientResourceStart" functions into one function and also put night_init() in the first line of function like this function loadShaders () InselMapStart() night_init() for path,texstures in pairs (shaderMap) do local shader = dxCreateShader('shader.fx') table.insert(shaderList, shader) local terrain = dxCreateTexture(path) dxSetShaderValue(shader, 'gTexture', terrain) for i,txd in ipairs (texstures) do engineRemoveShaderFromWorldTexture(nightShader, txd) engineApplyShaderToWorldTexture(shader,txd) end end end addEventHandler( "onClientResourceStart", resourceRoot, loadShaders )
  3. Count me in @IIYAMA
  4. if you need any scripting help you should go to this link https://wiki.multitheftauto.com/ for a proper understanding on how we pass Parameter in Mta functions
  5. provide the Gui Creation code like guiCreate window and and guiCreateGridlist etc .
  6. Great Work keep it up!
  7. ok
  8. function playerDropAItem(itemName) local player = client if client then local x,y,z = getElementPosition(player) local item,itemString = getItemTablePosition(itemName) local itemPickup = createItemPickup(item,x+math.random(-1.25,1.25),y+math.random(-1.25,1.25),z,itemString) end end addEvent( "playerDropAItem", true ) addEventHandler( "playerDropAItem", getRootElement(),playerDropAItem) This might help you
  9. Your welcome Happy Scripting
  10. MY : WeaponSaver.lua addEventHandler("onPlayerWasted", root, function() local weapons = getWeaponsOfPlayers(source) setElementData(source,"isDead",true) setElementData(source,"tWeapons",weapons) end ) addEventHandler("onPlayerSpawn", root, function () local weapons = getElementData(source,"tWeapons") setElementData(source,"isDead",false) if (weapons) then giveWeaponsOfPlayer(source, weapons) end end ) function getWeaponsOfPlayer(player) local weaponSlots = 12 local weaponsTable = {} for slot=1, weaponSlots do local weapon = getPedWeapon( source, slot ) local ammo = getPedTotalAmmo( source, slot ) if (weapon > 0 and ammo > 0) then weaponsTable[weapon] = ammo end end return toJSON(weaponsTable) end function giveWeaponsOfPlayer(player, weapons) if (weapons and weapons ~= "") then for weapon, ammo in pairs(fromJSON(weapons)) do if (weapon and ammo) then giveWeapon(player, tonumber(weapon), tonumber(ammo)) end end end end addEventHandler( "onPlayerLogin",root, function( ) local acc = getPlayerAccount( source ) if acc then local weap = getAccountData( acc,'Player:weapons' ) if weap then giveWeaponsOfPlayer(source, weap) end end end ) addEventHandler( "onPlayerQuit",root, function( ) local acc = getPlayerAccount( source ) if acc and not isGuestAccount( acc ) then if getElementData(source,"isDead") == true then local weap = getElementData(source,"tWeapons") setAccountData( acc,"Player:weapons",weap ) else local weap = getWeaponsOfPlayer(source) setAccountData( acc,"Player:weapons",weap ) end end end ) P.S : Your spawn.lua outputServerLog ( "***Spawn Script Loaded ***" ) local PlayersTeam = createTeam ( "Players" ) setTeamFriendlyFire ( PlayersTeam, false ) local spawnX, spawnY, spawnZ = math.random(-694,-679), math.random(951,963), 17 function joinHandler() spawnPlayer(source, spawnX, spawnY, spawnZ) fadeCamera(source, true) setCameraTarget(source, source) setPlayerTeam(source, PlayersTeam ) outputChatBox("#FF00DC"..getPlayerName(source).." #ff0000Welcome To K#ff4000e#ff7f00w#ffbf00i#ffff00z#00ff00z#00ff80l#00ffffe#0080ff'#0000ffs Zombie Server, :O :O. Press \"F9\" For HELP", source, r, g, b, true) end addEventHandler ( "onPlayerLogin", getRootElement(), joinHandler ) function deathHandler() setTimer( function(source) spawnPlayer(source, spawnX, spawnY, spawnZ) fadeCamera(source, true) setCameraTarget(source, source) end,2000,1,source) end addEventHandler("onPlayerWasted", getRootElement(), deathHandler) enjoy and please like if it fits your need:)
  11. i have edited it read above just change lx*(below 1700)
  12. so my Tutorial works now see x/2-248/2 (i have done it so that it stays always in the middle of screen) x = 1920 and width = 248 so 1920/2 = is half of screen and from that - 248/2 is half width of window making it in the middle to your problem change line one to this x,y = guiGetScreenSize() fx,fy = 1920,1080 lx,ly = x/fx,y/fy posX,posY = lx*1300,ly*200 width,height = 248,284 DogCreate.Window = guiCreateWindow(posX,posY,width,height, "", false)
  13. This will fulfill your need x,y = guiGetScreenSize() DogCreate = {} addEventHandler("onClientResourceStart", resourceRoot, function() -- window DogCreate.Window = guiCreateWindow(x/2-248/2, y/2-284/2, 248, 284, "", false) --button DogCreate.BuyButton = guiCreateButton(0.14, 0.79, 0.71, 0.18, "Purchase Dog", true, DogCreate.Window) --main label DogCreate.WindowLab = guiCreateLabel(0.03, 0.13, 0.92, 0.10, "Dog Creator", true, DogCreate.Window) --editbox label DogCreate.NameLab = guiCreateLabel(0.05, 0.29, 0.24, 0.10, "Name:", true, DogCreate.Window) DogCreate.BreedLab = guiCreateLabel(0.05, 0.40, 0.24, 0.10, "Breed:", true, DogCreate.Window) DogCreate.ColorLab = guiCreateLabel(0.05, 0.52, 0.24, 0.10, "Color:", true, DogCreate.Window) --radiobutton DogCreate.MaleRadio = guiCreateRadioButton(0.34, 0.68, 0.15, 0.06, "M", true, DogCreate.Window) DogCreate.FemaleRadio = guiCreateRadioButton(0.53, 0.68, 0.15, 0.06, "F", true, DogCreate.Window) --editbox DogCreate.NameBox = guiCreateEdit(0.38, 0.29, 0.53, 0.08, "", true, DogCreate.Window) DogCreate.BreedBox = guiCreateEdit(0.38, 0.39, 0.53, 0.08, "", true, DogCreate.Window) --combobox DogCreate.DogColorCombo = guiCreateComboBox(0.38, 0.50, 0.53, 0.08, "", true, DogCreate.Window) guiRadioButtonSetSelected(DogCreate.MaleRadio, true) guiLabelSetHorizontalAlign(DogCreate.ColorLab, "center", false) guiLabelSetVerticalAlign(DogCreate.ColorLab, "center") guiLabelSetHorizontalAlign(DogCreate.BreedLab, "center", false) guiLabelSetVerticalAlign(DogCreate.BreedLab, "center") guiLabelSetHorizontalAlign(DogCreate.NameLab, "center", false) guiLabelSetVerticalAlign(DogCreate.NameLab, "center") guiLabelSetHorizontalAlign(DogCreate.WindowLab, "center", false) guiLabelSetVerticalAlign(DogCreate.WindowLab, "center") guiWindowSetSizable(DogCreate.Window, false) guiWindowSetSizable(DogCreate.Window, false) guiSetAlpha(DogCreate.Window, 0.88) guiSetProperty(DogCreate.Window, "CaptionColour", "FF000000") end ) and also now to make you understand what it is x,y = guiGetScreenSize() -- for example yours 1920X1080 --to fit in all resolution fx,fy = 1920,1080 --below step will divide x into fx pieces and y into fy pieces lx,ly = x/fx,y/fy --lx ,ly now contains a value posX,posY = lx*400,ly*300 width,height = 400,300 --now lx*(as you divided your screen in 1920 parts horizontally so you can go till 1920) -- increasing will go ahead of screen --now ly*(as you divided your screen in 1080 parts verticall so you can go till 1080) -- increasing will go beyond screen --effect of width and height -- if you have created font size greater than the width it will clip the text horizontally that is what in your gui is happening -- if you have created font size greater than the height same as above addEventHandler("onClientResourceStart", resourceRoot, function() local font = guiCreateFont( "segoeui.ttf",72 ) -- for example and (second arguement is size of font) local lbl = guiCreateLabel (posX,posY,width,height,"lol my example text", true ) -- change posX,posY to test and also it might clip guiSetFont( lbl, font ) end) -- now relative time -- Imagine your screen is divided into 10 parts horizontally -- so 1920/10 = 192 -- so 0.1 = 1920 * 0.1 = 192.00 -- Imagine your screen is divided into 10 parts vertically -- so 1080/10 = 108 -- so 0.1 = 1080 * 0.1 = 108.00 -- so for width and height same as case above for relative posX,posY = 0.4,0.3 width,height = x*0.4,y*0.3 addEventHandler("onClientResourceStart", resourceRoot, function() local font = guiCreateFont( "segoeui.ttf",72 ) -- for example and (second arguement is size of font) local lbl = guiCreateLabel (posX,posY,width,height,"lol my example text", true ) -- change posX,posY to test and also it might clip guiSetFont( lbl, font ) end) well i am not good in making people understand but .. Test and give reply read my above message
  14. you should make your window size bigger like i have done in code above or give me the fonts i will set it and give it to you