Question
#1

Hi all. i Have a Question How to make a Command for RGB Colors Like /mycolor [R] [G] [B].
IF i Quit the Server and Come back again the RGB Color stay and to remove it /resetcolor to back the Normal color
Please Help iwill +rep
Reply
#2

Quote:
Originally Posted by anassmaroc
Посмотреть сообщение
Hi all. i Have a Question How to make a Command for RGB Colors Like /mycolor [R] [G] [B].
IF i Quit the Server and Come back again the RGB Color stay and to remove it /resetcolor to back the Normal color
Please Help iwill +rep
Hello.
You've to store player's color when they leave in some external place (e.g. file or in database) and then load it up when player connects. That's pretty much it.

And about /mycolor ® (g) (b). It's pretty easy to do:
pawn Код:
COMMAND:mycolor( playerid, params[] ){
    new
        Red, Green, Blue ;
    if( sscanf(params, "ddd", Red, Green, Blue) ) {
        SendClientMessage( playerid, -1, "Use: /mycolor R G B");
        return 1;
    }
    if( ( Red >= 0 && Green >= 0 && Blue >= 0 ) && ( Red <= 255 && Green <= 255 && Blue <= 255 ) ) {
        new mixedColor = 0;
        mixedColor = (Red << 24) + (Green << 16) + (Blue << 8) + 255;
       
        SetPlayerColor( playerid, mixedColor );
        SendClientMessage( playerid, -1, "Done!");
        return 1;      
    } else {
        SendClientMessage( playerid, -1, "Error: one or more channels are out of bounds (0<>255)");
        return 1;
    }
}
Greetings.
Reply
#3

Quote:
Originally Posted by LetsOWN[PL]
Посмотреть сообщение
Hello.
You've to store player's color when they leave in some external place (e.g. file or in database) and then load it up when player connects. That's pretty much it.

And about /mycolor ® (g) (b). It's pretty easy to do:
pawn Код:
COMMAND:mycolor( playerid, params[] ){
    new
        Red, Green, Blue ;
    if( sscanf(params, "ddd", Red, Green, Blue) ) {
        SendClientMessage( playerid, -1, "Use: /mycolor R G B");
        return 1;
    }
    if( ( Red >= 0 && Green >= 0 && Blue >= 0 ) && ( Red <= 255 && Green <= 255 && Blue <= 255 ) ) {
        new mixedColor = 0;
        mixedColor = (Red << 24) + (Green << 16) + (Blue << 8) + 255;
       
        SetPlayerColor( playerid, mixedColor );
        SendClientMessage( playerid, -1, "Done!");
        return 1;      
    } else {
        SendClientMessage( playerid, -1, "Error: one or more channels are out of bounds (0<>255)");
        return 1;
    }
}
Greetings.
Yes But How to make it Stay must If i left the Server and re - back it will Stay and if iwant remove RGB color must DO CMD reset Color
Reply
#4

Help
Reply
#5

Are you using mysql, dini or YSI\y_ini?
Reply
#6

Quote:
Originally Posted by ZToPMaN
Посмотреть сообщение
Are you using mysql, dini or YSI\y_ini?
dini
Reply
#7

PHP код:
CreateRGB(rgb)
{   
    return ( ((
0xff) << 16) + ((0xff) << 8) + (0xff) );

Reply
#8

just an ex : dini_Set("File.txt", Red,Green,Blue);
Reply
#9

Quote:
Originally Posted by Dutheil
Посмотреть сообщение
PHP код:
CreateRGB(rgb)
{   
    return ( ((
0xff) << 16) + ((0xff) << 8) + (0xff) );

Ready Have
PHP код:
YCMD:mycolor(playerid,params[], help)
{
    
#pragma unused help
    #pragma unused params
    
if(Account[playerid][VipLevel] < 1) return  SendClientMessage(playerid,COLOR_RED,"Error: {FFFFFF}You are not a Donator Member!");
    new 
Redrebels;
    new 
Green;
    new 
Blue;
    if(
sscanf(params"ddd"Redrebels,Green,Blue))
    {
        
SendClientMessageplayerid,COLOR_RED"Usage: {FFFFFF}/mycolor [0-255] [0-255] [0-255]");
        return 
1;
    }
    if((
Redrebels >= && Green >= && Blue >= 0) && (Redrebels <= 255 && Green <= 255 && Blue <= 255))
    {
        new 
mixedColor 0;
        
mixedColor = (Redrebels << 24) + (Green << 16) + (Blue << 8) + 255;
        
SetPlayerColor(playeridmixedColor);
        
SendClientMessage(playerid, -1"Done!");
        return 
1;
    }
    else
    {
        
SendClientMessage(playerid, -1"Error: one or more channels are out of bounds (0<>255)");
        return 
1;
    }

i Need To save this RGB for Vips and if the Vip wants save it he do /resetcolor
Reply
#10

Bump!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)