SA-MP Forums Archive
How to fix this warning - 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: How to fix this warning (/showthread.php?tid=644933)



How to fix this warning - PierreMarley - 16.11.2017

Hi, I have this one working 100%

Код:
format(szMessage, sizeof(szMessage), "You have accepted the invitation and joined the %s, you were invited by %s.", FamilyInfo[InviteFamily[playerid]][FamilyName], GetPlayerNameEx(InviteOffer[playerid]));
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage);
And wanted to change it to like that:
Код:
format(string, sizeof(string), "You have accepted %s's invite, and are now a member of %s.", 
GetPlayerNameEx(InviteOffer[playerid], FamilyInfo[InviteFamily[playerid]][FamilyName]));
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
But giving me this one warnung why?
Код:
 warning 202: number of arguments does not match definition



Re: How to fix this warning - Kane - 16.11.2017

Assuming your GetPlayerNameEx function has only one parameter which would be player ID,
PHP код:
GetPlayerNameEx(InviteOffer[playerid], FamilyInfo[InviteFamily[playerid]][FamilyName]));
SendClientMessageEx(playeridCOLOR_LIGHTBLUEstring); 
needs to become:

PHP код:
GetPlayerNameEx(InviteOffer[playerid]), GetPlayerNameEx(FamilyInfo[InviteFamily[playerid]][FamilyName]) 



Re: How to fix this warning - PierreMarley - 16.11.2017

Tested, giving me this

error 001: expected token: ",", but found ";"


Re: How to fix this warning - Kane - 17.11.2017

Show me what you did and also show your GetPlayerNameEx code.


Re: How to fix this warning - Zeth - 17.11.2017

Try this
PHP код:
format(stringsizeof(string), "You have accepted %s's invite, and are now a member of %s."
GetPlayerNameEx(InviteOffer[playerid]), FamilyInfo[InviteFamily[playerid]][FamilyName]);
SendClientMessageEx(playeridCOLOR_LIGHTBLUEstring); 



Re: How to fix this warning - Lucases - 17.11.2017

Post your GetPlayerNameEx function


Re: How to fix this warning - PierreMarley - 17.11.2017

Код:
stock GetPlayerNameEx(playerid) {

	new
		szName[MAX_PLAYER_NAME],
		iPos;

	GetPlayerName(playerid, szName, MAX_PLAYER_NAME);
	while ((iPos = strfind(szName, "_", false, iPos)) != -1) szName[iPos] = ' ';
	return szName;
}



Re: How to fix this warning - Dayrion - 17.11.2017

What about:
PHP код:
format(stringsizeof(string), "You have accepted %s's invite, and are now a member of %s."GetPlayerNameEx(InviteOffer[playerid]), FamilyInfo[InviteFamily[playerid]][FamilyName]);
SendClientMessageEx(playeridCOLOR_LIGHTBLUEstring); 



Re: How to fix this warning - Usmanmemon - 17.11.2017

Try this one maybe help.

PHP код:
format(szMessagesizeof(szMessage), "You have accepted %s's invite, and are now a member of %s."GetPlayerNameEx(InviteOffer[playerid]), FamilyInfo[InviteFamily[playerid]][FamilyName]);
SendClientMessageEx(playeridCOLOR_LIGHTBLUEszMessage); 



Re: How to fix this warning - Dayrion - 17.11.2017

Quote:
Originally Posted by Usmanmemon
Посмотреть сообщение
Try this one maybe help.

PHP код:
format(szMessagesizeof(szMessage), "You have accepted %s's invite, and are now a member of %s."GetPlayerNameEx(InviteOffer[playerid]), FamilyInfo[InviteFamily[playerid]][FamilyName]);
SendClientMessageEx(playeridCOLOR_LIGHTBLUEszMessage); 
Lol. This is exactly what I wrote.