SA-MP Forums Archive
/oban dont work - 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: /oban dont work (/showthread.php?tid=502700)



/oban dont work - Blackazur - 25.03.2014

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;
}



Re: /oban dont work - park4bmx - 25.03.2014

because it crashes silently !
debug it


AW: /oban dont work - Blackazur - 25.03.2014

Dont you see a bug there?


Re: /oban dont work - Konstantinos - 25.03.2014

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


AW: /oban dont work - Blackazur - 25.03.2014

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