-
Posts
980 -
Joined
-
Last visited
-
Days Won
1
Everything posted by manawydan
-
try no tested local players_zombies={} local zombiePerPlayer=3 function zombiesperplayer() local players = getElementsByType("player") for k,v in ipairs(players) do if not players_zombies[v]then players_zombies[v]={} end local number = #players_zombies[v] if(number>=3)then return end local interior = getElementInterior(v) local dimension = getElementDimension(v) local x,y,z = getElementPosition(v) local zp = zombiePerPlayer-number for i=0,zp do players_zombies[v][i] = exports.zombies:createZombie(x+math.sin(math.rad(-math.random(360)))*(math.random(1,5)), y+math.cos(math.rad(-math.random(360)))*(math.random(1,5)), z, math.random(360), nil, interior, dimension ) setElementData(players_zombies[v][i],"zombiePlayer",v) end end end addEventHandler ( "onResourceStart", resourceRoot, zombiesperplayer ) setTimer(zombiesperplayer,60000,0) addEventHandler("onPlayerSpawn",root, function() if not players_zombies[source]then players_zombies[source]={} end end) addEvent("onZombieWasted",true) addEventHandler ("onZombieWasted",root, function() local playerData = getElementData(source,"zombiePlayer") if(playerData)then local number = #players_zombies[playerData] if(number~=0)then table.remove(players_zombies[playerData],source) end end end)
-
or -- server function spawnCarrr(p) x, y, z = getElementPosition( p ) createVehicle(411, x+3, y+3, z) end addEvent("spawnCarrr", true) addEventHandler("spawnCarrr", root, spawnCarrr) --client function spawnCarr() triggerServerEvent("spawnCarrr",root,localPlayer) end or -- server function spawnCarrr(x,y,z) createVehicle(411, x+3, y+3, z) end addEvent("spawnCarrr", true) addEventHandler("spawnCarrr", root, spawnCarrr) --client function spawnCarr() local x, y, z = getElementPosition( localPlayer) triggerServerEvent("spawnCarrr",root,x,y,z) end
-
try -- server function spawnCarrr() x, y, z = getElementPosition( source ) createVehicle(411, x+3, y+3, z) end addEvent("spawnCarrr", true) addEventHandler("spawnCarrr", root, spawnCarrr) --client function spawnCarr() triggerServerEvent("spawnCarrr", localPlayer) end
-
just one example: function test() local players = getElementsByType("player") for k,v in ipairs(players) do local interior = getElementInterior(v) local dimension = getElementDimension(v) local x,y,z = getElementPosition(v) createZombie ( x+math.sin(math.rad(-45))*(math.random(1,5)), y+math.cos(math.rad(-45))*(math.random(1,5)), z, math.random(360), nil, interior, dimension ) createZombie ( x+math.sin(math.rad(-90))*(math.random(1,5)), y+math.cos(math.rad(-90))*(math.random(1,5)), z, math.random(360), nil, interior, dimension ) createZombie ( x+math.sin(math.rad(-180))*(math.random(1,5)), y+math.cos(math.rad(-180))*(math.random(1,5)), z, math.random(360), nil, interior, dimension ) end end
-
just use createZombie function
-
voce poderia postar o codigo aki pra alguem ajudar ou enviar pm
-
[Ajuda] conversão "UTF-8" ???
manawydan replied to _Vodka_'s topic in Ajudas relacionadas ao MTA:SA (Cliente/Servidor)
voce pode faze isso com o notepad++ ai é so ir em formatar e colocar pra utf-8. ps: utf-8 é um tipo de codificação -
[Ajuda] nova versão MTA
manawydan replied to _Vodka_'s topic in Ajudas relacionadas ao MTA:SA (Cliente/Servidor)
meu sistema é 32 e pegou(não a de 64 a outra) -
getElementData can return nil if no is set. try function handleVehicleDamage(attacker, weapon, loss, x, y, z, tyre) -- Protect law and staff from getting wanted local hasWantedPlayersInside = false local occupants = getVehicleOccupants( source ) local vx,vy,vz = getElementPosition( source ) local px,py,pz = getElementPosition( localPlayer ) local dist = getDistanceBetweenPoints3D( vx,vy,vz, px,py,pz ) if occupants then for seat, occupant in pairs(occupants) do if getElementType(occupant) == "player" then if (tonumber(getElementData(occupant,"Wanted")) or 0) > 0 then ----- this line gives error hasWantedPlayersInside = true else outputChatBox("No data, or data<0",root) end end end end
-
[Ajuda] nova versão MTA
manawydan replied to _Vodka_'s topic in Ajudas relacionadas ao MTA:SA (Cliente/Servidor)
baixe essa versão: mtasa-1.4-full_rc-6663-20140709.exe no site https://nightly.multitheftauto.com/ a 1.4 esta em constante atualização. apenas baixe esse executavel e instale normalmente(voce nao precisa desinstalar a 1.3, pode usa ambas) -
you can use youtube tag.
-
nice man
-
i dont undestand, i use createEffect and try destroyElement, but no work.
-
creio que as variaveis tambem, qualquer coisa poste seu script aki
-
try, no tested local repMarker = createMarker(2063.60, -1831.69, 12.5, 'cylinder', 2.0, 255, 0, 0, 150)---Near Grove Street Repair Marker local repMarker2 = createMarker(1024.80, -1025.40, 3.29, 'cylinder', 2.0, 255, 0, 0, 150)---Above saints hospital repair marker local repMarker3 = createMarker(487.79, -1739.59, 10.10, 'cylinder', 2.0, 255, 0, 0, 150)---Santa Maria Beach Marker local repMarker4 = createMarker(2076.30, -2546.80, 12.60, 'cylinder', 2.0, 255, 0, 0, 150)--LS Airport Repair Marker local repMarker5 = createMarker(-1262.5, -31.70, 13.19, 'cylinder', 2.0, 255, 0, 0, 150)---SF Airport Repair Marker local repMarker6 = createMarker(1523.69, 1720.09, 9.8, 'cylinder', 2.0, 255, 0, 0, 150)---LV Airport Repair Marker local repMarker7 = createMarker(2386.5, 1049.80, 9.8, 'cylinder', 2.0, 255, 0, 0, 150)---LV Repair Marker Near Gas Station local repMarker8 = createMarker(-1904.59, 283.70, 40, 'cylinder', 2.0, 255, 0, 0, 150)--SF Repair Marker @ Wang Cars local repMarker9 = createMarker(-1786.90, 1214.90, 24.10, 'cylinder', 2.0, 255, 0, 0, 150)--SF Repair Marker @ Expensive Car Shop local repMarker10 = createMarker(344.60, 2540.5, 15.80, 'cylinder', 2.0, 255, 0, 0, 150)--Abandoned Airport Repair Marker local repMarker11 = createMarker(1872.19, -2393.30, 12.60, 'cylinder', 2.0, 255, 0, 0, 150)--LS Airport Repair Marker 2 createBlipAttachedTo(repMarker, 63) createBlipAttachedTo(repMarker2, 63) createBlipAttachedTo(repMarker3, 63) createBlipAttachedTo(repMarker7, 63) createBlipAttachedTo(repMarker8, 63) createBlipAttachedTo(repMarker9, 63) function repairMarker(thePlayer, matchingDimension) if(source==repMarker) or (source==repMarker2)or (source==repMarker3) or (source==repMarker4) or (source==repMarker5) or (source==repMarker6) or (source==repMarker7) or (source==repMarker8) or (source==repMarker9) or (source==repMarker10) or (source==repMarker11)then local t = getElementType(thePlayer) local vehicle if(t=="vehicle") then vehicle = thePlayer thePlayer = getVehicleOccupant(thePlayer) elseif(t=="player")then vehicle = getVehicleOccupant(thePlayer) end if ( not vehicle) then outputChatBox( "You need to be in a vehicle to repair it!" , thePlayer, 255, 0, 0, true ) return end local payment = getPlayerMoney ( thePlayer ) if ( payment >= 100 ) then takePlayerMoney( thePlayer, 100 ) fixVehicle( vehicle ) outputChatBox( "You have repaired your car", thePlayer, 255, 0, 0, true ) else outputChatBox( "You don't have enough money to repair your car", thePlayer, 255, 0, 0, true) end end end addEventHandler( "onMarkerHit", root, repairMarker)
-
i think because thePlayer is on vehicle, you can check if type is on player or vehicle with getElementType
-
i just re-installed gta sa and the error disappeared, thanks guys can close this topic
-
crazy, now console is fine, but i try enter in my server and take timed out erro: Version = 1.3.5-release-6367.0.000 Time = Tue Jun 24 22:41:15 2014 Module = C:\Program Files\MTA San Andreas 1.3\mta\multiplayer_sa.dll Code = 0xC0000005 Offset = 0x0000C8D9 EAX=FA56E7E6 EBX=00000000 ECX=05E61BA8 EDX=053389D0 ESI=008622B4 EDI=145CAC54 EBP=145CABB0 ESP=0022F4CC EIP=03EFC8D9 FLG=00210282 CS=001B DS=0023 SS=0023 ES=0023 FS=003B GS=0000
-
so, i am try start my local server and get this error: bind(...) failed: error code - 10048 could not bind the server on interface '' and port "22003"! can help me? thanks!
-
sim é uma das formas