Embedded color healp
#1

pawn Код:
case 1:
                            {
                                AdminRank = ADMIN_LEVEL_1;
                                ChangeColor = COLOR_ADMIN_LEVEL_1;
                            }
                           
                            case 2:
                            {
                                AdminRank = ADMIN_LEVEL_2;
                                ChangeColor = COLOR_ADMIN_LEVEL_2;
                            }
                            case 3:
                            {
                                AdminRank = ADMIN_LEVEL_3;
                                ChangeColor = COLOR_ADMIN_LEVEL_3;
                            }
                            case 4:
                            {
                                AdminRank = ADMIN_LEVEL_4;
                                ChangeColor = COLOR_ADMIN_LEVEL_4;
                            }
                            case 5:
                            {
                                AdminRank = ADMIN_LEVEL_5;
                                ChangeColor = COLOR_ADMIN_LEVEL_5;
                            }
ERRORS:
Код:
C:\Users\Unknown123\Desktop\Server\gamemodes\GM.pwn(931) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Unknown123\Desktop\Server\gamemodes\GM.pwn(931) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Unknown123\Desktop\Server\gamemodes\GM.pwn(931) : warning 215: expression has no effect
C:\Users\Unknown123\Desktop\Server\gamemodes\GM.pwn(931) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Unknown123\Desktop\Server\gamemodes\GM.pwn(931) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
at this line
pawn Код:
format(string, sizeof(string), "Admin-Level: {FF0000}%d {" ChangeColor"}- {FF0000}%s(%d) {"ChangeColor"}| {FF0000}%s {"ChangeColor"}| {FF0000}%s", GetPlayerAdminLevel(playerid), PlayerName(i), i, AdminRank, AdminDuty);
                    SendClientMessage(playerid, ChangeColor, string);
The "ChangeColor" is random so idk how to add it into the embedded color thingy
Reply
#2

Is ChangeColor a string or an integer? I'll assume that it's an integer for now.

pawn Код:
new tmpcolor = ChangeColor >>> 8; // Shift bits, removing alpha value

format(string, sizeof(string),  "Admin-Level: {FF0000}%d {%06x}- {FF0000}%s(%d) {%06x}| {FF0000}%s {%06x}| {FF0000}%s",
    GetPlayerAdminLevel(playerid),
    tmpcolor;
    PlayerName(i),
    i,
    tmpcolor,
    AdminRank,
    tmpcolor,
    AdminDuty);
SendClientMessage(playerid, ChangeColor, string);
Reply
#3

Sorry posted in wrong topic

at me
Reply
#4

Thanks ,ill test now

Edit: It failed Badly!

nvm ill do it on another way
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)