Jump to content

szlend

Members
  • Posts

    58
  • Joined

  • Last visited

Everything posted by szlend

  1. szlend

    Hay

    Just replace the hamburger pickup with a grenade pickup and make it trigger a 1min timer that will restart the map. http://development.mtasa.com/index.php? ... eatePickup http://development.mtasa.com/index.php?title=SetTimer
  2. In your function you have "commandName" which is never used. Assuming that you type "/lg user pass" in the chatbox, that will set: commandName = user, ac = pass, leaving "ps" empty. Try removing commandName from your function Edit: Nevermind, commandName is the name of the command my bad
  3. You bought a PC 2 weeks ago, but that doesn't mean it's good Post some hardware info
  4. szlend

    Disappearing player

    Yep, I can confirm this. I noticed it while aiming with a tec9
  5. szlend

    Wrong script

    Try this function startMap(startedMap) local mapRoot = getResourceRootElement(startedMap) local players = getElementsByType("player") local spawns = getElementsByType("spawnpoint") for key, player in pairs(players) do local spawn = spawns[math.random(1, #spawns)] local posX = getElementData(spawn, "posX") local posY = getElementData(spawn, "posY") local posZ = getElementData(spawn, "posZ") local angle = getElementData(spawn, "angle") spawnPlayer(player, posX, posY, posZ, angle) fadeCamera (player, false, 1.0, 0, 0, 0 ) end end addEventHandler ( "onGamemodeMapStart", getRootElement(), startMap ) Edit: bah eAi was faster
  6. 2. Justed tested and it works fine without it. Thanks for the info
  7. 1. Ah, thank you . Works fine now. Knew I forgot something basic 2. Isn't mapRoot needed to get the map elements like spawnpoints, flags, objects, etc.? 3. I did that just to see if it works. It wont stay like that since my gamemode will have rounds anyways.
  8. I'm working on a gamemode and have problems making a player spawn on spawnpoints defined by the map. My code is: function startMap(startedMap) local mapRoot = getResourceRootElement(startedMap) local spawns = getElementsByType("spawnpoint", mapRoot) local players = getElementsByType("player") for key, player in pairs(players) do local spawn = spawns[key] -- should get spawnpoint 1 for player 1 local posX = getElementData(spawn, "posX") local posY = getElementData(spawn, "posY") local posZ = getElementData(spawn, "posZ") local angle = getElementData(spawn, "angle") spawnPlayer(player, posX, posY, posZ, angle) outputChatBox(key) end end addEventHandler("onGamemodeMapStart", getRootElement(), startMap) <meta> <info author="Siyo" name="Spawn test" version="0.1" description="Spawn test" type="gamemode"/> <script src="spawn.lua" /> </meta> and the map <map> <spawnpoint posX="2495.1257324219" posY="-1686.6124267578" posZ="13.513834953308" angle="3.4530944824219"/> <spawnpoint posX="2519.9204101563" posY="-1678.9359130859" posZ="14.879755020142" angle="91.500610351563"/> <spawnpoint posX="2509.6416015625" posY="-1654.0524902344" posZ="13.655654907227" angle="135.68103027344"/> <spawnpoint posX="2487.0036621094" posY="-1647.6352539063" posZ="14.0703125" angle="181.4281463623"/> <spawnpoint posX="2471.869140625" posY="-1686.2700195313" posZ="13.5078125" angle="325.85275268555"/> <spawnpoint posX="2469.6413574219" posY="-1650.4163818359" posZ="13.471806526184" angle="183.62147521973"/> <spawnpoint posX="2452.4020996094" posY="-1646.6909179688" posZ="13.468873977661" angle="178.92138671875"/> </map> <meta> <info author="Siyo" version="0.1" type="map" description="spawning" gamemodes="spawn"/> <map src="sp_test.map" /> </meta> I have no idea, what I'm doing wrong. I'm sure that "startMap" function is called and I don't see any warnings or errors with "debugscript 3" either. The screen just stays black and says the map loaded fine. Some help would really be appreciated. PS. Sorry for my bad english ;D
×
×
  • Create New...