error 035: argument type mismatch (argument 2)
#1

Код:
COMMAND:f(playerid, params[])
{
	new text[128],fcolor[255],string[255],sendername[MAX_PLAYER_NAME];
	if(sscanf(params, "s[128]", text)) SendClientMessage(playerid, COLOR_GREY, "用法: /f [text]");
	else
	{
	    if (GetPVarInt(playerid, "PlayerLogged") == 0) return SendClientMessage(playerid, COLOR_WHITE, "请先登录游戏.");
	    if(GetPVarInt(playerid, "Mute") == 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "你已被禁言!");
	    if (GetPVarInt(playerid, "Member") == 0) return SendClientMessage(playerid, COLOR_WHITE, "你不在一个组织里.");
	    if(FactionInfo[GetPVarInt(playerid, "Member")][fDisabled] == 1) return SendClientMessage(playerid, COLOR_WHITE, "组织频道被关闭了!");
   		switch(GetPVarInt(playerid, "Member"))
		{
	        case 1: fcolor = "0x8080FF96";
	        case 2: fcolor = "COLOR_PINK";
	        case 6: fcolor = "0x8080FF96";
	        case 8: fcolor = "COLOR_GREEN";
	        default: fcolor = "0x7BDDA5AA";
	    }
	   	format(sendername, sizeof(sendername), "%s", PlayerName(playerid));
	    GiveNameSpace(sendername);
        format(string, sizeof(string), "** (( %s %s: %s )) **", FactionRank[GetPVarInt(playerid, "Member")][GetPVarInt(playerid, "Rank")], sendername, text);
	    SendFactionMessage(GetPVarInt(playerid, "Member"),fcolor,string);
	}
	return 1;
}
This one is reporting for error:

SendFactionMessage(GetPVarInt(playerid, "Member"),fcolor,string);
Reply
#2

Colors are integers.
Reply
#3

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
Colors are integers.
So how do I change? I kinda confused on this..
Reply
#4

Change "fcolor[255]" to "fcolor" and when you assign values to it, it has to be like this:
Код:
fcolor = 0x8080FF96;
instead of
Код:
fcolor = "0x8080FF96";
for example. Also you don't need 255 cells for "string" because the output text can't be longer than 144 characters so simply change 255 to 144. And another thing: you don't need sscanf here, you can use the params and isnull.
Reply
#5

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
Change "fcolor[255]" to "fcolor" and when you assign values to it, it has to be like this:
Код:
fcolor = 0x8080FF96;
instead of
Код:
fcolor = "0x8080FF96";
for example. Also you don't need 255 cells for "string" because the output text can't be longer than 144 characters so simply change 255 to 144. And another thing: you don't need sscanf here, you can use the params and isnull.
Fixed, thank you very much!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)