Posts: 110
Threads: 17
Joined: Mar 2016
I want to make a cmd that temporary save all players name colors, then all players name colors on the list (TAB) believe orange for ALL players connected, and after that, all colors believe as saved before.
Is that possible?
Thanks & Regards.
Posts: 6,242
Threads: 8
Joined: Jun 2008
It is possible.
Using GetPlayerColor you can store them to an array, and then set them back once the orange-need is over.
Posts: 110
Threads: 17
Joined: Mar 2016
Can you give me a code example please ?
Thanks.
Posts: 110
Threads: 17
Joined: Mar 2016
It doesn't work, it set for all players the orange color, but the second command don't back the saved one.
Posts: 6,242
Threads: 8
Joined: Jun 2008
This is not the place to ask for "examples", because this is Scripting Help, not Script for you.
The usual reason why the GetPlayerColor sets to black, is because the Color hasn't been set prior.
A good point is that he's using an Integer, where he should almost be using a string as it's a hex code that gets retrieved, and needs to be handed back to the script as a string so it can read it.
Try using SetPVarString and GetPVarString.
Posts: 32
Threads: 0
Joined: Mar 2016
Reputation:
0
The script I wrote works just fine for me
Posts: 6,242
Threads: 8
Joined: Jun 2008
Quote:
Originally Posted by Golden96
The script I wrote works just fine for me
|
Then it's because of the fact that in his script, it doesn't have SetPlayerColor used...
In all honesty though, you need to read the rules about scripting help. Pasting up code, ISN'T helping, as next time something needs to be done, they'll just post up threads expecting people to hand out examples rather than actually learning to script.
Posts: 32
Threads: 0
Joined: Mar 2016
Reputation:
0
I'm just showing him how easy it was. It's just a loop and storing variables, it's not like I wrote a whole script for him. I doubt he's just going to use those simple commands and if he is it's pretty silly since anyone can use those commands and just set everyone's colors all the time.
Posts: 6,242
Threads: 8
Joined: Jun 2008
Asks if it's possible, code gets supplied... Yea..........