/oban dont work
#1

Hello, why my /oban dont work if i type /oban all works and if i type /oban randomplayername which dont exist it knows it. but if i a player is registered with the name "Guest" for example and i type /oban "Guest" it shows "SERVER: Unknown command". Why?

Код:
CMD:oban(playerid, params[])
{
    new tname[24], filestring[79];
    if(sscanf(params, "s[24]", tname)) return SendClientMessage(playerid,-1,""chat" Usage: /oban [playername]");
    format(filestring, sizeof(filestring), "/Users/%s.ini", tname);
    if(!fexist(filestring)) return SendClientMessage(playerid,-1,""chat""COL_RED" This player does not exist.");
    else
    {
        new INI:File = INI_Open(filestring);
        INI_SetTag(File, "data");
        INI_WriteInt(File, "pBanned", 1);
        INI_Close(File);
        INI_ParseFile(filestring, "LoadIP_%s", .bExtra = true , .extra = playerid);
        new cmdstring[44];
        format(cmdstring, sizeof(cmdstring), "banip %s", pInfo[playerid][BannedIP]);
        SendRconCommand(cmdstring);
        new str[128];
        format(str,sizeof(str),""chat""COL_RED" %s %s (%d) has offline banned %s",GetAdminName(playerid),PlayerName(playerid),playerid,tname);
        SendClientMessageToAll(-1,str);
    }
    return 1;
}
Reply
#2

because it crashes silently !
debug it
Reply
#3

Dont you see a bug there?
Reply
#4

Some of the run time errors cannot be found that easily by just looking the code. Use crashdetect and debug info for more information.

https://github.com/Zeex/samp-plugin-...es/tag/v4.13.1
https://github.com/Zeex/samp-plugin-...ith-debug-info

And use the name without quotes (""): /oban Guest
Reply
#5

But cant you see a mistake there? I dont understand how.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)