Jump to content
  • 0

Problema culori


Oly

Question

salut

Vreau sa stiu si eu cum pot face randul de la comanda "/o" cand scriu sa apara cu 2 culori pe acelasi rand !

Comanda este :

if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet !");
	            return 1;
	        }
       		if(PlayerOOC[playerid] == -1)
            {
				SendClientMessage(playerid,COLOR_GREY,"You can only send an ooc message at once 10 seconds !");
				return 1;
            }
			if ((noooc) && PlayerInfo[playerid][pAdmin] < 1)
			{
				SendClientMessage(playerid, COLOR_GRAD2, "   The OOC channel has been disabled by an Admin !");
				return 1;
			}
	        if(PlayerInfo[playerid][pMuted] == 1)
	        {
				format(string, sizeof(string), "You can not speak, you have been silenced for %d seconds.",PlayerInfo[playerid][pMuteTime]);
				SendClientMessage(playerid, COLOR_LIGHTRED, string);
				return 1;
			}
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			result[0] = toupper(result[0]);
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/o)oc [ooc chat]");
				return 1;
			}
			format(string, sizeof(string), "(( %s: %s ))", sendername, result);
			OOCOff(COLOR_OOC,string);
			printf("%s", string);
			SetTimerEx("ResetOOC", 2000, 0, "d", playerid);
		    PlayerOOC[playerid] = -1;
		}
		return 1;
	}

La altele stiu ca se pune {codhex} inainte de cuvantul dorit dar aici am cu "format(String..." si nu merge asa.va rog,ajutati-ma

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Varianta 1

format(string, sizeof(string), "(("#hexcolor" %s: "#hexcolor2"%s ))", sendername, result);
OOCOff(COLOR_OOC,string);
si hexcolor si hexcolor2 le defineti la inceput ceva de genu
#define hexcolor          "{00FF00}"
#define hexcolor2          "{FF0000}"
Sau mai este o varianta in care nu trebuie definite culorile
format(string, sizeof(string), "(({FF0000} %s: {00FF00}%s ))", sendername, result);
OOCOff(COLOR_OOC,string);

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.