17.07.2014, 18:52
Is there anyway to make a rainbow name in Chat !??
Example: GeekSiMo: Hello
Example: GeekSiMo: Hello
new name[MAX_PLAYER_NAME + 1];
format(name, sizeof(name), "{FF0000}L{FFFFFF}O{FF0000}L{FFFFFF}");
SetPlayerName(playerid, name);
#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;
}
Is there anyway to make a rainbow name in Chat !??
Example: GeekSiMo: Hello |
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; }