SA-MP Forums Archive
[IDEA] Rainbow Name - 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)
+--- Thread: [IDEA] Rainbow Name (/showthread.php?tid=526486)



[IDEA] Rainbow Name - GeekSiMo - 17.07.2014

Is there anyway to make a rainbow name in Chat !??

Example: GeekSiMo: Hello


Re: [IDEA] Rainbow Name - sammp - 17.07.2014

Idk try this:
pawn Код:
new name[MAX_PLAYER_NAME + 1];
format(name, sizeof(name), "{FF0000}L{FFFFFF}O{FF0000}L{FFFFFF}");
SetPlayerName(playerid, name);



Re: [IDEA] Rainbow Name - Clad - 17.07.2014

Yes, It is possible, Use 0.3c Colors such {FFFFFF}.


Re: [IDEA] Rainbow Name - GeekSiMo - 17.07.2014

I Know But Can't Do it because pName %s


Re: [IDEA] Rainbow Name - paulommu - 17.07.2014

Yeah, it's possible with color embedding since 0.3c, but SendClientMessage has a limit of 144 characters. Since each color code consumes 8 characters '{FFFFFF}', your messages will be very limited.


Re: [IDEA] Rainbow Name - sammp - 17.07.2014

Quote:
Originally Posted by paulommu
Посмотреть сообщение
Yeah, it's possible with color embedding since 0.3c, but SendClientMessage has a limit of 144 characters. Since each color code consumes 8 characters '{FFFFFF}', your messages will be very limited.
word

But you could script a multi line thingy that would work


Re: [IDEA] Rainbow Name - Dignity - 17.07.2014

Result:



Code:

pawn Код:
#include <a_samp>
#include <zcmd>

CMD:comp(playerid, params[])
{
    new string[80]; // size 80 because our name is auto. 80

    format(string, sizeof(string), "%s", GetRainbowName(playerid));
    SendClientMessage(playerid, -1, string);

    return true;
}

stock GetRainbowName(playerid)
{
    new name[80]; // We use 7 colors, 7 x 8 = 56 + 24 (MAX_PLAYER_NAME) = 80
    GetPlayerName(playerid, name, sizeof(name));
   
    // Size of the hex is 8, so x times 8 every time:
    strins(name, "{DB3030}", 0); // red
    strins(name, "{DB30D0}", 9); // pink
    strins(name, "{4730DB}", 18); // blue
    strins(name, "{30DBD3}", 27); // cyan
    strins(name, "{30DB58}", 36); // green
    strins(name, "{FAF60C}", 45); // yellow
    strins(name, "{FA930C}", 54); // orange

    // And return the name, ofcourse
    return name;
}



Re: [IDEA] Rainbow Name - ryansheilds - 17.07.2014

sirs i try but i suck at scripting and op said it no work but plz u can fix if u try edit?

http://pastebin.com/YpV7QK4m


Re: [IDEA] Rainbow Name - MrWupiazZzLT - 18.07.2014

Quote:
Originally Posted by GeekSiMo
Посмотреть сообщение
Is there anyway to make a rainbow name in Chat !??

Example: GeekSiMo: Hello
Give me your IP adress i can do it for you pm me! I will do that only you can use that and other players cant to that

#Edit

Okay i created it to you, but you need to change "Your IP" To your real PC IP adress Code:

Код:
public OnPlayerText(playerid, text[])
{
	new pName[MAX_PLAYER_NAME], String[128];
 	GetPlayerName(playerid, pName, 24);
	new GeekSiMoIP[16];
    GetPlayerIp(playerid, GeekSiMoIP, sizeof(GeekSiMoIP));
    if(!strcmp(GeekSiMoIP, "Your IP"))
    {
	format(String, sizeof(String), "{FF0000}G{FF9900}e{FFFF00}e{3366FF}k{000099}S{660099}i{00FF99}M{660000}o{FFFFFF}: %s", text);
   	SendClientMessageToAll(-1,String);
   	}
   	else
   	{
	new pName2[MAX_PLAYER_NAME], String[128];
 	GetPlayerName(playerid, pName2, 24);
	format(String, sizeof(String), "%s{FFFFFF}: %s", pName2, text);
   	SendClientMessageToAll(-1,String);
   	}
	return 0;
}
Now video how its looks like check here vvv

[ame]http://www.youtube.com/watch?v=yB7pCWafajA[/ame]