-
Posts
3,875 -
Joined
-
Days Won
67
Everything posted by DNL291
-
Tente isto: local barrier = {} local function isAdmin(thePlayer) local accName = getAccountName(getPlayerAccount (thePlayer)) return isObjectInACLGroup("user."..accName, aclGetGroup( "admin" )) end function createBarrier(thePlayer) if isAdmin(thePlayer) then if isElement(barrier[thePlayer]) then local x, y, z = getElementPosition(thePlayer) local barrierObject = createObject(1225, x-1, y, z-0.6) if (barrierObject ~= false) then barrier[thePlayer] = barrierObject end else outputChatBox("Voce ja criou um explosivo, use /re (remover explosivo) para poder criar novamente.", thePlayer, 250, 0, 0) end end end addCommandHandler("explosivo", createBarrier) function deleteBarrier(thePlayer) if (isAdmin(thePlayer) ~= true) then return end; if (isElement(barrier[thePlayer])) then destroyElement(barrier[thePlayer]) barrier[thePlayer] = nil else outputChatBox("Não existe nenhum explosivo criado!", thePlayer, 250, 0, 0) end end addCommandHandler("re", deleteBarrier)
-
Marker = createMarker(2471.04, 921.19, 9.5, "cylinder", 2.0, 0, 255, 0, 150) Blip = createBlip(2471.04, 921.19, 10.82, 55) vehicleIDS = {594, 606, 607, 611, 584, 608, 435, 450, 591, 539, 441, 464, 501, 465, 564, 472, 473, 493, 595, 484, 430, 453, 452, 446, 454, 581, 509, 481, 462, 521, 463, 510, 522, 461, 448, 468, 586, 425, 520} function transfender() local randomI = math.random(#vehicleIDS) outputChatBox("A transportadora está pedindo 50.000$ por "..getVehicleNameFromModel(vehicleIDS[randomI]).." !", thePlayer, 255, 255, 255, false) end setTimer( transfender, 1000, 0) Btw, thePlayer will return nil.
-
Nesse caso, teria que renomear todas imagens apenas com números.
-
Use: tostring. local randomImage = math.random(1,11) login_window = guiCreateStaticImage(0, 0, screenw, screenh, "images/background_"..tostring(randomImage)..".png", false)
-
Shinigami, I did a test and it should be because the colshape is wrong (I saw it using setDevelopmentMode + showcol). But it works. So you should to fix the colshape size.
-
Mapa Desaparece no servidor
DNL291 replied to skybad's topic in Ajudas relacionadas ao MTA:SA (Cliente/Servidor)
É pra fazer testes usando o local que você removeu o objeto e o ID. Mas sem problemas, tente fazendo um teste com este código Lua: local objects = {550, 551, 552, 553} addEventHandler( "onResourceStart", resourceRoot, function() for i,id in ipairs(objects) do removeWorldModel(id, 100, x, y, z) end setOcclusionsEnabled(false) end ) -
Try this: local ColMoney = createColRectangle ( 2057.1384277344, -1258.0145263672, -185, 110 ) addEventHandler( "onResourceStart", resourceRoot, function() setTimer(colShapeMoney, 1000, 0) end ) function colShapeMoney() local players = getElementsWithinColShape(ColMoney, "player") for k,player in ipairs(players) do givePlayerMoney(player, 3) end end
-
Use source instead of thePlayer. function kitvip ( thePlayer ) local accName = getAccountName ( getPlayerAccount (thePlayer) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) then local VIPi = getElementData(thePlayer, "vip") or 0 if VIPi == 0 then setElementData(thePlayer, "Map", 1) outputChatBox("VIP: Iteme VIP selectate!", thePlayer, 0, 255, 0, false) outputServerLog("VipCmd: VIP-ul"..getPlayerName(thePlayer).."si-a setat itemele !") else outputChatBox("VIP: Poti folosi aceasta comanda o singura data pe viata !", thePlayer, 255, 0, 0, false) end end end addCommandHandler("vip",kitvip, false) function rmvvip() setElementData(source, "vip", 0) end addEventHandler("onPlayerWasted", getRootElement(), rmvvip) function rmvVIP() local playerAccount = getPlayerAccount(source) if (playerAccount) and not isGuestAccount(playerAccount) then local VIPb = getElementData(source, "vip") or 0 setAccountData( playerAccount, "vip", tostring(VIPb) ) end end addEventHandler("onPlayerQuit", getRootElement(), rmvVIP) function amvVIP(_, acc) local VIPb = getAccountData(acc, "vip") setElementData( source, "vip", VIPb ) end addEventHandler("onPlayerLogin", getRootElement(), amvVIP)
-
function spawnPolice ( cityName, teamName, skinName ) if ( teamName == "Police" and skinName == "Police" ) then setPlayerTeam ( source, teamPolice ) setTeamFriendlyFire( getTeamFromName(teamPolice), false ) local x,y,z x = 1608.10 y = -1686.58 z = 6.21 spawnPlayer ( source, x,y,z ) fadeCamera(source, true) giveWeapon ( source, 3, 2000 ) giveWeapon ( source, 22, 2000 ) giveWeapon ( source, 32, 2000 ) giveWeapon ( source, 25, 200 ) setElementHealth ( source, 100 ) setElementModel ( source,280 ) setPedArmor ( source, 0 ) triggerClientEvent ( "onPlayerChooseTeam", getRootElement(), teamName ) end end addEvent("setPlayerTeam",true) addEventHandler("setPlayerTeam",resourceRoot,function(Police) setPlayerTeam(client,Police) end ) Try it.
-
That's because your code has some errors. It's missing an end to close the if statement and also to close the function spawnPolice. I suppose the code: triggerClientEvent ( "onPlayerChooseTeam", getRootElement(), teamName ) end end Is a part from the function spawnPolice.
-
setTeamFriendlyFire( getTeamFromName(teamName), false )
-
Se o ban ainda continua com o prazo terminado, vá à categoria de suporte global. E lembre-se de não usar programas ilegais, ou você poderá ser banido eternamente.
-
Boa sorte com o servidor. Espero que seja bom em todos aspectos - administração, jogabilidade, bons scripts, etc. Isso não é fácil, é claro, mas com o tempo tudo vai melhorando.
-
Mapa Desaparece no servidor
DNL291 replied to skybad's topic in Ajudas relacionadas ao MTA:SA (Cliente/Servidor)
Mostre o seu código para mim ver. -
Use the Lua functions repeat until. An example: local curIndex, randomI local marker addEventHandler('onMarkerHit', resourceRoot, function(element) if not element.type == 'player' then return end curIndex = tonumber(source:getID()) if not curIndex then return end source:destroy() repeat randomI = math.random(#surprisesCoords) until randomI ~= curIndex local x,y,z = unpack(surprisesCoords[randomI]) marker = Marker(x, y, z, 'corona', 1, 255, 255, 0) marker:setID(tostring(randomI)) end)
-
You can edit the mapnames resource and leave it the way you want.
-
A única forma que conheço é usando shader. Você pode perguntar para alguém que saiba programar essa linguagem, para conseguir o código para substituir as Pinturas. O restante, seria usar as funções do MTA para substituir usando shader.
-
You're welcome.
-
local heliPos = { { marker = { -2237.92749, 2328.21558, 6.4 }, vehicle = { -2227.85522, 2326.74170, 7.54688, rot=0 }, }, { marker = { 2577.23926, -1119.34814, 80.5 }, vehicle = { 2592.02979, -1123.67065, 80.94149, rot=180 }, }, { marker = { 1532.44519, -1350.25830, 328 }, vehicle = { 1544.21667, -1353.34680, 329.47424, rot=0 }, } } local markers = {} local Helli = { } local vehicleID = 487 -- maverick addEventHandler( "onResourceStart", resourceRoot, function() for i=1, #heliPos do local x,y,z = unpack(heliPos[i].marker) createBlip(x, y, z, 5) markers[i] = createMarker(x, y, z, "cylinder",1.5,230,0,85,225) end end ) function teste(hitElement) if getElementType(hitElement) ~= "player" then return end; if isPedInVehicle(hitElement) then return end; for i=1, #markers do if (source == markers[i]) then if isElement(Helli[hitElement]) then destroyElement(Helli[hitElement]) end; local vx,vy,vz = unpack(heliPos[i].vehicle) local vrot = heliPos[i].vehicle.rot Helli[hitElement] = createVehicle(vehicleID, vx, vy, vz, 0, 0, vrot) setTimer(warpPedIntoVehicle, 80, 1, hitElement, Helli[hitElement]) break end end end addEventHandler("onMarkerHit", resourceRoot, teste) addEventHandler ( "onVehicleExplode", resourceRoot, function ( ) destroyElement ( source ) end ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( isElement ( Helli [ source ] ) ) then destroyElement ( Helli [ source ] ) end Helli [ source ] = nil end ) Is that what you mean?
-
The marker should be stored in a table (there are others ways though), since are being created several markers. Also, it makes no sense to use warpPlayerIntoVehicle in a for-loop.
-
Do you want the pickup doesn't get visible for whom? If you want to show it just for a specific player, use this: setElementVisibleTo(pickup, root, false) setElementVisibleTo(pickup, player, true) Edit Yeah, nevermind. It doesn't work for pickups, forgot about the MTA Wiki note.
-
Shader Panel Descrição: Gerencia os shaders do servidor. Bank System Descrição: Sistema bancário baseado em GUI. ivhud Descrição: Hud do GTA IV para MTA:SA Vehicle Hud Superman 50p - Drift Gang system Tem também este Login Panel. Se não souber como funcionam esses que estão sem descrição, só ver a página do recurso.