☻ᶠᶸᶜᵏᵧₒᵤ☻ Posted July 7, 2013 Share Posted July 7, 2013 Hello, i use a gamemode "aa". How to i put a timer for a the next map?? This is the code of a gamemode : local aa_root = getRootElement() teamSurvivor = createTeam ( "Humans", 0, 255, 0 ) teamZombies = createTeam ( "Zombies", 255, 0, 0 ) function loadmap(startmap, player) mapRoot = getResourceRootElement(startmap) local plrs = getElementsByType( "player" ); for i, plr in pairs( plrs ) do setElementData( plr, "Deaths", 0 ) -- ///////////////// SPAWN \\\\\\\\\\\\\\\\\\\\ local total_spawns = getElementChildrenCount( getElementByID( "spawns" ) ) local num = math.random( 0, total_spawns - 1 ) local spawn_random = getElementChild ( getElementByID( "spawns" ), num ) local x = getElementData ( spawn_random, "posX" ) local y = getElementData ( spawn_random, "posY" ) local z = getElementData ( spawn_random, "posZ" ) local rot = getElementData ( spawn_random, "rot" ) setTimer( setPedSkin , 500 , 1 , plr, math.random(9,288)) spawnPlayer( plr, x, y, z, rot); setCameraTarget ( plr, plr ); fadeCamera( plr, true ); for k,v in ipairs( getElementChildren( getElementByID( "armas" ) ) ) do giveWeapon( plr, tonumber( getElementData( v, "id" ) ), getElementData( v, "ammo" ) ) end end end addEventHandler("onGamemodeMapStart", aa_root, loadmap) function aa_onResourceStart( resourcename, res ) setTeamFriendlyFire(teamSurvivor , false ) if ( resourcename == getThisResource () ) then local plrs = getElementsByType( "player" ); for i, plr in pairs( plrs ) do setElementData( plr, "Deaths", 0 ) end setTimer( call, 1000, 1, getResourceFromName("scoreboard"), "addScoreboardColumn", "Deaths" ) end if resourceName == 'mapmanager' then mapmanager = createResourceCallInterface('mapmanager') end end addEventHandler( "onResourceStart", aa_root, aa_onResourceStart ) function joinHandler() local total_spawns = getElementChildrenCount( getElementByID( "spawns" ) ) local num = math.random( 0, total_spawns - 1 ) local spawn_random = getElementChild ( getElementByID( "spawns" ), num ) local x = getElementData ( spawn_random, "posX" ) local y = getElementData ( spawn_random, "posY" ) local z = getElementData ( spawn_random, "posZ" ) local rot = getElementData ( spawn_random, "rot" ) setElementData( source, "inmarker", false ); setPlayerTeam ( source, teamSurvivor ) spawnPlayer( source, x, y, z, rot ) setTimer( setPedSkin , 500 , 1 , source, math.random(9,288)) outputChatBox("< Welcome To Against All By CHAOS_IS_ME>", source, 255, 138, 0, true) outputChatBox("< Current Version: #00FF00 1.0>", source, 255, 138, 0, true) setCameraTarget ( source, source ) setElementData( source, "Deaths", 0 ) fadeCamera(source, true) for k,v in ipairs( getElementChildren( getElementByID( "armas" ) ) ) do giveWeapon( source, tonumber( getElementData( v, "id" ) ), getElementData( v, "ammo" ) ) end end addEventHandler("onPlayerJoin", aa_root, joinHandler) function aa_playerWasted( totalAmmo, killer ) local playerdeaths = getElementData ( source, "Deaths" ) setElementData ( source, "Deaths", playerdeaths+1 ) local total_spawns = getElementChildrenCount( getElementByID( "spawns" ) ) local num = math.random( 0, total_spawns - 1 ) local skin = math.random(9,288) local spawn_random = getElementChild ( getElementByID( "spawns" ), num ) local x = getElementData ( spawn_random, "posX" ) local y = getElementData ( spawn_random, "posY" ) local z = getElementData ( spawn_random, "posZ" ) local rot = getElementData ( spawn_random, "rot" ) setPlayerTeam ( source, teamZombies ) setTimer( spawnPlayer , 5000 , 1 , source, x, y, z, rot) setCameraTarget ( source, source ) fadeCamera(source, true) --[[ idk what the is dat for k,v in ipairs( getElementChildren( getElementByID( "armas" ) ) ) do setTimer( giveWeapon, 5000 , 1 , source, tonumber( getElementData( v, "id" ) ), getElementData( v, "ammo" ) ) end]] end addEventHandler ( "onPlayerWasted", aa_root, aa_playerWasted ) local localPlayerName = getPlayerName(aa_root) -- ///////////////// Cose aggiunte da me \\\\\\\\\\\\\\\\\\\\ -- ///////////////// Quando un umano muore, entra nel gruppo zombies \\\\\\\\\\\\\\\\\\\\ infection = createPickup (-1, 1, 3.11, 3, 1275, 15000 ) function infected ( thePlayer ) setPlayerTeam ( thePlayer, teamZombies ) setPedSkin ( thePlayer, 13 ) setPedHeadless ( thePlayer, true ) end addEventHandler ( "onPickupUse", infection, infected ) addEventHandler("onPlayerSpawn", root, function() if(getPlayerTeam(source) == teamZombies) then local weaponsToGive = { { id = 4, ammo = 30, setAsCurrent = true }, -- your knife } for _, v in ipairs(weaponsToGive) do giveWeapon(source, v.id, v.ammo, v.setAsCurrent) end setElementModel(source, 137) setPedHeadless ( source, true ) outputChatBox ( "You are now a Zombie.", source, 255, 0, 0 ) end end ) Can you help me?? Link to comment
Lloyd Logan Posted July 8, 2013 Share Posted July 8, 2013 When do you want to trigger the timer? Link to comment
☻ᶠᶸᶜᵏᵧₒᵤ☻ Posted July 8, 2013 Author Share Posted July 8, 2013 As soon as you start the map, there must be above the 10 minute timer Link to comment
Lloyd Logan Posted July 8, 2013 Share Posted July 8, 2013 Just create a timer within a function to start the next map! Link to comment
☻ᶠᶸᶜᵏᵧₒᵤ☻ Posted July 9, 2013 Author Share Posted July 9, 2013 I do not know, do you do it? Please Link to comment
Lloyd Logan Posted July 9, 2013 Share Posted July 9, 2013 I do not know, do you do it?Please We don't accept requests, sorry. If you are new to scripting please check out the TUT on https://wiki.multitheftauto.com/wiki/Scripting_Introduction Link to comment
☻ᶠᶸᶜᵏᵧₒᵤ☻ Posted July 9, 2013 Author Share Posted July 9, 2013 You wrote that you are a free scripter for these things Link to comment
Lloyd Logan Posted July 9, 2013 Share Posted July 9, 2013 You wrote that you are a free scripter for these things Not on the forums. Link to comment
Lloyd Logan Posted July 9, 2013 Share Posted July 9, 2013 and where? Skype, or paid (hired) Link to comment
☻ᶠᶸᶜᵏᵧₒᵤ☻ Posted July 10, 2013 Author Share Posted July 10, 2013 I have skype, my account is : francescoso1 add me Link to comment
Lloyd Logan Posted July 10, 2013 Share Posted July 10, 2013 I have skype, my account is : francescoso1 add me You will have to add me, I will never get around to adding you. Link to comment
☻ᶠᶸᶜᵏᵧₒᵤ☻ Posted July 10, 2013 Author Share Posted July 10, 2013 Where is your nick on skype?? I add you Link to comment
Lloyd Logan Posted July 10, 2013 Share Posted July 10, 2013 Where is your nick on skype?? I add you lloydlogan11 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now