Argument Type Mismatch
#1

Код:
CMD:unban(playerid, params[])
{
    new targetname[24], filestring[79];
    if(sscanf(params, "s[24]", targetname)) return SendClientMessage(playerid, TOMATO, "[USAGE]: {FFFFFF}/unban [Player's Name]");
    format(filestring, sizeof(filestring), "/Users/%s.ini", targetname);
    if(!fexist(filestring)) return SendClientMessage(playerid, RED, "[ERROR]: {FFFFFF}Player name not found in database.");
    else
    {
    new INI: 
    File = INI_Open(UserPath(filestring));
    INI_SetTag(File, "data");
    INI_WriteInt(File, "Banned", 0);
    INI_Close(File);
    new done[128];
    format(done, sizeof(done), "[UNBAN]: {FFFFFF}You have unbanned the account %s", targetname);
    SendClientMessage(playerid,GREEN , done);
    }
    return 1;
}
Trying to make an offline unban command but get this error

Код:
error 035: argument type mismatch (argument 1)
Reply
#2

I haven't worked with INI as far as I remember, however I suggest you to try changing filestring with targetname in UserPath().
Reply
#3

PHP код:
new INI
    
File INI_Open(filestring); 
or

PHP код:
new INI
    
File INI_Open(UserPath(targetid)); //not the name the id of the target! 
Reply
#4

Replacing it to targetid or targetname doesn't fix it, still the same error. How can we use target id when the player is offline? This is an unban command.
Reply
#5

Sorry, didn't see your first code. It's fixed after changing it to

Код:
new INI:  
    File = INI_Open(filestring);
Repped.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)