Moderators IIYAMA Posted November 19, 2012 Moderators Share Posted November 19, 2012 Hello guys, I got a very strange bug. In the gamemode there is: team1 = createTeam("RED",255,0,0)--red team2 = createTeam("BLUE",0,0,255)--blue When I check this player his team I get this: TeamRED Team2 I get 2 team instead of 1. How can I splits or fix this? Because I can do nothing with this data. Link to comment
KraZ Posted November 19, 2012 Share Posted November 19, 2012 This is all you have? Can you post abit more of the script if you can? Link to comment
Moderators IIYAMA Posted November 19, 2012 Author Moderators Share Posted November 19, 2012 Well it is just the gamemode stealth you got on your pc, but if you seriously want it. function teamstealthgamestart() killmessageRes = getResourceFromName"killmessages" call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Score") call(getResourceFromName("scoreboard"), "addScoreboardColumn", "kills") call(getResourceFromName("scoreboard"), "addScoreboardColumn", "deaths") playingaround = 0 redwinsdisplay = textCreateDisplay() local redtext = textCreateTextItem ( "RED Team Wins the Match!", 0.5, 0.5, "low", 255, 0, 0, 255, 3, "center", "center" ) textDisplayAddText ( redwinsdisplay, redtext ) bluewinsdisplay = textCreateDisplay() local bluetext = textCreateTextItem ( "BLUE Team Wins the Match!", 0.5, 0.5, "low", 0, 0, 255, 255, 3, "center", "center" ) textDisplayAddText ( bluewinsdisplay, bluetext ) tiegamedisplay = textCreateDisplay() local tietext = textCreateTextItem ( "The Match was a Tie!", 0.5, 0.5, "low", 255, 255, 255, 255, 3, "center", "center" ) textDisplayAddText ( tiegamedisplay, tietext ) waitDisplay = textCreateDisplay() local waittext = textCreateTextItem ( "Wait for next round to spawn.", 0.5, 0.9, "low", 255, 255, 255, 255, 1.6, "center", "center" ) textDisplayAddText ( waitDisplay, waittext ) team1 = createTeam("RED",255,0,0)--red team2 = createTeam("BLUE",0,0,255)--blue teamprotect = get("stealth.teamdamage") if teamprotect == 1 then setTeamFriendlyFire( team1, false ) setTeamFriendlyFire( team2, false ) elseif teamprotect == 0 then setTeamFriendlyFire( team1, true ) setTeamFriendlyFire( team2, true ) end setElementData ( team1, "Score", 0 ) setElementData ( team2, "Score", 0 ) local players = getElementsByType("player") for k,v in ipairs(players) do player = v aTablePlayer[player]={}; aTablePlayer[player]["shieldup"] = false killPed(v) fadeCamera(v,true) thisplayer = v --setTimer(triggerClientEvent,2000,1,v,"swaptoggle",getRootElement(), thisplayer, teamswap) setElementData ( v, "kills", 0 ) setElementData ( v, "deaths", 0 ) setPlayerNametagShowing ( v, false ) spectators[v] = true bindKey ( v, "F3", "down", selectTeamKey ) end --Enable laser sight setElementData(getRootElement(),"lasersight",get("stealth.lasersight")) end addEventHandler( "onGamemodeStart", resourceRoot, teamstealthgamestart ) Welcome to the old codes of stealth. see line 18 function spectateNext (source) -- THIS IS THE FUNCTION USED TO SWICH WHO IS BEING SPECTATED BY PRESSING R if playingaround == 1 then -- IF A ROUND IS IN PROGRESS --if getElementHealth(source)<1 then if ( isPedDead ( source ) ) then --IF THE PLAYER IS DEAD local specPlayer = getPlayerSpectatee[source] -- gets the spectatee player if not specPlayer then specPlayer = 1 spectators[source] = true bindKey ( source, "r", "down", spectateNext ) end local deadplayerTeam = getPlayerTeam(source)--local --local deadplayerTeam2 = getTeamFromName ( deadplayerTeam ) local deadplayerTeam2 = getTeamName ( deadplayerTeam ) if source then-- my checks outputChatBox ("source does exist") end if deadplayerTeam then-- my checks outputChatBox ( deadplayerTeam2)--output > TeamRED and Team1-----------------------< this end local playersTable = getPlayersInTeam ( deadplayerTeam )--local end playersTable = filterPlayersTable ( playersTable ) -- local playerCount = #playersTable if playerCount == 0 then outputSpectateMessage("Nobody to Spectate",source) -- IF ITS JUST THE 1 PLAYER, SPECTATING IS IMPOSSIBLE else specPlayer = specPlayer+1 outputChatBox( playersTable .. " " .. specPlayer) if playersTable[specPlayer] then while isPedDead ( playersTable[specPlayer] ) do --while getElementHealth(playersTable[specPlayer])<1 do specPlayer = specPlayer+1 end end if specPlayer > playerCount then specPlayer = 1 end --setCameraMode ( source, "player" ) setCameraTarget ( source, playersTable[specPlayer] ) outputSpectateMessage("Now spectating "..getPlayerName(playersTable[specPlayer]),source) getPlayerSpectatee[source] = specPlayer end end end end I have tryed this for a long time and I just getting creazy..... and now I know why 1 team = (2 teams) SO THE DATA I GET WITH local deadplayerTeam = getPlayerTeam(source) IS USELESS 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