Jump to content

Ace_Gambit

Members
  • Posts

    569
  • Joined

  • Last visited

Everything posted by Ace_Gambit

  1. Don't do it man. He's going to sell the blueprints to the Russians!
  2. I am not sure but I couldn't find any Json function that works on the client side (only server sided). It would be nice if you could use Json to send a Json string object from the server and re-create the object on the client side.
  3. I think what you are looking for is something called regular expressions or pattern matching. Lua has a few functions for pattern matching but I never tried them myself. You'll have to experiment with string.find, string.gfind and string.gsub.
  4. There's not better way than to learn it yourself: http://development.mtasa.com/index.php? ... troduction Good luck!
  5. Did you try GTA Map Viewer? Anyway, try #18319...
  6. 1) No, lua is not the same as C++. It does share common keywords and control structure like C++ has, but the syntax is different in a lot of ways. See here for more info: http://lua-users.org/wiki/TutorialDirectory. 2) Well, client-sided scripts run on the clients’ computer while server-sided scripts run solely on the remote server. It’s pretty much like server/client-side programming for the web. You code programming logic on the server-side and front-end functionality on the client-side. 3) Yes, you can redistribute your scripts. 4) Yes, see 3
  7. I already tried both your suggestions. But it seems like whenever I enable fixed camera mode I can't move the thing with setCameraPosition anymore. The camera automatically snaps to 0,0,0 every time I change to fixed mode. And it stays there no matter what values I use for setCameraPosition. -edit- The camera is moving now...let's try something different... -edit- Never mind. I hereby admit that I am a ******* idiot. I should have used setCameraPosition ( float x, float y, float z ) for the client-side instead of setCameraPosition ( player thePlayer, float x, float y, float z ) . Problem solved.
  8. Some how I can't make the camera work like I want it. Whatever values I use for setCameraPosition, setCameraTarget and setCameraLookAt none of those give the right effect. In fact I haven't managed to move the camera to a fixed position other than somewhere at 0,0,0. No matter what values I use for setCameraPosition it always ends up at 0,0,0. Look at this code snippet for example. When simple fixed camera placement failed I tried to make a hawkview function. meta.xml <meta> <info author="" description="" name="" version="1.0" type="gamemode" /> <script src="test.lua" type="server" /> <script src="test_cli.lua" type="client" /> <map src="test.map" /> </meta> test.map <map mod="deathmatch" version="1.0" time="06:00"> <spawn posX="0" posY="0" posZ="4.0" rot="90" randx="0" randy="0" randz="0" /> <pickup id="2" posX="0" posY="0" posZ="4.0" type="38" respawn="500" amount="6000" /> <object name="platform" id="3" posX="0" posY="0" posZ="2.0" rotX="0.0000" rotY="0.0000" rotZ="0.0000" model="17559" /> </map> test.lua function spawn() if (spawnPlayer(source, 0, 0, 4.0)) then fadeCamera(source, true, 5.0) setCameraMode(source, "fixed") createBlipAttachedTo(source, 0, 2, 0, 255, 0) end end addEventHandler("onPlayerJoin", getRootElement(), spawn) test_cli.lua function hawkview() local x, y, z = getElementPosition(getLocalPlayer()) setCameraPosition(getLocalPlayer(), x, y, z + 50) setCameraTarget(getLocalPlayer()) end addCommandHandler("hawkview", hawkview) But when I test the mode and go to hawkview the camera simply goes back to chase mode .
  9. Maybe because lua is case-sensative? Try "addEventHandler" instead of "AddEventHandler". But this is just a wild guess...
  10. Search for math.sin and you'll find the answer. Someone already posted a code-snippet for spawning objects with the sin/cos function. And it doesn't require any mathematical knowledge to understand it.
  11. The parameters passed by onColShapeHit are hitElement and matchingDimension. So my best guess is that would want to give money to hitElement instead. function Money( hitElement, matchingDimension) givePlayerMoney( hitElement, 10000 ) end
  12. Ace_Gambit

    radararea brokes

    I've had similar problems with large radar areas. Small areas work fine for me too.
  13. That's not going to work for my map because the playable area is around 2000 units in size and it has to be at ground level. When I move it so that the pickup models show it is already merged into the SA default map. I can't get any closer to the origin than 4000 units. Maybe this thread should be moved to the Bugs section. Because clearly I'm not the only one who has this issue and I think it is not supposed to happen.
  14. Maybe it's just my pc but when I create a pickup item too far off of the SA world origin (0, 0, 0) it won't show. The pickup item itself seems to be working fine. When you walk over the spot it gives you the right weapon. But you don't see the actual weapon model. I did some testing and it wasn't because of the object limit. I created a new map with only three objects (player spawn, platform and a pickup item). When within the area of approximately 3000 units off of the origin the weapon model shows fine. However, when I move the entire setting to 7000 units over the x-axis the weapon model refuses to render. What gives? I can't really move my setting within those 3000 units of the origin because of the massive size of my map (it would overlap with SA default world objects). edit: As an illustration I've attached a test gamemode. You can put it in your "server/mods/deathmatch/resources/" folder and run it with the "changemode" command. Once connected you can change the players position by typing "tele" in the console (for example: "tele 100 100 10" to teleport all elements to x 100, y 100 and z 10). link: http://rapidshare.com/files/91462991/test.zip.html
  15. Just like Wurst says. Just spread your objects over a larger area. My DM map has over 1000 objects and it's showing up fine. Also keep in mind that dynamic objects (like exploding barrels) are most likely going to cause problems when used in large numbers and high density. Even if you didn't hit the 256 object limit!
  16. The drugged effect is definitely a good idea...especially for scripted mini-missions to give some extra dimension to the game play.
  17. As far as I know you can't manually set car colors in MTA's mapping tool (I could be wrong though).
  18. Nice feature, although the damage radius of the blast in de video doesn't look very realistic . But I am sure you can adjust this with some extra parameters.
  19. I have some critical (side) notes. 1) The start grid leading to the first cp's is really tight 2) The cp placement does not allow for great manoeuvrability with all player slots taken 3) The first cp is probably going to cause one big cluster fuck 4) There is no repair point in case the cars crash (and they will) into each other at the start of the race 5) The weather is not optimal for the starting vehicle (spins out of control very fast) 6) In addition to 3, 4 and 5: the car is extremely vulnerable to damage
  20. #16613 You can use GTA Map Viewer to get object ID's.
  21. Now all we need is a terrorist player model .
  22. Erm, why not? Just multiply the amount of damage by n depending on the body part. If you don't understand what I mean then take a look at the KotH scripting tutorial and scroll down to the kothDamage function.
  23. I'm pretty sure there is since you can move object along scripted paths.
  24. Yes, you can not only see who attacked who but also what weapon the attacker used and what body parts are damaged by how many hit points.
×
×
  • Create New...