24.08.2013, 12:50
Good day, I've got a slight problem with my /bano command... it returns an error that I have no idea how to fix. Here's the code for the offline ban command:
And the error that it returns is stated below:
Line 705 is stated in the pawn code. I'd appreciate it if anyone could help me, thanks!
PS: I'm not too good with YSI, I only started learning it this morning .
pawn Код:
YCMD:bano(playerid, params[], help)
{
if(help)
{
SendClientMessage(playerid, COLOR_WHITE, "{AFAFAF}Command /bano: {FFFFFF}Bans a player who is offline.");
}
else
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new string[158], reason[120], targetname[24], filestring[79];
if(sscanf(params, "s[24]s[120]", targetname, reason)) return SendClientMessage(playerid, COLOR_WHITE, "{AFAFAF}Syntax: {FFFFFF}/bano [fullname] [reason]");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(filestring, sizeof(filestring), "/Users/%s.ini", targetname);
if(!fexist(filestring)) return SendClientMessage(playerid, COLOR_WHITE, "{AFAFAF}Error: {FFFFFF}Player doesn't exist.");
else
{
new INI:File = INI_Open(UserPath(filestring)); // line 705 (error line)
INI_SetTag(File, "data");
INI_RemoveEntry(File, "Banned");
INI_WriteInt(File, "Banned", 1);
INI_Close(File);
format(string, sizeof(string), "{FF6347}Admin %s banned the offline player %s, reason: %s", sendername, targetname, reason);
SendClientMessageToAll(COLOR_WHITE, string);
}
} else { SendClientMessage(playerid, COLOR_WHITE, ""MinimumAdmin1""); return 1; }
}
return 1;
}
Quote:
...(705) : error 035: argument type mismatch (argument 1) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. |
PS: I'm not too good with YSI, I only started learning it this morning .