HunT Posted July 8, 2013 Posted July 8, 2013 Prova Adesso 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 ); setPlayerTeam ( plr, teamSurvivor ) 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 ) setPlayerTeam (plr, teamSurvivor ) 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 , 1000 , 1 , source, x, y, z, rot) setCameraTarget ( source, source ) setTimer(checkZombieForNextMap,3000,1) 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 ) -- // Hai eliminato il nextmap della versione originale -.- function checkZombieForNextMap () local theTeam = getTeamFromName ( "Zombies" ) if theTeam then numberPLayers = tonumber( getElementsByType( "player" )) numberZombie = tonumber (getPlayersInTeam ( theTeam )) if numberPLayers == numberZombie then setTimer(StartNextMap,10000,1) -- qui puoi aggiungere un trigger client per far apparire un immagine per il nextmap o il tempo o un testo. end end end function StartNextMap () exports.mapmanager:changeGamemode( getResourceFromName('aa') ) end
☻ᶠᶸᶜᵏᵧₒᵤ☻ Posted July 8, 2013 Author Posted July 8, 2013 Grazie Funziona alla perfezzione. Ora mi fai un altro favore?? come faccio a mettere che mentre si aspettano i 10 secondi per la prossima mappa esce scritto al centro "Zombies Wins" ????
HunT Posted July 8, 2013 Posted July 8, 2013 Se mi fai un immagine è meglio,ad esempio una faccia da zombie cin scritto sotto win. Un po' di immaginazione Solo il testo è patetico.
☻ᶠᶸᶜᵏᵧₒᵤ☻ Posted July 8, 2013 Author Posted July 8, 2013 e va bene. Allora ci metti sia il testo in rosso al centro che ti ho detto prima e anche questa immagine su tutto lo schermo: http://www.google.it/imgres?um=1&sa=N&h ... 148&ty=111 Grazie
☻ᶠᶸᶜᵏᵧₒᵤ☻ Posted July 8, 2013 Author Posted July 8, 2013 va bene, Ma puoi mettere il testo?? Ti prego
☻ᶠᶸᶜᵏᵧₒᵤ☻ Posted July 8, 2013 Author Posted July 8, 2013 C'è l'ho steam, LOOOL mi scoccio di aggiungerti, vabè ti aggiungo ora, mi chiamo franluigi o GHOST, nn mi ricordo Fatto, ti ho aggiunto
HunT Posted July 8, 2013 Posted July 8, 2013 Aggiungi la risorsa come sta : http://www.mediafire.com/download/6uwvl ... lv1/aa.zip Gia testata
☻ᶠᶸᶜᵏᵧₒᵤ☻ Posted July 8, 2013 Author Posted July 8, 2013 Non so se va bene perchè ci sto solo io nel server, domani proviamo. Comunque ho notato che il timer ora è buggato, nel senso che si aspettano sempre 10 secondi, ma invece di uscire scritto prima il : 10 9 8 7 ecc... Esce per esempio : 9 2 6 10 8 ecc... Come mai?? Vabè domani possiamo capire il perchè!
HunT Posted July 9, 2013 Posted July 9, 2013 Vabe è una stupidata quando sono al pc la riparo. Quello che non mi è chiaro e che il player come fa a diventare zombie? La script ha il friendlyFire con il valore false. Cioè,spiegami cosa intendi per humans vd zombie.
☻ᶠᶸᶜᵏᵧₒᵤ☻ Posted July 9, 2013 Author Posted July 9, 2013 dopo fatto sia il timer e sia il fatto che quando tutti gli umani muoiono cambia mappa, vorrei fare che dopo 10 secondi che si è startata la mappa che un numero di giocatori a caso entrano nel gruppo zombies, e vorrei fare anche che se si entra nel server, sempre dopo 10 secondi che è iniziata la partita, si ci spawna nel gruppo zombies
HunT Posted July 9, 2013 Posted July 9, 2013 Ma non è meglio includere la resource zombie in modo che quando tutti gli umani diventato zombie si cambia mappa. Sinceramente la tua idea non credo sia fattibile
☻ᶠᶸᶜᵏᵧₒᵤ☻ Posted July 9, 2013 Author Posted July 9, 2013 nel senso che gli zombies bot fanno diventare gli umani in zombies uccidendoli, e quando nn ci sono più umani si cambia mappa???
HunT Posted July 9, 2013 Posted July 9, 2013 Dopo le 5 sono al pc. Cmq è inutile scrivere ancora su scripting per il next map,l ho risolto il problema.
☻ᶠᶸᶜᵏᵧₒᵤ☻ Posted July 9, 2013 Author Posted July 9, 2013 si? Ma io ho chiesto il next map, nn il next map dopo che nn ci sono più umani
☻ᶠᶸᶜᵏᵧₒᵤ☻ Posted July 9, 2013 Author Posted July 9, 2013 Ah no, scusa, veramente vorrei il countdown di 5 minuti sopra, solo che nn lo trovo da nessuna parte, dico il countdown che stà su Deathmatch. Comunque ho provato lo script che mi hai dato con altri 2 player, funziona.
HunT Posted July 9, 2013 Posted July 9, 2013 Logico che funziona -.- Quello che ho fatto io funziona il problema e che non capisco cosa vuoi fare. Se mi spieghi cosa vuoi aggiungere o fare io te lo posso fare,ma devi essere chiaro sui dettagli. Ora abbiamo che quando muoiono tutti gli umani parte la nuova mappa. Tu vuoi il timer map? Dopo 5 minuti parte automaticamente la nuova mappa?
☻ᶠᶸᶜᵏᵧₒᵤ☻ Posted July 9, 2013 Author Posted July 9, 2013 si, vorrei che esce il timer sopra di 5 minuti che allo scadere del tempo cambia mappa, e esce scritto Humans Wins come per gli zombies.
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