-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Vehicle mod: https://community.multitheftauto.com/index.php?p= ... ls&id=3602
-
how can i make these zombies spawn everywhere ?
Castillo replied to zombienation's topic in Scripting
Can't you just take the experience script code and paste it on the original zombies resource? -
espfont = dxCreateFont("esp.ttf", 14) ...SCRIPT IS HERE... dxDrawText ( getPlayerName(player), sx + 1, sy - offset + 1, sx + 1, sy - offset + 1, tocolor(0,0,0,255), textscale*NAMETAG_TEXTSIZE, espfont, "center", "bottom", false, false, false ) dxDrawColorText( getPlayerNametagText(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, espfont, 'center', 'bottom' ) You don't need the "".
-
how can i make these zombies spawn everywhere ?
Castillo replied to zombienation's topic in Scripting
<settings> <!-- Zombies settings --> <setting name="*MaxZombies" value="[30]" /> <!--maximum allowed zombies --> <setting name="*StreamMethod" value="[2]" /> <!-- 1 to constantly stream zombies, 0 to only allow zombies to spawn via createZombie function, 2 to only allow spawning at set spawnpoints --> <setting name="*Speed" value="[1]" /> <!-- 0 is slowest, 1 is normal, 2 faster --> <setting name="*Reward" value="100" friendlyname="Cash reward" accept="100-1000" desc="How many should every zombie give to players? (this is random, +- 100 cash from this value)" /> </settings> Replace your meta.xml settings with these. -
--FPS local player = getLocalPlayer() local counter = 0 local starttick local currenttick addEventHandler("onClientRender",root, function() if not starttick then starttick = getTickCount() end counter = counter + 1 currenttick = getTickCount() if currenttick - starttick >= 1000 then setElementData(player,"fps",counter) counter = 0 starttick = false end end ) -----------------Spectators local player = getLocalPlayer() local root = getRootElement () local Spectators = {} setElementData ( player, "Spectator", "" ) local scrX, scrY = guiGetScreenSize() ------------------ function start () setTimer ( checkTarget, 1000, 0 ) end addEventHandler ( "onClientResourceStart", getResourceRootElement(), start ) ------------------ function checkTarget ( ) local target = getCameraTarget () local car = getPedOccupiedVehicle ( player ) if not ( car ) then car = "noCar" end if ( target ) then setElementData ( player, "Spectator", target ) else setElementData ( player, "Spectator", "" ) end Spectators = {} for i,v in ipairs( getElementsByType ( "player" ) ) do if ( v ~= player ) then local vTarget = getElementData ( v, "Spectator" ) if ( vTarget == car ) then table.insert(Spectators,v) end end end end ------------------ function dxDrawColorText(str, ax, ay, bx, by, color, scale, font) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) end end function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end g_Root = getRootElement() g_ResRoot = getResourceRootElement(getThisResource()) g_Me = getLocalPlayer() g_ArmedVehicleIDs = table.create({ 425, 447, 520, 430, 464, 432 }, true) g_WaterCraftIDs = table.create({ 539, 460, 417, 447, 472, 473, 493, 595, 484, 430, 453, 452, 446, 454 }, true) g_ModelForPickupType = { nitro = 2221, repair = 2222, vehiclechange = 2223 } g_HunterID = 425 g_NextMap = "Random" g_Checkpoints = {} g_Pickups = {} g_VisiblePickups = {} g_Objects = {} function setNextMap ( mapname ) g_NextMap = mapname end addEvent ( "setNextMap", true ) addEventHandler ( "setNextMap", getRootElement(), setNextMap ) function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end function setNextNil ( dis ) g_NextMap = "Random" end addEvent ( "setNextNil", true ) addEventHandler ( "setNextNil", getRootElement(), setNextNil ) function hudSet () local screenWidth, screenHeight = guiGetScreenSize() dxDrawColorText ('Next: ' .. g_NextMap, 2+1, screenHeight - dxGetFontHeight(0.7, 'bankgothic')/2+1, 100+1, 100+1, tocolor ( 0, 0, 0, 255 ), 0.3, 'bankgothic', 0.3, 'left') dxDrawColorText ('#FF7300Next: #FFFFFF' .. g_NextMap, 2, screenHeight - dxGetFontHeight(0.7, 'bankgothic')/2, 100, 100, tocolor ( 255, 255, 255, 255 ), 0.3, 'bankgothic', 0.6, 'left') if (g_MapInfo) then dxDrawColorText ('Map: ' .. g_MapInfo.name, 2+1, screenHeight - dxGetFontHeight(1.2, 'bankgothic')/2+1, 100+1, 100+1, tocolor ( 0, 0, 0, 255 ), 0.3, 'bankgothic', 0.6, 'left') dxDrawColorText ('#FF7300Map: #FFFFFF' .. g_MapInfo.name, 2, screenHeight - dxGetFontHeight(1.1, 'bankgothic')/2, 100, 100, tocolor ( 255, 255, 255, 255 ), 0.3, 'bankgothic', 0.6, 'left') else dxDrawColorText ('Map: N/A', 1.8, screenHeight - dxGetFontHeight(1.2, 'bankgothic')/2.1, 100, 100, tocolor ( 0, 0, 0, 255 ), 0.6, 'bankgothic', 0.3, 'left') dxDrawColorText ('#FF7300Map: #FFFFFFRandom', 2+1, screenHeight - dxGetFontHeight(1.2, 'bankgothic')/2+1, 100+1, 100+1, tocolor ( 255, 255, 255, 255 ), 0.3, 'bankgothic', 0.6, 'left') end dxDrawColorText ('#FF7300Spectators: (#FFFFFF' .. #Spectators .. '#FF7300)', 1.6, screenHeight - dxGetFontHeight(1.6, 'bankgothic')/2+1, 100+1, 100+1, tocolor ( 255, 255, 255, 255 ), 0.3, 'bankgothic', 0.3, 'left') if getElementData(getLocalPlayer(),"fps") then dxDrawColorText ('#7FFF00FPS: #FFFFFF' .. getElementData(getLocalPlayer(),"fps"), 2, screenHeight - dxGetFontHeight(3.00, 'bankgothic')/2, 100, 100, tocolor ( 255, 255, 255, 255 ), 0.55, 'bankgothic', 0.55, 'left') else dxDrawColorText ('#7FFF00FPS: #FFFFFF??', 2, screenHeight - dxGetFontHeight(3.00, 'bankgothic')/2, 100, 100, tocolor ( 255, 255, 255, 255 ), 0.55, 'bankgothic', 0.55, 'left') end end To remove scoreboard columns, go to "race/race_server.lua" and search for "addScoreboardColumn", you can either remove the lines or comment them out by putting "--" in front of them.
-
I have abused my powers? how? mind showing proof? also, what would I gain abusing them? I don't get paid by locking topics, do I?
-
Well, if you get a error then why do you ask us to find it? can't you post the error you're getting so we can help you fix it?
-
how can i make these zombies spawn everywhere ?
Castillo replied to zombienation's topic in Scripting
It's easy to change the streaming method: Open up "meta.xml" and search for the setting "StreamMethod", change it to one of these options: -
Yeah, but can't be like re-scripted by a program on SCM/CLEO.
-
how can i make these zombies spawn everywhere ?
Castillo replied to zombienation's topic in Scripting
Mind showing me the game mode link? -
how can i make these zombies spawn everywhere ?
Castillo replied to zombienation's topic in Scripting
What do you mean by "I found it"? you stole it from client side downloaded resources? -
You mean the "Freeroam" menu? if so, then no, it's a MTA script.
-
Good job, keep up the good work!
-
You can either learn from that script or you can check this out: https://community.multitheftauto.com/index.php?p= ... ls&id=3090 That resource is used to create 3D text's, you can study how it's scripted.
-
You're welcome .
-
--------------------------------------------------------------------------------- -- -- Nitro shader -- -- --------------------------------------------------------------------------------- addEventHandler("onClientResourceStart",resourceRoot, function() nitroShader = dxCreateShader("nitro.fx") setTimer(updateNitroColor,1000,1,255,0,0) end) -- This function will set the new color of the nitro function updateNitroColor(r,g,b) if nitroShader then if r and g and b then engineApplyShaderToWorldTexture (nitroShader,"smoke") dxSetShaderValue (nitroShader, "gNitroColor", r/255, g/0, b/0 ) end end end -- This function will reset the nitro back to the original function resetNitroColor() if nitroShader then engineRemoveShaderFromWorldTexture(nitroShader,"smoke") end end -- Example command use addCommandHandler("nitro", function(command,r,g,b) if r and g and b then local r,g,b = tonumber(r),tonumber(g),tonumber(b) if r <= 255 and g <= 255 and b <= 255 then updateNitroColor(r,g,b) outputChatBox("Nitro color updated!",255,255,255,true) else outputChatBox("Colors must be between 0 and 255",255,255,255,true) end else resetNitroColor() outputChatBox("Nitro color reset to original!",255,255,255,true) end end)
-
Yo lo haria server side. P.D: No entiendo, despues de cargar la posicion no podes usar los pickups?
-
I'm pretty sure they're part of the interior itself.
-
Do you have scripting knowledge to achieve this? You'll need: -- client side. guiCreateWindow guiCreateGridList guiCreateButton addEvent addEventHandler onClientGUIClick -- server side: A table to store the vehicles. createMarker createVehicle warpPedIntoVehicle onMarkerHit
-
Cuando el vehiculo de un jugador se destruye en race, el game mode se da cuenta y deja de funcionar. local savedPosition = {} function getstuff (playerSource) local vehicle = getPedOccupiedVehicle (playerSource) --obtener el vehiculo actual del jugador if (vehicle) then --si se obtuvo un vehicle valido entonces... local px,py,pz = getElementPosition (vehicle) local rx,ry,rz = getElementRotation (vehicle) local vx,vy,vz = getElementVelocity (vehicle) local model = getElementModel (vehicle) --obtener posicion, rotacion, velocidad y modelo de vehiculo -- avisarle al jugador que cosas se guardaron savedPosition[playerSource] = {px, py, pz, rx, ry, rz, vx, vy, vz, model} outputChatBox ('Model:#AAAAAA '.. model ..'', playerSource, 255, 0, 0, true) outputChatBox ('Position:#AAAAAA '.. px .. ', '.. py .. ', '.. pz .. '', playerSource, 255, 0, 0, true) outputChatBox ('Rotation:#AAAAAA '.. rx .. ', '.. ry .. ', '.. rz .. '', playerSource, 255, 0, 0, true) outputChatBox ('Velocity:#AAAAAA '.. vx .. ', '.. vy .. ', '.. vz .. '', playerSource, 255, 0, 0, true) else --pero si no, avisar. outputChatBox ("You're not in a vehicle!", playerSource, 255, 0, 0, true) end end function teleporter (playerSource) local px, py, pz, rx, ry, rz, vx, vy, vz, model = unpack(savedPosition[playerSource]) local vehicle = getPedOccupiedVehicle(playerSource) if (not vehicle) then return end setElementPosition(vehicle, px, py, pz) setElementRotation(vehicle, rx, ry, rz) setElementModel(vehicle, model) setElementVelocity (vehicle,vx,vy,vz) --poner la velocidad guardada end -- agregar los comandos addCommandHandler ("savepos", getstuff) addCommandHandler ("loadpos", teleporter) Eso deberia guardar los datos en una tabla y luego cargarlos de la misma y cambiar los datos del vehiculo.
-
It's caused by the new MTA version I guess.
-
That's not what he asked for. button = guiCreateButton(100, 100, 50, 50, "Click me!", false) addEventHandler("onClientGUIClick",button, function () showCursor(not isCursorShowing()) end,false) Then for click object, you have two options: One: this one is client side only. https://wiki.multitheftauto.com/wiki/OnClientClick Two: this one is server side only. https://wiki.multitheftauto.com/wiki/OnElementClicked
-
The second argument of addCommandHandler server-side it's the commandName. function adminCMD( player, commandName, otherplayer, level ) if getElementData( player, "pptts.canusemakeadmin" ) then -- the shared logic local otherplayer = findPlayer( otherplayer ) if otherplayer then local serial = getPlayerSerial( otherplayer ) local thegroup = aclGetGroup( getElementData( otherplayer, "pptts.acl" ) ) --local otherplayername = getPlayerName( otherplayer ) local playername = getPlayerName( player ) if level == "Nichts" then aclGroupRemoveObject ( thegroup, "user." ..serial ) removeAccount( serial ) outputChatBox( playername.. "hat dir deine Rechte entzogen!", otherplayer ) outputChatBox( "Du hast" ..otherplayername "die Rechte entzogen!",player ) elseif level == "Member" then aclGroupRemoveObject ( thegroup, "user." ..serial ) removeAccount( serial ) addAccount( serial, "l0l7h15p455w0rd15uncr4ck4bl3" ) setElementData( otherplayer, "pptts.acl", "Member") aclGroupAddObject( aclGetGroup("Member"), "user."..otherplayername ) outputChatBox( playername.. "hat dich zum Member gemacht!", otherplayer ) outputChatBox( "Du hast" ..otherplayername "zum Member gemacht!",player ) elseif level == "Moderator" then aclGroupRemoveObject ( thegroup, "user." ..serial ) removeAccount( serial ) addAccount( serial, "l0l7h15p455w0rd15uncr4ck4bl3" ) setElementData( otherplayer, "pptts.acl", "Moderator") aclGroupAddObject( aclGetGroup("Moderator"), "user."..otherplayername ) outputChatBox( playername.. "hat dich zum Moderator gemacht!", otherplayer ) outputChatBox( "Du hast" ..otherplayername "zum Moderator gemacht!",player ) elseif level == "Admin" then aclGroupRemoveObject ( thegroup, "user." ..serial ) removeAccount( serial ) addAccount( serial, "l0l7h15p455w0rd15uncr4ck4bl3" ) setElementData(otherplayer, "pptts.acl", "Admin") aclGroupAddObject( aclGetGroup("Admin"), "user."..otherplayername ) outputChatBox( playername.. "hat dich zum Admin gemacht!", otherplayer ) outputChatBox( "Du hast" ..otherplayername "zum Admin gemacht!",player ) elseif level == "VIP" then aclGroupRemoveObject ( thegroup, "user." ..serial ) removeAccount( serial ) addAccount( serial, "l0l7h15p455w0rd15uncr4ck4bl3" ) setElementData( otherplayer, "pptts.acl", "VIP" ) aclGroupAddObject( aclGetGroup("VIP"), "user."..otherplayername ) outputChatBox( playername.. "hat dich zum VIP gemacht!", otherplayer ) outputChatBox( "Du hast" ..otherplayername "zum VIP gemacht!",player ) else outputChatBox( "NUTZUNG: /makeadmin [spieler] [Nichts/Member/Moderator/Admin/VIP]", player ) end else outputChatBox( "NUTZUNG: /makeadmin [spieler] [Nichts/Member/Moderator/Admin/VIP]", player ) end end end addCommandHandler( "makeadmin", adminCMD )
