-
Posts
364 -
Joined
-
Last visited
-
Days Won
6
Everything posted by DRW
-
If you don't post the code nobody will be able to help you.
-
The problem is pretty obvious, you didn't set a proper position for the player or you didn't even spawn him. Solve it using spawnPlayer on login. Remember it's serversided.
-
The markers: for i,v in ipairs (Entradas) do local x,y,z = unpack(v) local marker1 = createMarker ( x,y,z, 2.2, "arrow", 2, 255, 255, 0, 200 ) -- setElementInterior ( marker1, 0 ) setElementDimension ( marker1, 0 ) end Also, do NEVER use money-related function clientside. That's why it doesn't works probably. Use takePlayerMoney serverside
-
Chat message only visible to people on a certain team
DRW replied to Captain Cody's topic in Scripting
addCommandHandler ("taxi",function(player) -- player is the source of the server-executed command outputChatBox ( "This is only seen by you", player ) taxidriver = getPlayersInTeam ( TaxiDriverTeam ) for i,drivers in ipairs (taxidriver) do --This gets all the players in the team outputChatBox ( "(source) needs a taxi", drivers) --This outputs to every player in the team end end) I've fused both funcions in the same command. EDIT: Edited the code, it was wrong -
No problem man , ah, also, please add a [sOLVED] tag on the post's title, so it could help other people.
-
Dammit, man, I love the UIKit concept. Really god job there, mate.
-
What do you mean by "owned"? Green Spawner there can spawn your owned vehicle Well, use createMarker to create the "spawner", use the event "onMarkerHit", then createVehicle. But by owned vehicle you mean the vehicle the player is in? Or a bought vehicle?
-
Well, this is a problem since the default water on GTA is divided by sections, with this I mean the water is actually full of "holes", the ground has no actual water under it, because the water is cut there. If you try to raise the water level you'll only make the holes visible and you will immediately set the water to the defaut level. But, you can use setWaterLevel or execute a function on the admin panel. (Just type /start admin and then press P, go to the "resources" tab and look at the "execute" bar, type setWaterLevel (5) and press "server". The water will raise 5 units.). For the second problem, use playSound. PS: You can create a water element with createWater.
-
What do you mean by "owned"?
-
Well, I think so. Using processLineOfSight and setting it properly will return the name of the material you're standing on. It's pretty easy. Just set the returns like this: addEventHandler ("onClientRender",getRootElement(),function() local x,y,z = getElementPosition (localPlayer) hitX, hitY, hitZ, hitElement, normalX, normalY, normalZ, material = processLineOfSight (x,y,z,x,y,z-4,true,false,false,false,false,false,false,false,nil,true) outputChatBox (material) end) This will output to chatbox the material.
-
Sure. guiGetScreenSize dxSetRenderTarget dxDrawImage This should be enough.
-
Have you used fadeCamera?
-
The error is happening because you first check for the trailer and after that you create it. trailer = createVehicle (435, 64.477539, -268.84082, 3, 0, 0, 360) towingVehicle = getVehicleTowedByVehicle ( trailer ) playeraab = getVehicleOccupant ( towingVehicle ) That should do the trick. Oh and also, you should warp a player or ped inside of it before checking out for the occupant. How are you supposed to check for the occupants at the exact moment when the vehicle is created? Use the "OnVehicleEnter" function or some timer. Ex: trailer = createVehicle (435, 64.477539, -268.84082, 3, 0, 0, 360) towingVehicle = getVehicleTowedByVehicle ( trailer ) addEventHandler ("onVehicleEnter",towingVehicle,function() playeraab = getVehicleOccupant ( towingVehicle ) end) Remember that te scripted functions always get executed in the same order: -- RIGHT WAY ped = createPed (0,0,0,5) -- You first create the ped setElementRotation (ped,0,0,60) -- Then you use a function to interact with it -- WRONG WAY setElementRotation (ped,0,0,60) -- You first interact with the ped ped = createPed (0,0,0,5) -- Then you create it
-
This post made me hungry. Also, good one!
-
Sadly as the HUD and radar are GTA hardcoded elements you can't change their position, just their visibility, you should use a new HUD and from there just change their positions. But I advertise you, if you don't know shit about working with auto-adjusting positions then just leave it as it is or else you'll just make it worse. Remember that you should try to make the HUD fit in all resolutions, if you don't, people will see it in a different and maybe annoying position.
-
When a player joins the camera is usually faded to black, so using the fadeCamera function on login or on spawn should do the trick. Also, try to use /debugscript 3 and post what you see.
-
Thank you for trying to help me, but I solved it another way: local x,y,z = getElementPosition(localPlayer) el = createColSphere (x,y,z,100) attachElements (el,localPlayer) addEventHandler ("onClientElementColShapeHit",getRootElement(),function(shape) if shape==el then if getElementType (source)=="player" then blep = createBlipAttachedTo (source,1,1) setElementData(blep,"distblip",true) end end end) addEventHandler ("onClientRender",getRootElement(),function() for i,blips in ipairs (getElementsByType("blip"))do local ix,iy,iz = getElementPosition (blips) local xe,ye,ze = getElementPosition(localPlayer) local dist= getDistanceBetweenPoints3D (xe,ye,ze,ix,iy,iz) if dist>100 then if getElementData (blips,"distblip") then destroyElement (blips) end end end end)
-
Hello, I'm making a script that creates a blip per every ped at a maximum range of 50 units, so I use a table to get all the peds and exclude the ones which don't accomplish the distance that I ask for. So I made this along with onClientRender. for i,peds in ipairs (getElementsByType("ped")) do local x,y,z = getElementPosition(peds) local wx,wy,wz = getElementPosition (localPlayer) if getDistanceBetweenPoints3D (wx,wy,wz,x,y,z)<50 then bl = createBlipAttachedTo (peds,0,1) end end Obviously this is the worst way to do it since onClientRender will create a blip per frame no matter if the ped has a blip attached to it or not. Also, if I define the blip with a name, when I destroy it, all of em get destroyed, I'm still not familiarized with tables and all those things, also I want to do this with players, but since I don't even have someone to test with, I'm doing it with peds. What can I do? PD: Please, don't give me examples of setBlipVisibleDistance because I don't want players to see the attached blips around the F11 map.
-
HELLO EVERYBODY! After six months of hard work, today I'm going to present you my server: EXILE: Zombies mtasa://5.196.0.128:22006 What's EXILE: Zombies? EXILE: Zombies is a zombie-based server created by two friends on 14th April - 2015, it started being a Spanish-talking community, but days ago it became an English-talking one. EXILE: Zombies focuses on a great visual and gameplay experience, combining zombies, wars, and RPG elements to make a perfect variety of ways to play and have fun. Do jobs, kill zombies, buy weapons, vehicles, houses, enhance your weapons and your player's abilities, fight for your clan and its territories, level up, empower your prestige and be the best survivor of San Andreas. Which are the features of EXILE: Zombies? 1. The server has three spawn bases, each one in every city: 2. The server has eight classes available: Medics: They have the ability to heal people with a medkit. Mechanics: They have the ability repair vehicles by using /repair. Dealers: They can sell cheap weapons to the rest of the players. Rescue Team: They get money by transporting people from a zone to another. Assassins: They kill people for money, but if they die, they lose more money than the rewards they receive by killing people. Attackers: They have the ability to attack clan territories. Experts: They have the same abilities as the dealers and the attackers, they also get free weapons (Locked). Military Protectors: This is the VIP class, they have the same abilities as the rest of the classes. 3. The server has a boss in each city: Los Santos' Invisible Kleer: The Invisible Kleer has the ability to become invisible and faster while in combat, but he can only punch, even knowing that, you should be aware of him. Las Venturas' Bio-Mechanoid: The Bio-Mechanoid has the ability to burn you with his cannon, which throws paralyzing fire, which makes you unable to shoot or aim. San Fierro's Corrupt Bomber: The Corrupt Bomber has the ability to create explosions every time he shoots, you'd better be fast or he'll kill you in seconds. 4. You can upgrade your character's weapon stats and abilities: Weapon Upgrades: In each base there is a marker that redirects you to a panel which will let you upgrade each weapon type's stats, every +2 point upgrade costs 2000$. You'll be able to see your upgrade progress. Resistance and stamina upgrades: You can upgrade your character's stamina and resistance at the upgrade panel, upgrading your stamina will let you sprint for more time, upgrading your resistance will increase your maximum health. ZombiePoint enhancements: ZombiePoints (ZP) are used to buy upgrades like progressive health regeneration, progressive armor regeneration, double zombie kill rewards, unlock the Expert class, etc. 5. Skins: We have many skins, every single zombie has a custom model and texture, also, a lot of player and vehicle skins: Some of the vehicle skins: 6. Never get bored: To reach the 100% completion you'll have to spend hundreds and hundreds of hours (Maybe more than a thousand) to complete all the enhancements, levels and prestiges. Levels: The level cap is 55, which means getting 127900 zombie kills. Prestiges: When you reach the level cap, you'll be able to upgrade your Prestige level, which means you'll lose 127900 zombie kills and you'll have a rare reward: Prestige 1: 60 in-game complete hours of Military Protection access. Prestige 2: The Walldetector goggles (Unlimited). Prestige 3: The XHornet double minigun car. Prestige 4: Two more miniguns at each side of the XHornet. Prestige 5: The XHornet will become invincible. The XHornet (Synced particles). 7. Awesome designed UI: EXILE: Zombies has a custom radar and HUD design, also, it has a reasonable optimization because you can switch between the HD and the original designs thanks to /changehud and /changeradar commands. 8. More entertainment: There are other two side activities like the PvPZone and the territory wars. Territory Wars: You can join a clan and fight for it by conquering territories and getting money for it. PvPZone: We have a "Free-For-All" deathmatch side activity where you can place your bets and get (or lose) a lot of money, use /bet to place your bet, or /pvpzone to join the PvPZone. Our Staff We are very strict with our staff selections. You can only get invited, and even if you get invited we'll interview you, if you get accepted after that, you'll be introduced to the Community Manager rank (Moderator apprentice), if you pass the Community Manager period, you'll successfully enter the Staff group. Our Community We currently don't have a custom forum, we are trying to install a Php website to our VPS, but every try leads me to an error, so, for now there is no forum. If you know how to do it and want to help us, please contact me on Skype: DumiReview, or Steam: /id/MadnessReloaded.
-
Hello, I have a problem. I'm using custom weapons with createWeapon, I'm going to explain the problem: First of all, I create a weapon and set an ElementData to this weapon, something like this: weapon1 = createWeapon ("minigun",x,y,z) setElementData(weapon1,"owner",getPlayerName(localPlayer)) then when a weapon kills the ped use this onClientPedWasted: local pyer = getPlayerFromName(getElementData(weapon1,"owner")) setElementData(pyer,"kills",getElementData(pyer,"kills")+1) As you see, the script is ok, but onClientPedWasted only supports player and vehicle elements, what can I do? I've tried using onClientWeaponFire to check if a ped is dead and then setting the "kills" elementData but somehow it adds more kills than 1.
-
Hello, today I'd like to show you one of my first public scripts, it's called PowerMatrix AVC. PowerMatrix: Advanced Vehicle Camera is a resource that lets you use a good-looking vehicle camera position for aesthetic, cinematic or just testing purposes. The main idea of PowerMatrix is to make you feel every single move of your vehicle, adding a nice in-game integration. This resource is in an experimental version, that means it may have some bugs and debug warnings, but the script works pretty well (I've tested it alone on a local server, so I may be wrong). The resource is only client-sided and I've tested it from the 640x480 resolution to the 1366x768 resolution and everything works almost perfectly, higher or lower resolutions might provoke visual bugs and performance problems. Not recommended for public servers since it may be a bit uncomfortable. The script has some annotations inside so new scripters can understand how did I manage to do it. Here you have a video showing PowerMatrix: Download link: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11865
-
Thank you very much!
-
I was clearly not asking for setElementData, just asking how to use math.random to set an elementData to one third part of the total online players.
-
Hello, I'm currently working on a gamemode, but I have a problem, because I need to script something that sets an elementdata to some of the currently online players. Take the Gmod's gamemode "Trouble in Terrorist Town" for example, that gamemode gets all the online and alive players and sets the "traitor" data to a minority portion of the current online players. I know I should use something like getElementsByType or getPlayerCount, and probably math.random, but I know it won't work how it has to work, because it may select randomly two times the same player, and I don't want that. Any help?