DNL291 Posted March 8, 2015 Posted March 8, 2015 local times = { "galocura","mafiaAzul","manchaVerde","indepedentes", "bamor","jovemDoSport","timao","infernoCoral" } local spawns = { ['galocura'] = {2796.26221, -1549.00061, 10.92188}, ['mafiaAzul'] = {1771.10596, -1918.38660, 13.55547}, ['manchaVerde'] = {2229.45337 ,-1170.96741,25.74169}, ['bamor'] = {2164.83105, -1812.68726 ,13.54688}, ['timao'] = {251.76923, -1219.97644, 76.10237}, ['infernoCoral'] = {2492.45874, -1687.13342, 13.51327}, ['jovemDoSport']= {1175.20032, -1648.91272, 14.00494} , ['indepedentes']= {1175.20032, -1648.91272, 14.00494}, } function criarTimes() for i= 1 , #times do createTeam(times[i],0,0,0) end end addEventHandler("onResourceStart", resourceRoot, criarTimes) function mudarTimes(player,cmd,teamName) local teams = ( type(teamName) == "string" and getTeamFromName(teamName) ) or false if (teams) then setPlayerTeam(player,teams) outputChatBox("Bem Vindo a Essa Torcida Organizada .", player) else outputChatBox("time nao encontrado,ou sou um noob que errou o script.", player) end end addCommandHandler("entrar",mudarTimes) function spanwnPlayer() local team = getPlayerTeam(source) if team then local x,y,z = unpack( spawns[ getTeamName(team) ] ) spawnPlayer(source, x,y,z) else spawnPlayer(source, 0,0,0) end end addEventHandler ( "onPlayerWasted", getRootElement(), spawns) Tente isso.
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