SA-MP Forums Archive
Argument. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Argument. (/showthread.php?tid=663383)



Argument. - Longover - 29.01.2019

Error:

Код:
error 035: argument type mismatch (argument 1)
Code:

Код:
CMD:setfpo(playerid, params[])
{
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi mai intai.");
	//if(PinLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_BLUELIGHT, "Trebuie sa introduci codul pin mai intai folosind comanda [/pin] sau sa setezi unul folosind comanda [/setpin].");
	if(IsPlayerConnected(playerid))
 	{
        if (PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_ERROR, AdminOnly);
        new id[25],cont,fp,string[182];
        if(sscanf(params, "s[25]i",id,fp)) return SendClientMessage(playerid,COLOR_WHITE, "{FF0000}Foloseste: {FFFFFF}/setfp <Nume> <FP>");
        cont = MySQLCheckAccount(id);
        if(cont == 0) return SendClientMessage(playerid,COLOR_WHITE,"{FFB870}This name does not exist.");
     	format(string, 182, "Offline AdmCmd: Admin %s i-a setat FP-ul lui %s la %d.", GetName(playerid), GetName(id), fp);  // <---- error
    	ABroadCast(COLOR_LIGHTRED,string,1);
		new str1[128];
		mysql_format(SQL,str1,sizeof(str1),"UPDATE users SET `FPunish`='%d' WHERE `name`='%s'",fp,id);
		mysql_tquery(SQL,str1,"","");
	}
	return 1;
}



Re: Argument. - Longover - 29.01.2019

Quote:
Originally Posted by ******
Посмотреть сообщение
Which line?
Код:
format(string, 182, "Offline AdmCmd: Admin %s i-a setat FP-ul lui %s la %d.", GetName(playerid), GetName(id), fp);  // <---- error



Re: Argument. - Banditul18 - 29.01.2019

Quote:
Originally Posted by ******
Посмотреть сообщение
Ahh, `id` should not be an array.
By the look of it id is actually a name that is searched in database and its updating something

OP: Use id direct instead of GetName(id)


Re: Argument. - Longover - 31.01.2019

Quote:
Originally Posted by Banditul18
Посмотреть сообщение
By the look of it id is actually a name that is searched in database and its updating something

OP: Use id direct instead of GetName(id)
sorry,this is the line
Код:
cont = MySQLCheckAccount(id); //



Re: Argument. - Banditul18 - 31.01.2019

Well then check MySQLCheckAccount definition and see what the first argument should be. If its a string, int float etc and change it acording to function usage