PDA

View Full Version : How to add color like this please click me to see!


Lloyde
03/04/2014, 12:31 PM
How to add color the Vehicle and Status like this sir


http://i1294.photobucket.com/albums/b603/Neitheus_Olympus/1_zps91051fd1.png (http://s1294.photobucket.com/user/Neitheus_Olympus/media/1_zps91051fd1.png.html)


CMD:vstorage(playerid, params[])
{
if(AdminDuty[playerid] == 1)
{
SendClientMessage(playerid,COLOR_WHITE, "You can't use this command while on-duty as admin.");
return 1;
}
new vstring[1024];
for(new i, iModelID; i < MAX_PLAYERVEHICLES; i++) {
if((iModelID = PlayerVehicleInfo[playerid][i][pvModelId] - 400) >= 0) {
if(PlayerVehicleInfo[playerid][i][pvImpounded]) {
format(vstring, sizeof(vstring), "%s\nVehicle: %s | Status: [Impounded]", vstring, VehicleName[iModelID]);
}
else if(PlayerVehicleInfo[playerid][i][pvDisabled]) {
format(vstring, sizeof(vstring), "%s\nVehicle: %s | Status: [disabled]", vstring, VehicleName[iModelID]);
}
else if(!PlayerVehicleInfo[playerid][i][pvSpawned]) {
format(vstring, sizeof(vstring), "%s\nVehicle: %s | Status: [stored]", vstring, VehicleName[iModelID]);
}
else format(vstring, sizeof(vstring), "%s\nVehicle: %s | Status: [spawned]", vstring, VehicleName[iModelID]);
}
else strcat(vstring, "\nEmpty");
}
ShowPlayerDialogEx(playerid, VEHICLESTORAGE, DIALOG_STYLE_LIST, "Vehicle storage", vstring, "(De)spawn", "Cancel");
return 1;
}

Clad
03/04/2014, 12:38 PM
It's 0.3c colors like this {FFFFFF}
you can also use "COL_ORANGE"

Lloyde
03/04/2014, 12:40 PM
where can i place that sir

iThePunisher
03/04/2014, 12:40 PM
change it to this
CMD:vstorage(playerid, params[])
{
if(AdminDuty[playerid] == 1)
{
SendClientMessage(playerid,COLOR_WHITE, "You can't use this command while on-duty as admin.");
return 1;
}
new vstring[1024];
for(new i, iModelID; i < MAX_PLAYERVEHICLES; i++) {
if((iModelID = PlayerVehicleInfo[playerid][i][pvModelId] - 400) >= 0) {
if(PlayerVehicleInfo[playerid][i][pvImpounded]) {
format(vstring, sizeof(vstring), "%s\n{FFE135}Vehicle:{FFFFFF} %s | {FFE135}Status: {FFFFFF}[Impounded]", vstring, VehicleName[iModelID]);
}
else if(PlayerVehicleInfo[playerid][i][pvDisabled]) {
format(vstring, sizeof(vstring), "%s\n{FFE135}Vehicle:{FFFFFF} %s | {FFE135}Status:{FFFFFF} [disabled]", vstring, VehicleName[iModelID]);
}
else if(!PlayerVehicleInfo[playerid][i][pvSpawned]) {
format(vstring, sizeof(vstring), "%s\n{FFE135}Vehicle: {FFFFFF}%s | {FFE135}Status:{FFFFFF} [stored]", vstring, VehicleName[iModelID]);
}
else format(vstring, sizeof(vstring), "%s\n{FFE135}Vehicle: {FFFFFF}%s | {FFE135}Status:{FFFFFF} [spawned]", vstring, VehicleName[iModelID]);
}
else strcat(vstring, "\nEmpty");
}
ShowPlayerDialogEx(playerid, VEHICLESTORAGE, DIALOG_STYLE_LIST, "Vehicle storage", vstring, "(De)spawn", "Cancel");
return 1;
}

Bingo
03/04/2014, 12:53 PM
Those colour codes are used in HTML like this #FFFFFF but we can also use it in C++ by remove '#' and add brackets at start and end {FFFFFF}.

For more colours CLICK HERE ( http://www.w3schools.com/html/html_colors.asp)