sscanf warning: Format specifier does not match parameter count.
#1

Код:
CMD:vote(playerid, params[])
{
    if(IsVote==true) return Dialog(playerid,999,DIALOG_STYLE_MSGBOX,"{FF0000}警告","{FF0000}投票正在进行中!\n输入/true同意,输入/false则不同意","Okay","");
    new id,Cause[999];
    if(sscanf(params, "is", id,Cause))return SendClientMessage(playerid, -1, "投票踢人/vote [玩家ID] [理由]");
    if(PlayerInfo[id][pLogin]==0) return Dialog(playerid,999,DIALOG_STYLE_MSGBOX,"{FF0000}警告","{FF0000}这个玩家未登录\n\n按Tab查看玩家ID","Okay","");
    if(playerid==id) return Dialog(playerid,999,DIALOG_STYLE_MSGBOX,"{FF0000}警告","{FF0000}没想到真的有人傻到自己踢自己","Okay","");
    new string[128], pName[MAX_PLAYER_NAME],pName2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    GetPlayerName(id, pName2, MAX_PLAYER_NAME);
    format(string, sizeof(string), "{FF0000}投票:%s 请求踢出 %s,理由:%s",pName,pName2,Cause);
	SendClientMessageToAll(-1,string);
	SendClientMessageToAll(-1,"{FF0000}同意请输入/true,不同意则输入/false");
	VoteID=id;
    VoteYes=0;
    VoteNo=0;
    IsVote=true;
    foreach(new i : Player)
    {
    IsJoinVote[i]=false;
    }
    VoteTimer=SetTimer("VoteEnd", 60000, false);
    return 1;
}
I try to make a vote kick system...
It`s look like work when I type it.But sscanf give me warning:
Код:
sscanf warning: Format specifier does not match parameter count.
This line error.I don`t know how to fix it =_=
Код:
if(sscanf(params, "is", id,Cause))return SendClientMessage(playerid, -1, "投票踢人/vote [玩家ID] [理由]");
Reply
#2

Код:
if(sscanf(params, "is[999]", id, Cause)) return SendClientMessage(playerid, -1, "投票踢人/vote [玩家ID] [理由]");
Try this
Reply
#3

Quote:
Originally Posted by Mike861
Посмотреть сообщение
Код:
if(sscanf(params, "is[999]", id, Cause)) return SendClientMessage(playerid, -1, "投票踢人/vote [玩家ID] [理由]");
Try this
Useful!!!Thank you for your help!!!
Reply
#4

Quote:
Originally Posted by 3417512908
Посмотреть сообщение
Useful!!!Thank you for your help!!!
Did it work?
Reply
#5

Quote:
Originally Posted by Mike861
Посмотреть сообщение
Did it work?
Yes it worked:d
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)