How do I combine this?
#1

So, I have this command "/c" which sends a message to your clan's chat.
This is the command.
Код:
CMD:c(playerid, params[]) {
	if(playerVariables[playerid][pClan] < 1)
		return SendClientMessage(playerid, COLOR_GREY, "Your clan data is invalid.");

	if(isnull(params))
		return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/c [message]");

 	GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);

	switch(playerVariables[playerid][pClanRank])
	{
		case 1:	format(szMessage, sizeof(szMessage), "{%s}[CLAN] %s %s: %s",clanVariables[playerVariables[playerid][pClan]][cClanColor], clanVariables[playerVariables[playerid][pClan]][cClanRankName1], szPlayerName, params);
		case 2:	format(szMessage, sizeof(szMessage), "{%s}[CLAN] %s %s: %s",clanVariables[playerVariables[playerid][pClan]][cClanColor], clanVariables[playerVariables[playerid][pClan]][cClanRankName2], szPlayerName, params);
		case 3:	format(szMessage, sizeof(szMessage), "{%s}[CLAN] %s %s: %s",clanVariables[playerVariables[playerid][pClan]][cClanColor], clanVariables[playerVariables[playerid][pClan]][cClanRankName3], szPlayerName, params);
		case 4:	format(szMessage, sizeof(szMessage), "{%s}[CLAN] %s %s: %s",clanVariables[playerVariables[playerid][pClan]][cClanColor], clanVariables[playerVariables[playerid][pClan]][cClanRankName4], szPlayerName, params);
		case 5:	format(szMessage, sizeof(szMessage), "{%s}[CLAN] %s %s: %s",clanVariables[playerVariables[playerid][pClan]][cClanColor], clanVariables[playerVariables[playerid][pClan]][cClanRankName5], szPlayerName, params);
		case 6:	format(szMessage, sizeof(szMessage), "{%s}[CLAN] %s %s: %s",clanVariables[playerVariables[playerid][pClan]][cClanColor], clanVariables[playerVariables[playerid][pClan]][cClanRankName6], szPlayerName, params);
		case 7:	format(szMessage, sizeof(szMessage), "{%s}[CLAN] %s %s: %s",clanVariables[playerVariables[playerid][pClan]][cClanColor], clanVariables[playerVariables[playerid][pClan]][cClanRankName7], szPlayerName, params);
		default: format(szMessage, sizeof(szMessage), "{%s}[CLAN] %s %s: %s",clanVariables[playerVariables[playerid][pClan]][cClanColor], clanVariables[playerVariables[playerid][pClan]][cClanRankName1], szPlayerName, params);
	}
    SendToClan(playerVariables[playerid][pClan], COLOR_WHITE, szMessage);
	return 1;
}
Код:
SendToClan(playerVariables[playerid][pClan], clanVariables[playerVariables[playerid][pClan]][cClanColor], szMessage);
This is the stock that sends the message to the group.

clanVariables[playerVariables[playerid][pClan]][cClanColor] is not a "0xFFAAAAAA" format, but its rather a "AAAAAA" format. As you know, the SendToClan stock does not work with that color code. My question here is, how can I add "0x" to clanVariables[playerVariables[playerid][pClan]][cClanColor] so it turns into 0x"clanVariables[playerVariables[playerid][pClan]][cClanColor]"
Reply


Messages In This Thread
How do I combine this? - by danielpalade - 28.03.2016, 01:21
Re: How do I combine this? - by SickAttack - 28.03.2016, 01:46
Re: How do I combine this? - by danielpalade - 28.03.2016, 02:13
Re: How do I combine this? - by AdrianG - 28.03.2016, 02:20
Re: How do I combine this? - by danielpalade - 28.03.2016, 02:42
Re: How do I combine this? - by SickAttack - 28.03.2016, 03:03
Re: How do I combine this? - by danielpalade - 28.03.2016, 03:16
Re: How do I combine this? - by SickAttack - 28.03.2016, 03:21
Re: How do I combine this? - by danielpalade - 28.03.2016, 03:32
Re: How do I combine this? - by SickAttack - 28.03.2016, 03:41

Forum Jump:


Users browsing this thread: 1 Guest(s)