-
Posts
3,875 -
Joined
-
Days Won
67
Everything posted by DNL291
-
He didn't said that want it to go back to the 1st picture if it's on the last picture.
-
addEventHandler( "onClientGUIClick", button, function () if (curIndex == #images) then return end curIndex = curIndex + 1 end )
-
You can do something like this: local images = { "images/1.png", "images/2.png", "images/3.png", "images/4.png" } local curIndex = 1 addEventHandler( "onClientRender", root, function () dxDrawImage(x, y, w, h, images[curIndex]) end ) addEventHandler( "onClientGUIClick", button, function () curIndex = curIndex + 1 end )
-
'tubes' will only return a colshape, since, it's being stored in a variable. Use a table to store each colshape. Also, 'onMarkerHit' is called only for markers created using createMarker. Use onColShapeHit instead.
-
Do you mean a GUI element, a element of the GTA world or what?
-
getRaceAlivePlayers already returns a number. Also, i think you should to use tostring instead. bnt_font = dxCreateFont ( "fonts/bnt.ttf", 20 ) function aliveplayers ( ) local screenWidth, screenHeight = guiGetScreenSize() dxDrawText ( '#006699ALIVE: #FFFFFF' .. tostring(getRaceAlivePlayers ( )), 2, screenHeight - dxGetFontHeight(0.7, bnt_font)/0.5, 0.5, 1.5, tocolor ( 255, 255, 255, 255 ), 0.9, bnt_font, 'left', 'top', false, false, false, true) end addEventHandler ( "onClientRender", getRootElement(), aliveplayers ) function getRaceAlivePlayers ( ) local players = 0 for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( getElementData ( player, "state" ) == "alive" ) then players = ( players + 1 ) end end return players end
-
function Check() local playerTeam = getPlayerTeam (source) if playerTeam then outputChatBox ( "#F4A460[GANG]#F08080 Bem vido a gang " .. getTeamName ( playerTeam ).." ! ", source, 255, 255, 255, true ) end end addEventHandler ( "onPlayerLogin", root, Check )
-
You're welcome.
-
I've tested and it worked for me. Try copying my code again.
-
Client function touge() PanelTouge = guiCreateWindow ( 341, 204, 292, 495, "TougeRushers Carros", false ) guiSetProperty(PanelTouge, "CaptionColour", "FFD90000") guiWindowSetSizable(PanelTouge, false) guiSetVisible(PanelTouge, false) nissanr32 = guiCreateButton(24, 41, 63, 46, "Nissan Skyline GTR R32", false, PanelTouge) brz = guiCreateButton(24, 101, 63, 46, "Subaru BRZ", false, PanelTouge) nissanr35 = guiCreateButton(24, 161, 63, 46, "Nissan Skyline GTR R35", false, PanelTouge) memotext = guiCreateMemo(39, 432, 203, 53, "Estos son los carros oficiales del\nequipo |TougeRushers|", false, PanelTouge) guiMemoSetReadOnly(memotext, true) addEventHandler ( "onClientGUIClick", nissanr32, nissann, false ) addCommandHandler("tougecars", toggleWindow) end addEventHandler("onClientResourceStart", resourceRoot, touge) function toggleWindow() guiSetVisible(PanelTouge, not guiGetVisible(PanelTouge)) showCursor(guiGetVisible(PanelTouge)) end function nissann() triggerServerEvent ( "OnNissanEnter", getLocalPlayer() ) toggleWindow() end Server function nissann () local account = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..account, aclGetGroup ( "TougeRushers" ) ) then local xp,yp,zp = getElementPosition ( source ) createVehicle ( 426, xp, yp, zp + 10 ) outputChatBox ( "Aqui esta su vehiculo BolonZX", source ) else outputChatBox ( "Este Vehiculo pertenece a BolonZX", source ) end end addEvent( "OnNissanEnter", true ) addEventHandler( "OnNissanEnter", getRootElement(), nissann )
-
You're welcome. But, keep in mind that the onResourceStart event is called only when a resource is started. Therefore, it will not be called when a player join the server, in that case, you can use onClientResourceStart instead and change the code to the client-side. Or you can use the onPlayerJoin event.
-
items = { { -1432.12890625, 2672.3349609375, 55.691806793213 }, {-1428.2822265625, 2665.9150390625, 55.6875 }, } addEventHandler ( "onResourceStart", resourceRoot, function() for _,v in ipairs ( items ) do object = createObject ( 929, unpack(v) ) setTimer(destroy, 5000, 1, object) end end ) function destroy(element) if isElement(element) then for _,player in ipairs(getElementsByType("player")) do bindKey(player, "x", "down", function() destroyElement(element) end) end end end Do you mean that?
-
Still is possible to decompile a code with that, anyway. @Wei do what Solidsnake14 said.
-
Visto que já existem determinados tutoriais explicando isso, você pode ler aqui uma introdução que aborda isso: https://wiki.multitheftauto.com/wiki/PT- ... _Scripting
-
-- Create a table onPlayerWasted onPlayerQuit getPedWeapon getPedTotalAmmo -- Stores the weapon and ammo in the table. getPlayerAccount toJSON setAccountData onPlayerLogin onPlayerSpawn getPlayerAccount getAccountData fromJSON giveWeapon
-
mta so carrega 35 servidores
DNL291 replied to iKerius's topic in Ajudas relacionadas ao MTA:SA (Cliente/Servidor)
É, Pode ser isso. Mas eu disse isso, porque já usei internet 3g, e só aparece em torno de 30 servers. -
Pode ser em qualquer área. Investidor, web design, programador, mapper (que seja experiente). Mais outro programador, porque o intuito é fazer mais de um servidor. A propósito, os 2 primeiros servidores devem ser RPG e Race. E Dayz, apenas no caso de ter o suficiente de pessoas.
-
Se você estiver interessado, você pode ter mais informações sobre todo projeto, entrando em contato com um de nós. Pretendemos levar este projeto realmente a sério. Estamos dispostos a desenvolver este projeto até o fim. E eu também, visto que atualmente, estou com mais tempo disponível. A principio, é isso aí. Mais pra frente, estaremos retornando para dar mais informações sobre o projeto - que é totalmente em português.
-
Se você precisa aprender Lua, veja este tópico que contém vários links que irão te auxiliar. O software para você desenvolver scripts vai de sua preferência, eu uso o Notepad++ com um pacote para scripters integrado nele. Você ainda pode encontrar outros, como MTA Script Editor. Tem também um editor Lua, que é desenvolvido para programar a própria linguagem, além do Sublime.
-
You're welcome.
-
local soundsPath = { ["lilwayne"] = "http://1in.kz/s/music/1310701564_lil-wayne-ft-lil-b-grove-st-party.mp3" } addCommandHandler("setradio", function(cmdName, sound, vol) local music = playSound(soundsPath[sound]) setSoundVolume( music, vol or 0.8 ) end ) e.g: /setradio lilwayne.
-
llantas = { {1665.1064453125, -2113.4404296875, 13.546875,0,0} } addEventHandler ("onClientResourceStart",getResourceRootElement(getThisResource()), function() for i,v in ipairs (llantas) do neumatico = createPickup (v[1],v[2],v[3],3,2768,100) neumaticoMarker = createMarker (v[1],v[2],v[3],"corona",1,143,143,17,80) setElementData (neumaticoMarker,"Neumatico!!", true) setElementInterior (neumaticoMarker,v[4]) setElementInterior (neumatico,v[4]) setElementDimension(neumatico,v[5]) setElementDimension(neumaticoMarker,v[5]) end end) addEventHandler ("onClientMarkerHit",getRootElement(), function(hitEle,dim) if (getLocalPlayer() == hitEle) and (getElementData (source,"Neumatico!!") == true) and (dim) then triggerServerEvent("addAcountNeumatico",getLocalPlayer(),getLocalPlayer(),1) outputChatBox ("+ 1 Neumático",0,255,0) destroyElement(source) destroyElement(neumatico) setTimer( function() for i,v in ipairs (llantas) do neumatico = createPickup (v[1],v[2],v[3],3,2768,100) neumaticoMarker = createMarker (v[1],v[2],v[3],"corona",1,143,143,17,80) end end, 20000, 1 ) end end )
-
vehicle = {} function createVehicleForPlayer(thePlayer, command, ...) local x,y,z = getElementPosition(thePlayer) -- get the position of the player local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) local vehicleName = table.concat({...}, " ") local vehID = getVehicleModelFromName ( vehicleName ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then vehicle[thePlayer] = createVehicle( vehID,x,y,z ) warpPedIntoVehicle ( thePlayer, vehicle[thePlayer] ) setVehicleDamageProof(vehicle[thePlayer], true) if (vehicle[thePlayer] == false) then -- if so, output a message to the chatbox, but only to this player. outputChatBox("Failed to create vehicle.",thePlayer) else outputChatBox("Vehicle has been created",thePlayer) end end end addCommandHandler("cv", createVehicleForPlayer) function destroy(thePlayer, command ) if isElement(vehicle[thePlayer]) then destroyElement ( vehicle[thePlayer] ) end end addCommandHandler ("dv", destroy)
-
mta so carrega 35 servidores
DNL291 replied to iKerius's topic in Ajudas relacionadas ao MTA:SA (Cliente/Servidor)
Certifique-se de estar na guia internet. Isso também pode ser causado por uma conexão lenta.