Price. Posted November 1, 2013 Share Posted November 1, 2013 (edited) Delete Please. Edited November 3, 2013 by Guest Link to comment
Castillo Posted November 1, 2013 Share Posted November 1, 2013 You are doing it vice-versa, instead of enabling god mode, you are disabling it, and instead of disabling, you are enabling it. Link to comment
Price. Posted November 1, 2013 Author Share Posted November 1, 2013 will you please fix it for me? Link to comment
Castillo Posted November 1, 2013 Share Posted November 1, 2013 All you have to do is change "true" to "false" and "false" to "true" at setElementData. Link to comment
Price. Posted November 1, 2013 Author Share Posted November 1, 2013 well i did that , then it tells me whenever i do /staff GodMode Disabled or Enabled when i do /staff again says same text Link to comment
Price. Posted November 1, 2013 Author Share Posted November 1, 2013 where i typed GodMode Enabled, if i made it true and the other false the other chatbox when it says GodMode Disabled will keep getting repeated, ex: /staff "GodMode Disabled", /staff "GodModeDisabled" , /staff "GodMode Disabled" doesnt say except 1 chatbox if i reversed it. Link to comment
Castillo Posted November 1, 2013 Share Posted November 1, 2013 You mean that it's writing "enabled" and "disabled" at the same time? Link to comment
Price. Posted November 1, 2013 Author Share Posted November 1, 2013 uhm no keeps saying same text wether if it said 1Enabled , it will keep saying Enabled all the time i do /staff Link to comment
Castillo Posted November 1, 2013 Share Posted November 1, 2013 team = createTeam ( "Staff", 255, 255, 255 ) function teamSet ( thePlayer ) local team = getTeamFromName ( "Staff" ) local account = getPlayerAccount ( thePlayer ) if ( not account or isGuestAccount ( account ) ) then return end local accountName = getAccountName(account ) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "L5" ) ) ) then if ( not getElementData ( thePlayer, "invincible" ) ) then setElementData ( thePlayer, "invincible", true ) setElementModel ( thePlayer, 217 ) setPlayerTeam ( thePlayer, team ) setPlayerNametagColor ( thePlayer, 255, 255, 255 ) outputChatBox ( "#00FF00GodMode Enabled", thePlayer, 0, 255, 0, true ) else outputChatBox ( "#FF0000GodMode Disabled", thePlayer, 255, 0, 0, true ) setElementData ( thePlayer, "invincible", false ) end end end addEvent ( "sTeame", true ) addEventHandler ( "sTeame", root, teamSet ) addCommandHandler ( "staff", teamSet ) Link to comment
Price. Posted November 1, 2013 Author Share Posted November 1, 2013 this what gives me when i do /staff PS: godmode or setteam not working nothing is working atm. Link to comment
Castillo Posted November 1, 2013 Share Posted November 1, 2013 That means is never setting the element data back to "false", I don't see why shouldn't it do it. Link to comment
Price. Posted November 1, 2013 Author Share Posted November 1, 2013 well let's forget about the chatbox, let's do when i do /staff it gets me to team and starts godmode normally might this work? from 1st time. team = createTeam ( "Staff", 255, 255, 255 ) function teamSet ( thePlayer ) local team = getTeamFromName ( "Staff" ) local account = getPlayerAccount ( thePlayer ) if ( not account or isGuestAccount ( account ) ) then return end local accountName = getAccountName(account ) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "L5" ) ) ) then if getElementData ( thePlayer, "invincible" ) then setElementData ( thePlayer, "invincible", false) setElementModel ( thePlayer, 217 ) setPlayerTeam ( thePlayer, team ) setPlayerNametagColor ( thePlayer, 255, 255, 255 ) else setElementData ( thePlayer, "invincible", true) end end end addEvent ( "sTeame", true ) addEventHandler ( "sTeame", root, teamSet ) addCommandHandler ( "staff", teamSet ) Link to comment
Castillo Posted November 1, 2013 Share Posted November 1, 2013 The chat box message ain't the problem. Link to comment
Price. Posted November 1, 2013 Author Share Posted November 1, 2013 well is there a better code to do it? Link to comment
Castillo Posted November 1, 2013 Share Posted November 1, 2013 Found the problem, copy my code again. Link to comment
Price. Posted November 3, 2013 Author Share Posted November 3, 2013 i've tried something else worked without chatbox, but your code is so much better thanks! 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