06.07.2018, 11:06
Код:
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; }
It`s look like work when I type it.But sscanf give me warning:
Код:
sscanf warning: Format specifier does not match parameter count.
Код:
if(sscanf(params, "is", id,Cause))return SendClientMessage(playerid, -1, "投票踢人/vote [玩家ID] [理由]");