Setcolour for ALL players function.
#4

You'll need to have a variable to hold the colors and then run a loop via your command to set them all.

I.E;
PHP код:
CMD:toorange(playeridparams[]) {
    for(new 
0iMAX_PLAYERSi++) {
        if(
IsPlayerConnected(i)) {
            
SetPVarInt(i"color"GetPlayerColor(i));
            
SetPlayerColor(i0xD1773BFF); // orange
        
}
    }
    return 
1;
}
CMD:returncolors(playeridparams[]) {
    for(new 
0MAX_PLAYERSi++) {
        if(
IsPlayerConnected(i)) {
            
SetPlayerColor(iGetPVarInt(i"color"));
        }
    }
    return 
1;

This will be different depending on what you use to create commands obviously.
The reason I use SetPVarInt is so that if the player disconnects and another joins, it won't give the new player the old player's color. It's a lot easier.
Reply


Messages In This Thread
Setcolour for ALL players function. - by Harty - 23.03.2016, 22:29
Re: Setcolour for ALL players function. - by Sew_Sumi - 23.03.2016, 22:41
Re: Setcolour for ALL players function. - by Harty - 23.03.2016, 22:43
Re: Setcolour for ALL players function. - by Golden96 - 23.03.2016, 22:47
Re: Setcolour for ALL players function. - by Harty - 23.03.2016, 23:06
Re: Setcolour for ALL players function. - by Sew_Sumi - 23.03.2016, 23:13
Re: Setcolour for ALL players function. - by Golden96 - 23.03.2016, 23:19
Re: Setcolour for ALL players function. - by Sew_Sumi - 23.03.2016, 23:29
Re: Setcolour for ALL players function. - by Golden96 - 23.03.2016, 23:36
Re: Setcolour for ALL players function. - by Sew_Sumi - 24.03.2016, 00:12

Forum Jump:


Users browsing this thread: 2 Guest(s)