SA-MP Forums Archive
Embedded color healp - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Embedded color healp (/showthread.php?tid=250607)



Embedded color healp - Unknown123 - 23.04.2011

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


Re: Embedded color healp - Vince - 23.04.2011

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);



Re: Embedded color healp - Laronic - 23.04.2011

Sorry posted in wrong topic

at me


Re: Embedded color healp - Unknown123 - 23.04.2011

Thanks ,ill test now

Edit: It failed Badly!

nvm ill do it on another way