Leaderboard
Popular Content
Showing content with the highest reputation on 29/05/18 in all areas
-
3 points
-
3 points
-
2 points
-
2 points
-
O evento "onResourceStart" geralmente não deve ser anexado ao root, pois fazendo isso, executará a função Criarblip quando qualquer resource for iniciado. Se você quer que execute somente quando este resource for iniciado use getResourceRootElement(getThisResource()). Seria mais fácil vc criar o blip anexado ao marker em vez de ficar criando na mesma posição. Dessa forma, se você trocar a posição do marker, o blip trocará de posição junto com ele. Para isso, sugiro que use CreateBlipAttachedTo em vez de CreateBlip. Para executar uma função ao colidir no marker, use o evento onMarkerHit. Exemplo: function Criarblip () bar = createMarker (2309.62, -1643.63, 13.8385, "cylinder") -- Marker para entrar no Bar. createBlipAttachedTo (bar, 49) -- Blip anexado ao marker bar. backBar = createMarker (501.98, -67.75, 997.84, "cylinder") -- Marker para sair do Bar. setElementDimension (backBar, 1) -- Coloca o backBar na dimensão 1. setElementInterior (backBar, 11) -- Coloca o backBar no interior do Bar. end addEventHandler ("onResourceStart", getResourceRootElement(getThisResource()), Criarblip) function teleBar (hitElement, matchingDimension) if hitElement and getElementType (hitElement) == "player" and matchingDimension then -- Se o elemento que colidiu no marker for um jogador e a colisão for na mesma dimensão que o marker está, então: if source == bar then -- Se o marker que foi colidido for o bar, então: setElementInterior (hitElement, 11) -- Coloca o jogador no interior 11. setElementDimension (hitElement, 1) -- Coloca o jogador na dimensão 1. setElementPosition (hitElement, 501.98, -69.75, 997.84, true) -- Coloca o jogador na posição que fica no interior do Bar. elseif source == backBar then -- Senão, se o marker que foi colidido for o backBar, então: setElementInterior (hitElement, 0) -- Coloca o jogador no interior 0. (exterior) setElementDimension (hitElement, 0) -- Coloca o jogador na dimensão 0. setElementPosition (hitElement, 2307.62, -1643.63, 13.8385, true) -- Coloca o jogador fora do Bar, perto do marker de entrada. end end end addEventHandler ("onMarkerHit", getRootElement(), teleBar) -- Ativa essa função quando qualquer marker for colidido. Sempre leia a Wiki para aprender sobre determinados eventos.2 points
-
2 points
-
Soooo, originally made those mappings for myself, my project that I was making and wanted to open, but things didn`t turn out as planned aaand I kinda gave up on all SA:MP RolePlay project making. Two years passed by, but luckily I hang onto those mappings that I made, just in case, maybe someday, someone could use them in their own projects. So yeah - that day has come! Sharing those mappings to you, my friends! All of them are located in Los Santos. Intended for RolePlay servers, but feel free to use them however and wherever you want. Here you go: Los Santos Airport Object count: 229, it`s almost original airport from the first cutscene in game, just remapped so you can walk on it without falling throught. Approximate location: above Los Santos airport. Warning: Usable only as interior (in another vworld I guess), reason: it`s a pretty big mess when looking from outside. Download link: http://www.solidfiles.com/d/5b104d8328/ Bank Object count: 110 Approximate location: Under the building, east from Ottos Autos. Warning: Usable only as interior (in another vworld I guess), reason: some of non-collidable objects are sticking out of the ground. Download link: http://www.solidfiles.com/d/880d9b9a60/ Dumpsite Object count: 36 Approximate location: Las Colinas south. Download link: http://www.solidfiles.com/d/4b8b7ed3a7/ Los Santos Police Department Interior Object count: 158 Approximate location: On top of LSPD, Pershing Square east. Warning: Usable only as interior (in another vworld I guess), reason: mapped on top of LSPD Download link: http://www.solidfiles.com/d/345bd77a62/ Los Santos Police Department garage/gates Object count: 49 Approximate location: LSPD, Pershing Square east. Download link: http://www.solidfiles.com/d/55acb70933/ Coalmine Object count: 97 Approximate location: Under Flint Range farm Removable objects: RemoveBuildingForPlayer(playerid, 1454, -574.3906, -1476.8203, 10.3828, 0.25); RemoveBuildingForPlayer(playerid, 1454, -577.3438, -1478.5703, 10.6563, 0.25); RemoveBuildingForPlayer(playerid, 1454, -580.2891, -1480.3125, 10.7422, 0.25); RemoveBuildingForPlayer(playerid, 727, -565.5156, -1468.0078, 8.5547, 0.25); RemoveBuildingForPlayer(playerid, 727, -555.0859, -1476.4688, 8.2813, 0.25); RemoveBuildingForPlayer(playerid, 3276, -419.7500, -1412.9766, 23.1250, 0.25); RemoveBuildingForPlayer(playerid, 17000, -406.9141, -1448.9688, 24.6406, 0.25); RemoveBuildingForPlayer(playerid, 3276, -378.7734, -1459.0234, 25.4766, 0.25); RemoveBuildingForPlayer(playerid, 3276, -384.2344, -1455.8281, 25.4766, 0.25); RemoveBuildingForPlayer(playerid, 17005, -391.1406, -1432.9922, 32.4297, 0.25); RemoveBuildingForPlayer(playerid, 17006, -394.9609, -1433.9688, 32.4453, 0.25); RemoveBuildingForPlayer(playerid, 3276, -396.8047, -1411.5469, 25.3906, 0.25); RemoveBuildingForPlayer(playerid, 3276, -408.5625, -1412.2891, 24.8281, 0.25); RemoveBuildingForPlayer(playerid, 3276, -368.7813, -1454.3672, 25.4766, 0.25); RemoveBuildingForPlayer(playerid, 3425, -370.3750, -1446.9688, 35.9531, 0.25); RemoveBuildingForPlayer(playerid, 17298, -366.6719, -1422.6875, 30.3750, 0.25); RemoveBuildingForPlayer(playerid, 1454, -372.1797, -1434.6094, 25.5156, 0.25); RemoveBuildingForPlayer(playerid, 1454, -369.1953, -1434.6094, 25.5156, 0.25); RemoveBuildingForPlayer(playerid, 1454, -366.2031, -1434.6094, 25.4375, 0.25); RemoveBuildingForPlayer(playerid, 3276, -362.4844, -1446.1250, 25.4766, 0.25); RemoveBuildingForPlayer(playerid, 3276, -361.8125, -1407.5391, 25.4766, 0.25); RemoveBuildingForPlayer(playerid, 3276, -360.7188, -1435.2578, 24.8984, 0.25); RemoveBuildingForPlayer(playerid, 1454, -363.2109, -1434.6094, 25.3984, 0.25); RemoveBuildingForPlayer(playerid, 3276, -358.7578, -1423.8203, 24.7500, 0.25); RemoveBuildingForPlayer(playerid, 3276, -356.8594, -1412.5547, 25.2500, 0.25); RemoveBuildingForPlayer(playerid, 1454, -333.6953, -1434.8359, 15.4063, 0.25); RemoveBuildingForPlayer(playerid, 1454, -328.9688, -1434.8359, 15.1797, 0.25); RemoveBuildingForPlayer(playerid, 1454, -323.3828, -1434.8359, 14.9375, 0.25); RemoveBuildingForPlayer(playerid, 1454, -315.8438, -1434.8359, 14.7578, 0.25); RemoveBuildingForPlayer(playerid, 1454, -307.7344, -1434.8359, 14.1719, 0.25); RemoveBuildingForPlayer(playerid, 727, -578.4922, -1511.0781, 8.5078, 0.25); RemoveBuildingForPlayer(playerid, 3425, -583.0547, -1496.7031, 19.9844, 0.25); RemoveBuildingForPlayer(playerid, 727, -588.7031, -1493.3438, 9.4453, 0.25); RemoveBuildingForPlayer(playerid, 17457, -570.7344, -1490.3203, 15.0703, 0.25); RemoveBuildingForPlayer(playerid, 3286, -559.3047, -1486.3281, 12.8359, 0.25); RemoveBuildingForPlayer(playerid, 1454, -586.1953, -1483.7969, 11.0391, 0.25); RemoveBuildingForPlayer(playerid, 1454, -584.1328, -1485.9844, 10.5781, 0.25); RemoveBuildingForPlayer(playerid, 800, -560.0625, -1481.4297, 10.5859, 0.25); RemoveBuildingForPlayer(playerid, 1454, -583.2422, -1482.0547, 10.7969, 0.25); Download link: http://www.solidfiles.com/d/f0f7cb9ff1/ Restaurant Object count: 258 (extremely detailed) Approximate location: Under the house on Pershing Square north. Download link: http://www.solidfiles.com/d/a3735d4673/ Roadworks Object count: 78 Approximate location: Idlewood, behind Alhambra. Removable objects: RemoveBuildingForPlayer(playerid, 5543, 1941.6563, -1682.5703, 12.4766, 0.25); RemoveBuildingForPlayer(playerid, 1283, 1940.9063, -1741.1484, 15.6016, 0.25); RemoveBuildingForPlayer(playerid, 1226, 1945.7656, -1716.3594, 16.3906, 0.25); RemoveBuildingForPlayer(playerid, 1226, 1937.5547, -1669.8906, 16.3906, 0.25); RemoveBuildingForPlayer(playerid, 5441, 1941.6563, -1682.5703, 12.4766, 0.25); RemoveBuildingForPlayer(playerid, 1226, 1945.7656, -1635.7734, 16.3906, 0.25); Download link: http://www.solidfiles.com/d/2df29cab48/ LS Building office Object count: 261 (extremely detailed) Approximate location: LS Building 2nd floor, west from Glenpark. Download link: http://www.solidfiles.com/d/f814efccef/ Torry (truck/lorry) Object count: 78 Approximate location: Commerce/Market intersection Download link: http://www.solidfiles.com/d/b593d9493f/ Download link for all mappings: http://www.solidfiles.com/d/7f07ffd60b/ Well, there you go, guys! Hope that these things will come in handy. Of course, any donations are much appreciated :]1 point
-
1 point
-
تعرف ي جناح انا قاصدك في السطر رقم جعلتني اللعبة أعرف ناس بعدها أخسر ناس ودة كان شئ سئ بالنسبة لي -8 دا وربي كان قصدي عليك ضض لاني خسرتك وانت فعلا طلعت جدع بس الحمدلله صلحتك قبل ما اعتزل1 point
-
what about this ? addEventHandler("onPlayerWasted", root, function () if ( getElementModel(source) == 0 ) then setElementData(source,"CJ",true) else setElementData(source,"CJ",false) end end ) addEventHandler("onPlayerSpawn", root, function () if ( getElementData(source,"CJ") == true ) then setElementModel(source, 0) end end )1 point
-
Unless you set the postGUI argument in dxDrawImage to true then the GUI should be on top of the image at all times.1 point
-
When player be with CJ skin before die , it is no need to set player's skin to CJ skin when player die. Use, "onPlayerSpawn" event to set the player's skin to 0 / CJ skin Server Side :- addEventHandler("onPlayerSpawn", root, function () setElementModel ( source, 0 ) end ) I think this will be usefull.1 point
-
1 point
-
1 point
-
التقليد = نفس خصائص اللوحة و نفس كل شيء فيها اما شفت مود وعجبك وسويته + ضفت عليه اشياء وطورته عذا ماهو تقليد1 point
-
عندي استفسار :- الحين تقليد المودات ممنوع ؟ حتي لو بنفس الافكار حرام او ممنوع ؟ كل الناس تقلد عادي وش فيها ثاني شي تقول انت و ابراهيم في الصوره واحد مقلد اسم مانستر يعني كمان تفترون علي الراجل و تهاجموه بدل ما تشجعوه انو يكمل + من فهمي للموضوع السيرفر الي هوا مقلده انقفل اجل وش تبون بعد قفلتو سيرفركم خلاص يعني ذا قلد الافكار فقط ما سرق موداتكم ولا شي1 point
-
Like This ?? Server Side :- addEventHandler("onColShapeHit",yourColName, function (player) setElementData(player,"inCol",true) end ) addEventHandler("onColShapeLeave",yourColName, function (player) setElementData(player,"inCol",false) end ) setTimer( function () for _,Player in ipairs ( getElementsByType("player") ) do if ( getElementData(Player,"inCol") == false ) then setElementHealth(Player,getElementHealth(Player)-20) end end end,1000,1) Replace "YourColName" with your col shape's name.1 point
-
1 point
-
1 point
-
Hi everyone. I want to share some of my resources. For almost 8 years I have been working on various projects in the MTA and over the years there has been an archive of resources and scripts. Maybe for someone it will be useful and interesting. Consists: •Terrain editor(in two editions). In-game terrain editing system. Video •Dynamic grass. Video •Light baking and rendering system(with DFF or distributed) Video •Models loader(DFF/TXD/COL) that can download and stream-in only those that are within a certain radius from the player •Two version of the TEDERIs Construction Tools(with FlowGraph or Wire) Video •Particle system(natively DFF or through dxDraw* fns) Video •Blank for RP gamemode and more •And more All this can be found on GitHub Notice! Many resources have been created for a long time and likely they require some adaptation for the new version of the MTA.1 point
-
I have added the new resource that may be helpful for creating your own login system. It's also an example for using the depth-buffer. https://github.com/tederis/mta-resources/tree/master/sp_login1 point
-
السيرفر اسم على مسمى لوتعرضلنا المواتر والمابات كأن السجادة مسروقه من سيرفر ثاني الله اعلم عالعموم بالتوفيق لك1 point
-
O evento a ser utilizado nesse caso é onMarkerHit (Server-side) ou onClientMarkerHit (Client-Side). Em CreateMarker está faltando alguns argumentos. Retirei de um script de roubo a lojas, onde é necessário o player entrar no marker. Sempre busque informações na wiki, ou se caso tente reproduzir algo que já tenha sido feito, procure scripts similares que será de grande ajuda. --Server local Entrar_Loja = createMarker(1315.5, -897.8, 40.5, "arrow", 1.5, 255, 255, 0, 255) --Marker createBlipAttachedTo(Entrar_Loja, 17, 2, 0, 255, 0, 0, 0, 350) --Cria um icone no marker que será visto no radar function Entrar (player) if source == Entrar_Loja and getElementType(player) == "player" then setElementInterior(player, 6, -27.32, -56.87, 1003.7) --Interior e posição para onde o jogador será teleportado (Caso deseje apenas a posição, utilize setElementPosition ) setElementDimension(player, 1) --Dimensão para onde o jogador será teleportado end end addEventHandler("onMarkerHit", getRootElement(), Entrar)1 point
-
O MTA usa um tipo de Programação orientada a eventos (veja o link) (no caso scripting - que aplica-se ao próprio Mod). Tudo será difícil pra você se ainda é novato em programação. Seria melhor você buscar o conhecimento básico da programação O básico seria: Variáveis, funções, if - elseif - else, (loop) for - while, tabelas Para usar uma função, você precisa entender a sua sintaxe. Eventos como já foi explicado, faz a função ligada a ele ser chamada quando a ação do evento for feita. E existem eventos que envia parâmetros pra função ligada a ele (você pode ver esses exemplos do Lord Henry com os eventos onPlayerWasted e onVehicleEnter). Na vida real, esse "evento" seria como seu despertador que seria configurado para te chamar num horário que você programou, a diferença é que na aplicação no MTA ele serve para fazer a chamada em tudo que é necessário - em veículos, jogadores, elementos do jogo, interface e criações do MTA, mundo do GTA, etc. Você também pode adicionar o seu próprio evento usando addEvent. Enfim, esse vídeo será útil pra você ter um bom começo em programação: https://www.youtube.com/watch?v=Ds1n6aHchRU1 point
-
AddEventHandler é uma função que será chamada quando o evento anexado a ela for ativado. Existem vários eventos diferentes que são ativados em diferentes circunstâncias, é impossível citar todos. Mas darei alguns exemplos pra facilitar. Usando o evento onPlayerWasted anexado ao addEventHandler, fará com que a função anexada a ele seja executada quando um jogador morre. function faleceu (totalAmmo, killer, weapon, bodypart, stealth) -- variáveis pré-definidas, se não for usar nenhuma delas, não precisa declará-las. -- No evento "onPlayerWasted" temos pré-definidas estas variáveis: -- source = jogador que morreu (elemento) -- totalAmmo = munição que o jogador que morreu tinha (número inteiro) -- killer = jogador ou veículo que matou ele (elemento) -- weapon = ID da arma do killer (número inteiro) -- bodypart = parte do corpo que foi atacada (número inteiro) -- stealth = se morreu direto por um golpe fatal ou se morreu por dano normal. (true ou false) local nome = getPlayerName (source) -- nome = nick do jogador que morreu. outputChatBox (nome.."#FFFFFF morreu.", root, 255, 255, 255, true) -- Envia no chat para todos, o nome do jogador que morreu. (root = todo mundo.) end addEventHandler ("onPlayerWasted", getRootElement(), faleceu) -- Executa a função "faleceu", quando qualquer jogador morrer. Usando este outro evento onVehicleEnter, fará com que a função anexada a ele seja executada quando um jogador entrar em um veículo. function entrouVeiculo (thePlayer, seat, jacked) -- source = o veículo que o jogador entrou. (elemento) -- thePlayer = o jogador que entrou no veículo. (elemento) -- seat = o ID do assento em que o jogador sentou no veículo (número inteiro) -- jacked = se o jogador entrou no veículo roubando de outro player ou não. (true ou false) local nomeVeiculo = getVehicleName (source) -- nomeVeiculo = nome do veiculo que o jogador entrou. if jacked and seat == 0 then -- Se foi roubado e o assento for do motorista, então: outputChatBox ("Você roubou um "..nomeVeiculo, thePlayer, 255, 255, 0, false) else -- Se entrou no veículo sem roubar, então: outputChatBox ("Você entrou em um #00FF00"..nomeVeiculo, thePlayer, 255, 255, 255, true) end end addEventHandler ("onVehicleEnter", getRootElement(), entrouVeiculo) -- Chama essa função quando qualquer jogador entrar em um veículo. Esses eventos acima só funcionam server-side, assim como está dito na Wiki. Já esta outra função aqui, só funciona client-side. É um evento que executa a função anexada a cada frame que passou. function textoNaTela () -- Não existem parâmetros para o onClientRender. dxDrawText ("TEXTO RENDERIZADO.", 5, 5) -- Mostra este texto durante 1 frame na sua tela. end addEventHandler ("onClientRender", getRootElement(), textoNaTela) -- Executa isso em cada frame. Fazendo com que o texto permaneça na tela. Para remover um evento ativador, use removeEventHandler. Assim como o removeCommandHandler faz com que um comando pare de ativar determinada função. Usando o removeEventHandler, fará o onClientRender parar de ativar a cada frame. Assim como diz o exemplo da Wiki.1 point
-
Cara no fórum tem tudo explicado https://wiki.multitheftauto.com/wiki/AddEventHandler como por exemplo o addeventhandler é só você procurar pelas funções que você quer entender !1 point
-
but in this case even if the person is not using CJ skin he/she wi be turned into CJ0 points