28.03.2016, 01:21
So, I have this command "/c" which sends a message to your clan's chat.
This is the command.
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]"
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);
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]"