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

i've been getting all these errors on some of the following lines
Код:
CMD:makeadmin(playerid,params)
{
	if(!IsPlayerAnAdmin(playerid,6))return SendClientMessage(playerid,COL_RED,"<!>You are not authorized to use this command!");
	new adminlvl,rank,pmsg[128],adminmsg[128],string [128],pname,pID;
	if(sscanf(params,"ui",pname,adminlvl))return SendClientMessage(playerid,COL_GREEN,"USAGE:/makeadmin [ID] [LEVEL]");
	if(rank<0||rank>6)return SendClientMessage(playerid,COL_GREEN,"Please write an acceptable level.");
	format(pmsg,sizeof(pmsg),"You have been promoted to level %i by Adminstrator %s",adminlvl,PlayerName(playerid));
	format(adminmsg,sizeof(adminmsg),"You have promoted %s to level %i",pname,adminlvl);
	SetPVarInt(pID,"Admin",rank);
	for(new i=0;i<GetMaxPlayers();i++)
	{
	if(IsPlayerConnected(i))
	{
	if(IsPlayerAnAdmin(i,1))
	{
    format(string,sizeof(string),"A: %s [LEVEL %i] used the MAKEADMIN command.",PlayerName(playerid),GetPVarInt(playerid,"Admin"));
	SendClientMessage(i,COL_LIGHTBLUE,string);
	}
	}
	}
	SendClientMessage(playerid,COL_LIGHTBLUE,adminmsg);
	SendClientMessage(pID,COL_LIGHTBLUE,pmsg);
	return 1;
}
Reply
#2

This error means your putting an invalid input in a function, try to compile this to understand
pawn Код:
public OnPlayerConnect(playerid)
{
    SendClientMessage("test", "test", "test");

    return 1;
}
SendClientMessage should take the id(integer) in the first "argument", then a color, then the string.
if you put something else, for example a string instead of an integer it'll give you this error

since you didn't show a specific line I guess some of your colors aren't correctly defined
Reply
#3

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
This error means your putting an invalid input in a function, try to compile this to understand
pawn Код:
public OnPlayerConnect(playerid)
{
    SendClientMessage("test", "test", "test");

    return 1;
}
SendClientMessage should take the id(integer) in the first "argument", then a color, then the string.
if you put something else, for example a string instead of an integer it'll give you this error

since you didn't show a specific line I guess some of your colors aren't correctly defined
Код:
#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_GREEN "{00FF22}"
#define COL_LIGHTBLUE "{00CED1}"
Here r the colours , i still dont get you tho :/
Reply
#4

Color codes to use should be like
pawn Код:
#define COL_LIGHTBLUE 0x00CED1FF
in "SendClientMessage" and as you do it in format
Reply
#5

alright thanks , +Repped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)