Tag mismatch
#1

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
Reply
#2

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

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;
}
Reply
#4

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);
Reply
#5

Thanks for your time and help +1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)