hardcorex9 Posted September 3, 2012 Author Share Posted September 3, 2012 is there a script you guys could tell me that can make it so, when you create a account and then login to the game your account is already admin, if someone can that would be cool.regardshardcorex9 Link to comment Share on other sites More sharing options...
MCADAMS Posted September 3, 2012 Share Posted September 3, 2012 I can't see how this would be practical in anyway…just saying. Link to comment Share on other sites More sharing options...
tslusny Posted September 3, 2012 Share Posted September 3, 2012 > I can't see how this would be practical in anyway…just saying.True story bro ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png) Link to comment Share on other sites More sharing options...
hardcorex9 Posted September 3, 2012 Author Share Posted September 3, 2012 well i need a script for such thing because im making a game that kind of needs the player to be admin straight away or i could just say they have to do it there self.regardshardcorex9 Link to comment Share on other sites More sharing options...
TheLordOfTheManor Posted September 4, 2012 Share Posted September 4, 2012 > well i need a script for such thing because im making a game that kind of needs the player to be admin straight away or i could just say they have to do it there self.> > regards> > hardcorex9Then any player can wreck your game with a couple of clicks? Link to comment Share on other sites More sharing options...
hardcorex9 Posted September 4, 2012 Author Share Posted September 4, 2012 not really what i have done is mostly edit the admin panel more into a creative mode thing, but i mostly made the game more as a single player point atm, just asking for a script to make a player auto admin because when i get to a point when people can start hosting there own servers to play with mates they can send there profile or just make a new account, so the whole point is that when i get the script to make the player auto admin, what i have done with it its making them be like in creative mode (like minecraft but different) so they can make a custom map if they want and show others or just play the game normally with friends. Link to comment Share on other sites More sharing options...
Joyce Posted September 4, 2012 Share Posted September 4, 2012 The easiest way would be to just use SetPlayerAccess(Index, Value), where Value is the rank you want to give them(see ModConstants for the appropriate ranks) upon registration. Link to comment Share on other sites More sharing options...
Boynaar44 Posted September 4, 2012 Share Posted September 4, 2012 Lol nooo there is a much easier way…You just have to add "player(index).access = [Access here]" somewhere in a sub…I always found that sub by searching for "player(index).level = 1" in the project..Edit: All ways are super easy, but this way is the easiest. Link to comment Share on other sites More sharing options...
Joyce Posted September 4, 2012 Share Posted September 4, 2012 You're just adding complexity really, the Sub I suggested to call wraps that call with some checks to prevent crashes. And adding it in any sub would be silly, if you add it to the registration sub before it saves, it happens once and it's done. Honestly, if you're just going to suggest the same thing I did, except in a silly way don't bother responding at all. It's just confusing to people._Just a reminder; Just because it works doesn't mean it's done properly. A lot of people on this forum seem to go by the trend of "LOLTOSSCODEHERE" because it works for them, not thinking about the possible downsides or issues it may or may not cause in future expansion, or rare occasions. Seriously, if you don't know what you're doing or what sort of leaks/issues/oddities your changes cause, don't suggest them to other people. It's annoying having to fix their problems because some random turd decides to give improper advice._ Link to comment Share on other sites More sharing options...
Boynaar44 Posted September 4, 2012 Share Posted September 4, 2012 @hardcorex9, there is no difference between "player(index).access = [Access here]" and "SetPlayerAccess(Index, Value)".>! Before everything, I was just being sarcasm because you said it's the easiest way. But yeah then you said something wrong.>! So that means…>! "player(index).level = 1" should actually be changed to "SetPlayerLevel(index, 1)", just to prevent a crash from setting a level to a value of "1"?>! No, you forgot something…>! If you know for 100% sure that there can't be any crash of setting a player-level to a value of 1, you can just use "player(index).level = 1" and ignore all the pointless things on the function "SetPlayerLevel"…>! Here we are talking about a small improvement of performance, where it doesn't actually matter what you use since it doesn't really effect the performance of the program, but still you should use any possibility available to increasse the performance of the program without having any possible issue.>! Btw.. Check the source code first before you say: the Sub I suggested to call wraps that call with some checks to prevent crashes.>! There can't go anything wrong by using "player(index).access = 4", in some cases it's even better, but in other cases "SetPlayerAccess" might be better.>! So what crashes are you actually talking about?>! As you see, you can't prove me wrong, because we both are actually talking about the same point.>! And remember, it's nice to be important, but it's more important to be nice ^^ Link to comment Share on other sites More sharing options...
Joyce Posted September 4, 2012 Share Posted September 4, 2012 Not entirely, a faulty program or addition might cause Index to become something it shouldn't be, still crashing it. So instead of assuming every value you want to call the array's ID from is correct, it's better to check if it's a legal value to prevent the small chance it may or may not crash.(Although in this case, the entire call would already be encapsulated in a check, and I realize this. HOWEVER, instead of teaching people bad practices it's better to just get them to do it properly now.)Not to mention it just looks cleaner, and the sub was added for a reason.. If you're going to do something more than x amount of times, make it a sub/function and clean up your code some. And in this case, it allows for some safety checks, which shouldn't need to be there but it's always handy, most of the crashes and issues we had in TE/EE were caused by not seeing if our values were legal. We really need to prevent from doing the same crap here.Also, note that the smaller portion of my previous post was mostly meant in general(Hence the change in font size), I see tons of people posting odd fixes that can be done much more secure or efficiently. Link to comment Share on other sites More sharing options...
hardcorex9 Posted September 4, 2012 Author Share Posted September 4, 2012 ok i know this is newb of me but were would i have to put this script because atm i a blankEdit: Nvm found out but thanks for helping me a lot Joyce and Bornaar44, just to point out im not a person who scripts more of a artist/graphics but have been wanting to try it out, but thanks got it to work, like i said its more in a single player stage atm but thanks for sharing this script could turn it into a online game, but off cause the people who download the game will have to host their own servers. (aka minecraft like but different) Link to comment Share on other sites More sharing options...
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