Unban command help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Unban command help (
/showthread.php?tid=348849)
Unban command help -
Face9000 - 06.06.2012
Hello,i coded this !unban cmd for IRC,but i get 2 errors:
4660 : error 035: argument type mismatch (argument 1)
4661 : error 035: argument type mismatch (argument 1)
Full code:
pawn Код:
IRCCMD:unban(botid, channel[], user[], host[], params[])
{
if(IRC_IsOp(botid,channel,user))
{
new tmp[24];
new msg[100];
if(!strlen(params)) return IRC_GroupSay(gGroupID, channel,"4Error: You didnt type a name");
if(!fexist(UserPath(tmp))) return IRC_GroupSay(gGroupID, channel,"* Sorry, Account not found.");
new INI:File = INI_Open(UserPath(tmp));
INI_WriteInt(File, "Banned", 0);
INI_Close(File);
format(msg,sizeof msg,"2Success. - Account %s Unbanned -",tmp);
IRC_GroupSay(gGroupID,IRC_CHANNEL,msg);
}else IRC_GroupSay(gGroupID, channel,"4Error: You must be operator to use this command.");
return 1;
}
Line 4660:
pawn Код:
if(!fexist(UserPath(tmp))) return IRC_GroupSay(gGroupID, channel,"* Sorry, Account not found.");
Line 4661:
pawn Код:
new INI:File = INI_Open(UserPath(tmp));
I use Y_INI,what's wrong?
Re: Unban command help -
milanosie - 06.06.2012
Something wrong with UserPath(tmp)
Re: Unban command help -
Face9000 - 06.06.2012
Quote:
Originally Posted by milanosie
Something wrong with UserPath(tmp)
|
UserPath is where the players file located at.
Re: Unban command help -
milanosie - 06.06.2012
Quote:
Originally Posted by Logitech90
UserPath is where the players file located at.
|
Well yeah but it gives a warning on both sentences where UserPath(tmp) is,
So something is probably wrong with that,
Re: Unban command help -
Face9000 - 06.06.2012
Quote:
Originally Posted by milanosie
Well yeah but it gives a warning on both sentences where UserPath(tmp) is,
So something is probably wrong with that,
|
Ok then,let's wait for someone.
Re: Unban command help -
milanosie - 06.06.2012
What is tmp defined as?
I only see it being created,
Re: Unban command help -
Face9000 - 06.06.2012
Quote:
Originally Posted by milanosie
What is tmp defined as?
I only see it being created,
|
Tmp is playername.
Re: Unban command help -
milanosie - 06.06.2012
pawn Код:
new tmp[24];
new msg[100];
if(!strlen(params)) return IRC_GroupSay(gGroupID, channel,"4Error: You didnt type a name");
if(!fexist(UserPath(tmp))) return IRC_GroupSay(gGroupID, channel,"* Sorry, Account not found.");
new INI:File = INI_Open(UserPath(tmp));
INI_WriteInt(File, "Banned", 0);
I'm not familier with Y_Ini but I do not see a playername?
Re: Unban command help -
Face9000 - 06.06.2012
Quote:
Originally Posted by milanosie
pawn Код:
new tmp[24]; new msg[100]; if(!strlen(params)) return IRC_GroupSay(gGroupID, channel,"4Error: You didnt type a name"); if(!fexist(UserPath(tmp))) return IRC_GroupSay(gGroupID, channel,"* Sorry, Account not found."); new INI:File = INI_Open(UserPath(tmp)); INI_WriteInt(File, "Banned", 0);
I'm not familier with Y_Ini but I do not see a playername?
|
I want read the player name file (so an offline player),not the online.