-
Posts
134 -
Joined
-
Last visited
Everything posted by LucasBaker
-
Well I'm trying to create a script that when I write / givehealth, make him give life to those who are in my area .. eg first I tried to create with getZoneName, most did not work someone help me? Script: function giveHealth(source) accountname = getAccountName (getPlayerAccount(source)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then for i,player in ipairs(getElementsByType("player")) do setElementHealth(player, 200) end setTimer(outputChatBox,50,1,"#00FFFF[#00FFFFSERVER#00FFFF] #00FFFF"..getPlayerName (source) .. " #00FFFFDeu Vida Para todos os Jogadores",getRootElement(),171,205,239,true) else outputChatBox("#ABCDEF* Você não é um Administrador.",source,171,205,239,true) end end addCommandHandler("darvida",giveHealth) I'm trying to use, it would be right? GetZoneName
-
Você poderia utilizar como base o leatherface é um script criado pelo KingGTA, faz com que o bot apareça só as 20:59 quando da umas 6:00 ele desaparece Client: renderedFrames = 0 fps = 1 addEventHandler("onClientRender", getRootElement(), function() renderedFrames = renderedFrames + 1 end ) setTimer( function() fps = renderedFrames renderedFrames = 0 end , 1000, 0) zones = { "Whetstone", "Shady Creeks", "Back o Beyond", "Flint County", "Mount Chiliad" } function isLocalPlayerInLeatherfaceArea() local x, y, z = getElementPosition(getLocalPlayer()) local inZone = false for i, zone in ipairs(zones) do if getZoneName(x, y, z) == zone then inZone = true end end if inZone == true then return true else return false end end addEvent("onClientPlayerLeatherfaceAreaEnter", true) addEvent("onClientPlayerLeatherfaceAreaLeave", true) addEvent("onClientWeatherChangeRequest", true) addEvent("clientSyncMyTime", true) addEventHandler("onClientWeatherChangeRequest", getLocalPlayer(), function(weatherID) setWeather(weatherID) end ) addEventHandler("onClientPlayerLeatherfaceAreaEnter", getLocalPlayer(), function() setWeather(9) triggerServerEvent("syncMyTime", getLocalPlayer()) end ) addEventHandler("clientSyncMyTime", getLocalPlayer(), function(hour, minute) setTime(hour, minute) end ) wasInLeatherfaceArea = false addEventHandler("onClientRender", getRootElement(), function() if isLocalPlayerInLeatherfaceArea() and wasInLeatherfaceArea == false then triggerEvent("onClientPlayerLeatherfaceAreaEnter", getLocalPlayer()) triggerServerEvent("onPlayerLeatherfaceAreaEnter", getLocalPlayer()) wasInLeatherfaceArea = true elseif isLocalPlayerInLeatherfaceArea() == false and wasInLeatherfaceArea == true then triggerEvent("onClientPlayerLeatherfaceAreaLeave", getLocalPlayer()) triggerServerEvent("onPlayerLeatherfaceAreaLeave", getLocalPlayer()) wasInLeatherfaceArea = false end end ) function isLeatherfaceAtmosphere() local h, m = getTime() if h > 20 then return true elseif h < 6 then return true else return false end end function isRealLeatherfacePresent() for i, peds in ipairs(getElementsByType("ped")) do if getElementData(peds, "type") == "RealLeatherface" then return true end end return false end addEvent("onClientScreamPlay", true) addEventHandler("onClientScreamPlay", getRootElement(), function(sound) if isLocalPlayerInLeatherfaceArea() and isLeatherfaceAtmosphere() and isRealLeatherfacePresent() == false then local soundElement = playSound(sound) setSoundEffectEnabled(soundElement, "reverb", true) setSoundVolume(soundElement, 0.075) end end ) setTimer( function() if isLocalPlayerInLeatherfaceArea() then if getWeather() ~= 9 then setWeather(9) end end for i, peds in ipairs(getElementsByType("ped")) do if getElementData(peds, "type") == "ghost" then if getElementAlpha(peds) == 0 or getElementAlpha(peds) < 10 then destroyElement(peds) else setElementAlpha(peds, getElementAlpha(peds) - 10) end end end for i, leatherface in ipairs(getElementsByType("ped")) do if getElementData(leatherface, "type") == "RealLeatherface" then local alpha = getElementAlpha(leatherface) if alpha < 255 - 10 then setElementAlpha(leatherface, alpha + 10) elseif alpha > 255 - 10 and alpha < 255 then setElementAlpha(leatherface, 255) end end end end , 50, 0) addEvent("onClientRealLeatherfaceSpawn", true) addEventHandler("onClientRealLeatherfaceSpawn", getRootElement(), function(x, y, z) setPedVoice(source, "PED_TYPE_DISABLED") setPedFootBloodEnabled(source, true) end ) function getPointFromDistanceRotation(x, y, dist, angle) local a = math.rad(90 - angle); local dx = math.cos(a) * dist; local dy = math.sin(a) * dist; return x+dx, y+dy; end function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end setTimer( function() if isLocalPlayerInLeatherfaceArea() and isLeatherfaceAtmosphere() and isRealLeatherfacePresent() == false then if math.random(0, 50) == 50 then local x, y, z, lookX, lookY = getCameraMatrix() local lx, ly, lz = getPointFromDistanceRotation(x, y, 25, findRotation(lookX, lookY, x, y) + math.random(-45, 45)) lz = getGroundPosition(lx, ly, 576) + 1 triggerServerEvent("onRealLeatherfaceSpawn", getRootElement(), lx, ly, lz) elseif math.random(0, 100) == 100 then local x, y, z, lookX, lookY = getCameraMatrix() local lx, ly, lz = getPointFromDistanceRotation(x, y, 25, findRotation(lookX, lookY, x, y) + math.random(-45, 45)) lz = getGroundPosition(lx, ly, 576) triggerServerEvent("onGlendaleSpawn", getLocalPlayer(), lx, ly, lz) elseif math.random(0, 1) == 1 then local x, y, z = getElementPosition(getLocalPlayer()) local ax, ay = getPointFromDistanceRotation(x, y, 50, math.random(0, 360)) local az = getGroundPosition(ax, ay, 576) local gPed = createPed(33, ax, ay, az + 1) local rotZ = findRotation(ax, ay, x, y) setPedRotation(gPed, rotZ) setPedHeadless(gPed, true) setElementData(gPed, "type", "ghost") end end end , 1000, 0) Server zones = { "Whetstone", "Shady Creeks", "Back o Beyond", "Flint County", "Mount Chiliad" } RealLeatherface = nil function isRealLeatherfacePresent() if RealLeatherface == nil then return false elseif isElement(RealLeatherface) then return true else return false end end function isElementInLeatherfaceZone(element) local x, y, z = getElementPosition(element) local inZone = false for i, zone in ipairs(zones) do if getZoneName(x, y, z) == zone then inZone = true end end if inZone == true then return true else return false end end function isLeatherfaceAtmosphere() local h, m = getTime() if h > 20 then return true elseif h < 6 then return true else return false end end addEvent("onPlayerLeatherfaceAreaEnter", true) addEvent("onPlayerLeatherfaceAreaLeave", true) addEvent("syncMyTime", true) addEvent("onGlendaleSpawn", true) addEventHandler("onGlendaleSpawn", getRootElement(), function(x, y, z) local glendale = createVehicle(getVehicleModelFromName("Glendale Damaged"), x, y, z + 10) local px, py, pz = getElementPosition(source) local rotZ = findRotation(x, y, px, py) setElementRotation(glendale, 0, 0, rotZ) setVehicleEngineState(glendale, true) setVehicleLocked(glendale, true) setTimer( function() if isElement(glendale) then blowVehicle(glendale) local x, y, z = getElementPosition(glendale) createExplosion(x, y, z, 4) destroyElement(glendale) end end , 20000, 1) end ) addEventHandler("syncMyTime", getRootElement(), function() local h, m = getTime() triggerClientEvent("clientSyncMyTime", source, h, m) end ) addEventHandler("onPlayerLeatherfaceAreaLeave", getRootElement(), function() local weather = getWeather() triggerClientEvent("onClientWeatherChangeRequest", source, weather) end ) addEvent("onScreamPlay", true) setTimer( function() if isLeatherfaceAtmosphere() and isRealLeatherfacePresent() == false then local sound = math.random(1, 9) if sound == 1 then sound = "horror001.mp3" end if sound == 2 then sound = "horror002.mp3" end if sound == 3 then sound = "horror003.mp3" end if sound == 4 then sound = "horror004.mp3" end if sound == 5 then sound = "horror005.mp3" end if sound == 6 then sound = "horror006.mp3" end if sound == 7 then sound = "horror007.mp3" end if sound == 8 then sound = "horror010.mp3" end if sound == 9 then sound = "horror012.mp3" end triggerClientEvent("onClientScreamPlay", getRootElement(), sound) triggerEvent("onScreamPlay", getRootElement(), sound) end end , 20000, 0) function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end function getPointFromDistanceRotation(x, y, dist, angle) local a = math.rad(90 - angle); local dx = math.cos(a) * dist; local dy = math.sin(a) * dist; return x+dx, y+dy; end Leatherface = nil function getPlayerNearestToPosition(x, y, z) local nearestPlayer = nil local nearestDistance = nil for i, players in ipairs(getElementsByType("player")) do local px, py, pz = getElementPosition(players) local distance = getDistanceBetweenPoints3D(px, py, pz, x, y, z) if nearestPlayer == nil then nearestPlayer = players nearestDistance = distance elseif distance < nearestDistance then nearestDistance = distance nearestPlayer = players end end if nearestPlayer == nil then return false else return nearestPlayer end end setTimer( function() if isRealLeatherfacePresent() then local x, y, z = getElementPosition(RealLeatherface) local player = getPlayerNearestToPosition(x, y, z) if player then local px, py, pz = getElementPosition(player) if getDistanceBetweenPoints3D(x, y, z, px, py, pz) < 50 then if isElementInWater(RealLeatherface) then return destroyElement(RealLeatherface) end local rotZ = findRotation(x, y, px, py) setPedRotation(RealLeatherface, rotZ) if getDistanceBetweenPoints3D(px, py, pz, x, y, z) < 1 then local health = getElementHealth(player) if health < 5 or health == 5 then setElementHealth(player, 0) local leX, leY, leZ = getElementPosition(RealLeatherface) destroyElement(RealLeatherface) createExplosion(leX, leY, leZ, 5) else setElementHealth(player, health - 5) end end else destroyElement(RealLeatherface) end end end end , 50, 0) addEvent("onRealLeatherfaceSpawn", true) addEventHandler("onRealLeatherfaceSpawn", getRootElement(), function(x, y, z) if isLeatherfaceAtmosphere() then local localPed = createPed(33, x, y, z) giveWeapon(localPed, 9, 1, true) setPedAnimation(localPed, "FAT", "FatRun_Csaw", -1, true, true, false) setElementData(localPed, "type", "RealLeatherface") setPedStat(localPed, 24, 1000) setElementHealth(localPed, 1000) setElementAlpha(localPed, 0) RealLeatherface = localPed triggerClientEvent("onClientRealLeatherfaceSpawn", RealLeatherface, x, y, z) end end ) addEventHandler("onPedWasted", getRootElement(), function(ammo, killer) if isElement(RealLeatherface) then if source == RealLeatherface then local x, y, z = getElementPosition(RealLeatherface) destroyElement(RealLeatherface) createExplosion(x, y, z, 5) end end end ) Boa Sorte
-
So I would like to end the SetTimer when the player does not continue with the anim and setControlState is not picking META: <meta> <info author="Miller" version="1.0" description="drogas" name="drogas" type="script" /> <script src="main.lua" type="server"/> </meta> Bem eu sei que tu é Brasileiro então eu gostaria que quando o SetTimer acabasse o ( player ) parasse com o anim e o SetControl não ta funfando eu entro no carro e o o elemento não inverte os movimentos do carro
-
I am trying to create a script for drugs someone could help me? eg typing / drugs will withdraw and life vest, $ 100 and set animation and stop control control car crazy function bmoney(thePlayer) if (getPlayerMoney(thePlayer) >= 100) then takePlayerMoney(thePlayer, 100) outputChatBox( "#FFFF00Você gastou 100$ em 1 pedra de CRACK!", thePlayer, 255, 255, 255, true ) else outputChatBox( "Você deve ter $100 ou mais para usar este comando.", thePlayer, 220, 0, 0, true ) end end addCommandHandler( "drogas", bmoney ) function sdrogas ( player ) setPedArmor ( player, 97 ) setElementHealth ( player, 30 ) outputChatBox ( "Você usou Drogas!",player, 255, 255, 255, true ) end addCommandHandler ( "drogas", sdrogas ) function sdrogas (source) daBlockz = getElementData(root,"blockz") daAnimz = getElementData(root,"animz") if daBlockz == "crack" and daAnimz == "Bbalbat_Idle_02" then setPedAnimation(source,false) else setPedAnimation ( source, "CRACK", "Bbalbat_Idle_02") end end addCommandHandler("drogas",sdrogas) function onClientPlayerEnterVehicle ( theVehicle, seat, jacked ) setTimer ( onClientPlayerEnterVehicle() toggleControl ( "accelerate", false ) -- disable the accelerate key toggleControl ( "brake_reverse", false ) -- disable the brake_reverse key toggleControl ( "handbrake", false ) -- disable the handbrake key setControlState ( "accelerate", true ) -- force the accelerate key on outputChatBox ( "Efeito das Drogas Passou" ) end, 5000, 1 ) end addEventHandler ( "onClientPlayerVehicleEnter", getRootElement(), onClientPlayerEnterVehicle )
-
obrigado..
-
here teams = { 'Police', 'SWAT' } cars = { 598 } function checkTeam( player ) for k,v in ipairs( teams ) do if getTeamName( getPlayerTeam( player ) ) == v then return true end end return false end addEventHandler( 'onVehicleStartEnter', root, function( player ) for k,v in ipairs( cars ) do if getElementModel( source ) == v then local check = checkTeam( player ) if not check then cancelEvent( ) outputChatBox( '#F08080[ERROR] #FF0000* You Must Be In Police Team ! !', player, 255, 255, 255, true ) end end end end )
-
outputChatBox ( "#FFFF00Você pescou um Peixe e ganhou R$500",player, 255, 255, 255, true ) else outputChatBox ( "#B03060Você precisa estar dentro de um Barco para usar este comando ( /pescar )",player, 255, 255, 255, true ) end end )
-
yes it worked now when I type / fish off the vehicle id 493 was displayed for outputChatBox ("# B03060Você must be within a boat for use this command (/ fish)," Player, 255, 255, 255, true)
-
I'm not trying to make a script that makes the player can only use the command / fish if you are in a boat, I'm newbie that could help me?
-
I am somewhat new on the scripts for mta, well this script makes anyone in a boat and type / fishing, will earn $ 500, but I think there's something wrong, I'm still new at it could someone help me? Vehicles = { [493]=true } function marinha (thePlayer) if ( Vehicles[getElementModel(source)] ) cancelEvent() outputChatBox ( "#B03060Você precisa estar dentro de um Barco para usar este comando ( /pescar )",thePlayer, 255, 255, 255, true ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) addCommandHandler ( "pescar", marinha ) function gdinheiro (thePlayer) getPlayerMoney(thePlayer) givePlayerMoney ( thePlayer, 500 ) outputChatBox ( "#FFFF00Você pescou um Peixe e ganhou R$500",thePlayer, 255, 255, 255, true ) end addCommandHandler ( "pescar", gdinheiro )
-
it seems that the bug mta ..
-
yes .. more when I put in addcommandhandler of error, as the # Mr.Pres [T] ege cited above
-
Yes I know that when I wanted to put a person / bind, withdraw money by using the command ..
-
What did is wrong with this script? I am not able to use this script, I type / bind and not take money and does nothing .. function bmoney (thePlayer) getPlayerMoney(thePlayer) end takePlayerMoney ( thePlayer, tonumber(100) end outputChatBox ( "#FFFF00Você gastou 100$ para usar este comando ( /bind )",thePlayer, 255, 255, 255, true ) end addCommandHandler ( "bind", bmoney ) :B
-
you therefore AddEventHandler ("onPlayerWated" it is certain AddEventHandler ("onPlayerWasted" script --respawning function respawn () spawnPlayer (source, 1177.5682373047, -1323.2587890625, 14.077121734619 ) outputChatBox ( getPlayerName ( source ).." died and was transported to All Saints Hospital.") end addEventHandler("onPlayerWasted", getRootElement(),respawn)
-
Não cara acho que você não entendeu por exemplo eu boto uma parte do script assim teams = { 'gangA', 'gangB' } cars = { 598, 596, 597, 599, 497, 490, 528, 599, 523, 425 } function checkTeam( player ) for k,v in ipairs( teams ) do if getTeamName( getPlayerTeam( player ) ) == v then return true end end return false end addEventHandler( 'onVehicleStartEnter', root, function( player ) for k,v in ipairs( cars ) do if getElementModel( source ) == v then local check = checkTeam( player ) if not check then cancelEvent( ) outputChatBox( '#F08080[ERRO] #FF0000Este veículo pertence a Gangue Arsenal !', player, 255, 255, 255, true ) end end end end ) dai ele funciona deboas só que quando eu boto 2 x o mesmo script no mesmo arquivo.lua não pega..
-
Bom esse script faz com que, quem não for da gangue não poderá entrar no veículo x ( exemplo ), só que não to conseguindo usar ;x alguem poderia me ajudar ? teams = { 'LEI', 'team2' } cars = { 598, 596, 597, 599, 497, 490, 528, 599, 523, 425 } function checkTeam( player ) for k,v in ipairs( teams ) do if getTeamName( getPlayerTeam( player ) ) == v then return true end end return false end addEventHandler( 'onVehicleStartEnter', root, function( player ) for k,v in ipairs( cars ) do if getElementModel( source ) == v then local check = checkTeam( player ) if not check then cancelEvent( ) outputChatBox( '#F08080[ERRO] #FF0000Este veículo pertence a Organização LEI !', player, 255, 255, 255, true ) end end end end ) teams = { 'Crips', 'team2' } cars = { 520 } function checkTeamCrips( player ) for k,v in ipairs( teams ) do if getTeamName( getPlayerTeam( player ) ) == v then return true end end return false end addEventHandler( 'onVehicleStartEnter', root, function( player ) for k,v in ipairs( cars ) do if getElementModel( source ) == v then local check = checkTeamCrips( player ) if not check then cancelEvent( ) outputChatBox( '#F08080[ERRO] #FF0000Este veículo pertence a Gangue Crips !', player, 255, 255, 255, true ) end end end end ) teams = { 'Bloods', 'team2' } cars = { 450 } function checkTeamBloods( player ) for k,v in ipairs( teams ) do if getTeamName( getPlayerTeam( player ) ) == v then return true end end return false end addEventHandler( 'onVehicleStartEnter', root, function( player ) for k,v in ipairs( cars ) do if getElementModel( source ) == v then local check = checkTeamCrips( player ) if not check then cancelEvent( ) outputChatBox( '#F08080[ERRO] #FF0000Este veículo pertence a Gangue Bloods !', player, 255, 255, 255, true ) end end end end )
-
only who is the gang can get in a vehicle, then I put 3 times the same script and modified the names of gangs and changed vehicles, more is not working, sorry for my englis Debes poner esto en el topico de espanol/portugues. Aqui o Aqui. You should put this in the Spanish/Portuguese topic since that's what you understand. So ok;)
-
only who is the gang can get in a vehicle, then I put 3 times the same script and modified the names of gangs and changed vehicles, more is not working, sorry for my englis
-
What did is wrong here? teams = { 'LEI', 'team2' } cars = { 598, 596, 597, 599, 497, 490, 528, 599, 523, 425 } function checkTeam( player ) for k,v in ipairs( teams ) do if getTeamName( getPlayerTeam( player ) ) == v then return true end end return false end addEventHandler( 'onVehicleStartEnter', root, function( player ) for k,v in ipairs( cars ) do if getElementModel( source ) == v then local check = checkTeam( player ) if not check then cancelEvent( ) outputChatBox( '#F08080[ERRO] #FF0000Este veículo pertence a Organização LEI !', player, 255, 255, 255, true ) end end end end ) teams = { 'Crips', 'team2' } cars = { 520 } function checkTeamCrips( player ) for k,v in ipairs( teams ) do if getTeamName( getPlayerTeam( player ) ) == v then return true end end return false end addEventHandler( 'onVehicleStartEnter', root, function( player ) for k,v in ipairs( cars ) do if getElementModel( source ) == v then local check = checkTeamCrips( player ) if not check then cancelEvent( ) outputChatBox( '#F08080[ERRO] #FF0000Este veículo pertence a Gangue Crips !', player, 255, 255, 255, true ) end end end end ) teams = { 'Bloods', 'team2' } cars = { 450 } function checkTeamBloods( player ) for k,v in ipairs( teams ) do if getTeamName( getPlayerTeam( player ) ) == v then return true end end return false end addEventHandler( 'onVehicleStartEnter', root, function( player ) for k,v in ipairs( cars ) do if getElementModel( source ) == v then local check = checkTeamCrips( player ) if not check then cancelEvent( ) outputChatBox( '#F08080[ERRO] #FF0000Este veículo pertence a Gangue Bloods !', player, 255, 255, 255, true ) end end end end )