PDA

View Full Version : How to fix this warning


PierreMarley
16/11/2017, 10:55 PM
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

Kane
16/11/2017, 10:58 PM
Assuming your GetPlayerNameEx function has only one parameter which would be player ID,

GetPlayerNameEx(InviteOffer[playerid], FamilyInfo[InviteFamily[playerid]][FamilyName]));
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);


needs to become:

GetPlayerNameEx(InviteOffer[playerid]), GetPlayerNameEx(FamilyInfo[InviteFamily[playerid]][FamilyName])

PierreMarley
16/11/2017, 11:57 PM
Tested, giving me this

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

Kane
17/11/2017, 12:02 AM
Show me what you did and also show your GetPlayerNameEx code.

Zeth
17/11/2017, 02:50 AM
Try this

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);

Lucases
17/11/2017, 06:01 AM
Post your GetPlayerNameEx function

PierreMarley
17/11/2017, 09:30 AM
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;
}

Dayrion
17/11/2017, 10:58 AM
What about:
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);

Usmanmemon
17/11/2017, 01:07 PM
Try this one maybe help.

format(szMessage, sizeof(szMessage), "You have accepted %s's invite, and are now a member of %s.", GetPlayerNameEx(InviteOffer[playerid]), FamilyInfo[InviteFamily[playerid]][FamilyName]);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage);

Dayrion
17/11/2017, 01:50 PM
Try this one maybe help.

format(szMessage, sizeof(szMessage), "You have accepted %s's invite, and are now a member of %s.", GetPlayerNameEx(InviteOffer[playerid]), FamilyInfo[InviteFamily[playerid]][FamilyName]);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage);

Lol. This is exactly what I wrote. :confused:

Lucases
17/11/2017, 01:54 PM
Here you go


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);

Usmanmemon
17/11/2017, 05:54 PM
Lol. This is exactly what I wrote. :confused:

lol i didnt see your msg sorry.