SA-MP Forums Archive
Tag mismatch - 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: Tag mismatch (/showthread.php?tid=493995)



Tag mismatch - DarkLored - 11.02.2014

So i have attempted to make my own ban system so while i was making it the problem was when i open the player file and set the player as unbanned it says that its tag mismatch when i compile and i use Yini

here is my code for unban
pawn Код:
CMD:unban(playerid, params[])
{
   new unbanname[MAX_PLAYER_NAME];
   if(pInfo[playerid][Adminlevel] >= 4)
   {
      if(sscanf(params, "s[24]", unbanname)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /unban [name]");
      new INI:file = INI_Open(Path(unbanname));
          INI_WriteInt(file,"Banned",0);
          INI_Close(file);
      SendClientMessage(playerid,COLOR_LIME,"You unbanned this player");
   }
   return 1;
}
this is the line that the error is at
pawn Код:
new INI:file = INI_Open(Path(unbanname));
here is the error
pawn Код:
TDMv1.0.pwn(1299) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase



Re: Tag mismatch - Kirollos - 11.02.2014

can you show me your macro/stock of Path() ?


Re: Tag mismatch - DarkLored - 11.02.2014

Here is the stock
pawn Код:
stock Path(playerid) //Will create a new stock so we can easily use it later to load/save user's data in user's path
{
    new str[128],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(str,sizeof(str),UserPath,name);
    return str;
}



Re: Tag mismatch - Kirollos - 11.02.2014

Alright, the stock you got is Path(playerid) where it requires the ID of the player.

and in your unban command, you wrote Path(unbanname) where unbanname is the name not the ID.

Therefore make another stock for it:

pawn Код:
stock PathEx(playername[])
{
    new str[128];
    format(str,sizeof(str),UserPath,playername);
    return str;
}
Then in your unban command use PathEx(unbanname);


Re: Tag mismatch - DarkLored - 11.02.2014

Thanks for your time and help +1