24.07.2013, 05:44
So I've made a baninfo command with ZCMD but I think there is something wrong in sscanf, that it would always return this message, "Couldn't find that user in our files." Seeking some help with the sscanf part. Below is my code.
pawn Код:
CMD:baninfo(playerid, params[])
{
new PlayerFile[50];
if(PlayerInfo[playerid][AdminLevel] < 2) return 0;
if(sscanf(params,"s[24]",params)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /baninfo [playername]");
format(PlayerFile, sizeof(PlayerFile), "Saves/%s.ini", params);
if(!dini_Exists(PlayerFile)) return SendClientMessage(playerid,COLOR_GREY,"Couldn't find that user in our files.");
if(dini_Int(PlayerFile,"Banned")==1)
{
new str[256];
SendClientMessage(playerid,COLOR_YELLOW,"_________________BAN INFO_______________");
format(str,sizeof(str),"%s was banned by %s",params,dini_Get(PlayerFile,"Banner"));
SendClientMessage(playerid, COLOR_WHITE, str);
format(str,sizeof(str),"Reason: {FFFFFF}%s",dini_Get(PlayerFile,"Reason"));
SendClientMessage(playerid,COLOR_YELLOW,str);
SendClientMessage(playerid,COLOR_YELLOW,"________________________________________");
}
else return SendClientMessage(playerid,COLOR_GREY,"That player isn't banned.");
return 1;
}