02.04.2013, 18:11
Hi.It's again me...I'm converting my gangwars strcmp commands to zcmd.I get this error on server console when i use command /changerankname 6 Leader
this is my command
P.S: Srry for my bad english and command language..
Код:
sscanf warning: format specifier does not match parameter count
pawn Код:
CMD:changerankname(playerid,params[])
{
if(IsPlayerConnected(playerid))
{
new id2, result[256], string[256];
if(PlayerInfo[playerid][pMember] == TEAM_CIVILIAN && PlayerInfo[playerid][pRank] != 6) return SendClientMessage(playerid, COLOR_GRAD1, "Usage: /changerankname [Rank ID 1-6] [Name]");
else
{
if(sscanf(params, "s[256]",id2, result)) return SendClientMessage(playerid, COLOR_GRAD1, "Usage: (/f)action [team chat]" );
else
{
if(strfind( result , "|" , true ) == -1)
{
if(id2 == 1)
{
format(string, sizeof(string), "Information - You change rank name: %d(%s) to: %s", id2, TeamInfo[PlayerInfo[playerid][pMember]][fRank1],result);
strmid(TeamInfo[PlayerInfo[playerid][pMember]][fRank1], (result), 0, strlen((result)), 128);
SendClientMessage(playerid, COLOR_GREEN, string);
SaveFactions();
format(string, sizeof(string), "Leader %s change rank name: %d(%s) to: %s", GetName(playerid), id2, TeamInfo[PlayerInfo[playerid][pMember]][fRank1],result);
SendFactionMessage(PlayerInfo[playerid][pMember], COLOR_GREEN, string);
}
else if(id2 == 2)
{
format(string, sizeof(string), "Information - You change rank name: %d(%s) to: %s", id2, TeamInfo[PlayerInfo[playerid][pMember]][fRank2],result);
strmid(TeamInfo[PlayerInfo[playerid][pMember]][fRank2], (result), 0, strlen((result)), 128);
SendClientMessage(playerid, COLOR_GREEN, string);
SaveFactions();
format(string, sizeof(string), "Leader %s change rank name: %d(%s) to: %s", GetName(playerid), id2, TeamInfo[PlayerInfo[playerid][pMember]][fRank2],result);
SendFactionMessage(PlayerInfo[playerid][pMember], COLOR_GREEN, string);
}
else if(id2 == 3)
{
format(string, sizeof(string), "Information - You change rank name: %d(%s) to: %s", id2, TeamInfo[PlayerInfo[playerid][pMember]][fRank3],result);
strmid(TeamInfo[PlayerInfo[playerid][pMember]][fRank3], (result), 0, strlen((result)), 128);
SendClientMessage(playerid, COLOR_GREEN, string);
SaveFactions();
format(string, sizeof(string), "Leader %s change rank name: %d(%s) to: %s", GetName(playerid), id2, TeamInfo[PlayerInfo[playerid][pMember]][fRank3],result);
SendFactionMessage(PlayerInfo[playerid][pMember], COLOR_GREEN, string);
}
else if(id2 == 4)
{
format(string, sizeof(string), "Information - You change rank name: %d(%s) to: %s", id2, TeamInfo[PlayerInfo[playerid][pMember]][fRank4],result);
strmid(TeamInfo[PlayerInfo[playerid][pMember]][fRank4], (result), 0, strlen((result)), 128);
SendClientMessage(playerid, COLOR_GREEN, string);
SaveFactions();
format(string, sizeof(string), "Leader %s change rank name: %d(%s) to: %s", GetName(playerid), id2, TeamInfo[PlayerInfo[playerid][pMember]][fRank4],result);
SendFactionMessage(PlayerInfo[playerid][pMember], COLOR_GREEN, string);
}
else if(id2 == 5)
{
format(string, sizeof(string), "Information - You change rank name: %d(%s) to: %s", id2, TeamInfo[PlayerInfo[playerid][pMember]][fRank5],result);
strmid(TeamInfo[PlayerInfo[playerid][pMember]][fRank5], (result), 0, strlen((result)), 128);
SendClientMessage(playerid, COLOR_GREEN, string);
SaveFactions();
format(string, sizeof(string), "Leader %s change rank name: %d(%s) to: %s", GetName(playerid), id2, TeamInfo[PlayerInfo[playerid][pMember]][fRank5],result);
SendFactionMessage(PlayerInfo[playerid][pMember], COLOR_GREEN, string);
}
else if(id2 == 6)
{
format(string, sizeof(string), "Information - You change rank name: %d(%s) to: %s", id2, TeamInfo[PlayerInfo[playerid][pMember]][fRank6],result);
strmid(TeamInfo[PlayerInfo[playerid][pMember]][fRank6], (result), 0, strlen((result)), 128);
SendClientMessage(playerid, COLOR_GREEN, string);
SaveFactions();
format(string, sizeof(string), "Leader %s change rank name: %d(%s) to: %s", GetName(playerid), id2, TeamInfo[PlayerInfo[playerid][pMember]][fRank6],result);
SendFactionMessage(PlayerInfo[playerid][pMember], COLOR_GREEN, string);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Undefined symbol: | ");
}
}
}
}
return 1;
}