sscanf warning: Strings without a length are deprecated, please add a destination size. *** YSI Error: INI_Open could not find or create file /Bans/Test_Player.ini
CMD:ban(playerid,parmas[]) { if(pInfo[playerid][pAdminLevel] >= 3) { new tid,du,res[150],ppp[50]; if(sscanf(parmas,"uis",tid,du,res) || isnull(parmas))return SendClientMessage(playerid,-1,"{ff0000}Wrong Usage || Correct Usage : /ban id duration(In Days) Reason"); if(!IsPlayerConnected(tid))return SendClientMessage(playerid,-1,"{ff6666}The Player you requested is not connected."); new banmt[300],banma[300],adminname[MAX_PLAYER_NAME],targetn[MAX_PLAYER_NAME]; GetPlayerName(playerid,adminname,sizeof(adminname)); new exp=gettime()+(60*60*24*du); GetPlayerIp(tid,ppp,sizeof(ppp)); new INI:File = INI_Open(UserBanPath(tid)); INI_SetTag(File,"data"); INI_WriteInt(File,"Banexp",exp); INI_WriteInt(File,"BanPerm",0); INI_WriteString(File,"BanAdmin",adminname); INI_WriteString(File,"Reason",res); INI_WriteString(File,"IP",ppp); INI_Close(File); GetPlayerName(tid,targetn,sizeof(targetn)); new INI:iFile = INI_Open(UserIPPath(tid)); INI_SetTag(iFile,"data"); INI_WriteInt(iFile,"Banexp",exp); INI_WriteInt(iFile,"BanPerm",0); INI_WriteString(iFile,"BanPlayer",targetn); INI_WriteString(iFile,"BanAdmin",adminname); INI_WriteString(iFile,"Reason",res); INI_Close(iFile); new File:logg=fopen("BannedPlayers.txt",io_append); fwrite(logg, targetn); fwrite(logg,"\n"); fclose(logg); format(banmt,sizeof(banmt),"{ff0000}Admin %s has banned you for %i days due to %s",adminname,du,res); format(banma,sizeof(banma),"{ff0000}Admin %s has banned %s for %i days due to %s",adminname,targetn,du,res); SendClientMessage(tid,-1,banmt); SendClientMessageToAll(-1,banma); SetTimerEx("KickPlayer",100,false,"i",tid); } else SendClientMessage(playerid,-1,"{ff0000}You are not authorized to use this command."); return 1; }
CMD:ban(playerid,parmas[])
{
if(pInfo[playerid][pAdminLevel] >= 3)
{
new tid,du,res[150],ppp[50];
if(sscanf(parmas,"uis[150]",tid,du,res) || isnull(parmas))return SendClientMessage(playerid,-1,"{ff0000}Wrong Usage || Correct Usage : /ban id duration(In Days) Reason");
if(!IsPlayerConnected(tid))return SendClientMessage(playerid,-1,"{ff6666}The Player you requested is not connected.");
new banmt[300],banma[300],adminname[MAX_PLAYER_NAME],targetn[MAX_PLAYER_NAME];
GetPlayerName(playerid,adminname,sizeof(adminname));
new exp=gettime()+(60*60*24*du);
GetPlayerIp(tid,ppp,sizeof(ppp));
new INI:File = INI_Open(UserBanPath(tid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Banexp",exp);
INI_WriteInt(File,"BanPerm",0);
INI_WriteString(File,"BanAdmin",adminname);
INI_WriteString(File,"Reason",res);
INI_WriteString(File,"IP",ppp);
INI_Close(File);
GetPlayerName(tid,targetn,sizeof(targetn));
new INI:iFile = INI_Open(UserIPPath(tid));
INI_SetTag(iFile,"data");
INI_WriteInt(iFile,"Banexp",exp);
INI_WriteInt(iFile,"BanPerm",0);
INI_WriteString(iFile,"BanPlayer",targetn);
INI_WriteString(iFile,"BanAdmin",adminname);
INI_WriteString(iFile,"Reason",res);
INI_Close(iFile);
new File:logg=fopen("BannedPlayers.txt",io_append);
fwrite(logg, targetn);
fwrite(logg,"\n");
fclose(logg);
format(banmt,sizeof(banmt),"{ff0000}Admin %s has banned you for %i days due to %s",adminname,du,res);
format(banma,sizeof(banma),"{ff0000}Admin %s has banned %s for %i days due to %s",adminname,targetn,du,res);
SendClientMessage(tid,-1,banmt);
SendClientMessageToAll(-1,banma);
SetTimerEx("KickPlayer",100,false,"i",tid);
}
else SendClientMessage(playerid,-1,"{ff0000}You are not authorized to use this command.");
return 1;
}
[00:33:27] [debug] Run time error 6: "Invalid instruction" [00:33:27] [debug] Unknown opcode 0x3afa900 at address 0x00000038 [00:33:27] [debug] AMX backtrace: [00:33:27] [debug] #0 00000038 in public cmd_ban () from zma.amx [00:33:27] [debug] #1 native CallLocalFunction () from samp-server.exe [00:33:27] [debug] #2 00000748 in public OnPlayerCommandText (0, 7030768) from zma.amx [00:33:28] [chat] [Henry_Groc]: ha [00:33:33] [debug] Run time error 4: "Array index out of bounds" [00:33:33] [debug] Attempted to read/write array element at index 65535 in array of size 1000 [00:33:33] [debug] AMX backtrace: [00:33:33] [debug] #0 00031ec8 in public OnPlayerTakeDamage (0, 65535, 1084122727, 54, 3) from zma.amx [00:33:39] [debug] Run time error 4: "Array index out of bounds" [00:33:39] [debug] Attempted to read/write array element at index 65535 in array of size 1000 [00:33:39] [debug] AMX backtrace: [00:33:39] [debug] #0 00031ec8 in public OnPlayerTakeDamage (0, 65535, 1084122727, 54, 3) from zma.amx [00:34:09] [debug] Run time error 6: "Invalid instruction" [00:34:09] [debug] Unknown opcode 0x203af at address 0x00000032 [00:34:09] [debug] AMX backtrace: [00:34:09] [debug] #0 00000032 in public cmd_ban () from zma.amx [00:34:09] [debug] #1 native CallLocalFunction () from samp-server.exe [00:34:09] [debug] #2 00000748 in public OnPlayerCommandText (0, 7030768) from zma.amx [00:34:11] [debug] Run time error 4: "Array index out of bounds" [00:34:11] [debug] Attempted to read/write array element at negative index -1 [00:34:11] [debug] AMX backtrace: [00:34:11] [debug] #0 0001d084 in ?? (-1) from zma.amx [00:34:11] [debug] #1 0004a6f0 in ?? (0) from zma.amx [00:34:11] [debug] #2 00029b04 in public FIXES_OnPlayerDisconnect (0, 1) from zma.amx [00:34:11] [debug] #3 native CallLocalFunction () from samp-server.exe [00:34:11] [debug] #4 00023310 in public Streamer_OnPlayerDisconnect (0, 1) from zma.amx [00:34:11] [debug] #5 native CallLocalFunction () from samp-server.exe [00:34:11] [debug] #6 0002008c in public Itter_OnPlayerDisconnect (0, 1) from zma.amx [00:34:11] [debug] #7 native CallLocalFunction () from samp-server.exe [00:34:11] [debug] #8 00006efc in public SSCANF_OnPlayerDisconnect (0, 1) from zma.amx [00:34:11] [debug] #9 00000cf8 in public OnPlayerDisconnect (0, 1) from zma.amx
Do i have to repeat what i said above? che if the damn file is open before writing and come back here with report.
|