28.06.2015, 12:52
When I try to use /tempban or /banm, in-game it says "SERVER: Unknown command.", but in the logs it says this:
With /tempban
[14:49:16] [debug] Run time error 6: "Invalid instruction"
[14:49:16] [debug] Unknown opcode 0x54000000 at address 0x00000035
[14:49:16] [debug] AMX backtrace:
[14:49:16] [debug] #0 00000035 in public cmd_tempban () at <unknown file>:0
[14:49:16] [debug] #1 native CallLocalFunction () from samp-server.exe
[14:49:16] [debug] #2 0001d3fc in ?? (... <2 arguments>) at D:\SA-MP Things\SAMP 0.3.7\pawno\include\i-zcmd.inc:86
[14:49:16] [debug] #3 0000e738 in public OnPlayerCommandText (playerid=0, cmdtext[]=@021fad7c "/tempban 1 2 30 Hacker") at D:\SA-MP Things\SAMP 0.3.7\pawno\include\YSI\y_hooks/impl.inc:929
With /banm
[14:49:16] [debug] Run time error 6: "Invalid instruction"
[14:49:16] [debug] Unknown opcode 0x54000000 at address 0x00000035
[14:49:16] [debug] AMX backtrace:
[14:49:16] [debug] #0 00000035 in public cmd_banm () at <unknown file>:0
[14:49:16] [debug] #1 native CallLocalFunction () from samp-server.exe
[14:49:16] [debug] #2 0001d3fc in ?? (... <2 arguments>) at D:\SA-MP Things\SAMP 0.3.7\pawno\include\i-zcmd.inc:86
[14:49:16] [debug] #3 0000e738 in public OnPlayerCommandText (playerid=0, cmdtext[]=@021fad7c "/banm 1 2 30 Hacker") at D:\SA-MP Things\SAMP 0.3.7\pawno\include\YSI\y_hooks/impl.inc:929
Codes:
With /tempban
[14:49:16] [debug] Run time error 6: "Invalid instruction"
[14:49:16] [debug] Unknown opcode 0x54000000 at address 0x00000035
[14:49:16] [debug] AMX backtrace:
[14:49:16] [debug] #0 00000035 in public cmd_tempban () at <unknown file>:0
[14:49:16] [debug] #1 native CallLocalFunction () from samp-server.exe
[14:49:16] [debug] #2 0001d3fc in ?? (... <2 arguments>) at D:\SA-MP Things\SAMP 0.3.7\pawno\include\i-zcmd.inc:86
[14:49:16] [debug] #3 0000e738 in public OnPlayerCommandText (playerid=0, cmdtext[]=@021fad7c "/tempban 1 2 30 Hacker") at D:\SA-MP Things\SAMP 0.3.7\pawno\include\YSI\y_hooks/impl.inc:929
With /banm
[14:49:16] [debug] Run time error 6: "Invalid instruction"
[14:49:16] [debug] Unknown opcode 0x54000000 at address 0x00000035
[14:49:16] [debug] AMX backtrace:
[14:49:16] [debug] #0 00000035 in public cmd_banm () at <unknown file>:0
[14:49:16] [debug] #1 native CallLocalFunction () from samp-server.exe
[14:49:16] [debug] #2 0001d3fc in ?? (... <2 arguments>) at D:\SA-MP Things\SAMP 0.3.7\pawno\include\i-zcmd.inc:86
[14:49:16] [debug] #3 0000e738 in public OnPlayerCommandText (playerid=0, cmdtext[]=@021fad7c "/banm 1 2 30 Hacker") at D:\SA-MP Things\SAMP 0.3.7\pawno\include\YSI\y_hooks/impl.inc:929
Codes:
pawn Код:
CMD:tempban(playerid,parmas[])
{
if(PlayerInfo[playerid][pAdmin] < 7) return SendClientMessage(playerid, 0xFF0000AA, "You Are Not A Trusted Administrator Or Higher Rank!");
new tid,du,res[150],ppp[50];
if(sscanf(parmas,"uis[150]",tid,du,res) || isnull(parmas))return SendClientMessage(playerid,-1,"{ff0000}USAGE: /tempban [playerid] [Days] [Reason]");
if(!IsPlayerConnected(tid))return SendClientMessage(playerid,-1,"{ff6666}Player Is Not Connected.");
if(tid == playerid) return SendClientMessage(playerid, 0xFF0000AA, "You Cannot Temp-Ban Yourself!");
if(PlayerInfo[playerid][pAdmin] <= PlayerInfo[tid][pAdmin]) return SendClientMessage(playerid, 0xFF0000AA, "You Cannot Temp-Ban An Admin That Has A Higher/Same Rank!");
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),"The %s %s (%d) Has Temp-Banned You For %i Days | Reason: %s",AdmRank,adminname,playerid,du,res);
format(banma,sizeof(banma),"The %s %s (%d) Has Temp-Banned %s (%d) For %i Days | Reason: %s",AdmRank,adminname,playerid,targetn,tid,du,res);
SendClientMessage(tid, 0xFFC400AA, "If You Feel That You Are Wrongly Banned Feel Free To Post An Appeal In Our Forums: forum-lsgw.tk");
SendClientMessage(tid,0xFF0000AA,banmt);
SendClientMessageToAll(0x00FFFFFF,banma);
SetTimerEx("KickPlayer",100,false,"i",tid);
foreach(Player, i)
{
if(PlayerInfo[i][pAdmin] > 0)
{
new Message8[168];
format(Message8, sizeof(Message8), "[ADM] The {FF0000}%s {FF5900}%s (%d) Has Temp-Banned %s (%d) For %i Days | Reason: %s.",AdmRank, adminname, playerid, targetn, tid, du, res), SendClientMessage(i, 0xFF5900FF, Message8);
print(Message8);
}
}
return 1;
}
CMD:banm(playerid,parmas[])
{
if(PlayerInfo[playerid][pAdmin] < 7) return SendClientMessage(playerid, 0xFF0000AA, "You Are Not A Trusted Administrator Or Higher Rank!");
new tid,h,m,res[150],ppp[50];
if(sscanf(parmas,"uiis[150]",tid,h,m,res) || isnull(parmas))return SendClientMessage(playerid,0xFF0000AA,"USAGE: /banm [playerid] [Hours] [Minutes] [Reason]");
if(!IsPlayerConnected(tid))return SendClientMessage(playerid,0xFF0000AA,"Player Is Not Connected.");
if(tid == playerid) return SendClientMessage(playerid, 0xFF0000AA, "You Cannot Ban Yourself!");
if(PlayerInfo[playerid][pAdmin] <= PlayerInfo[tid][pAdmin]) return SendClientMessage(playerid, 0xFF0000AA, "You Cannot Ban An Admin That Has A Higher/Same Rank!");
new banmt[300],banma[300],adminname[MAX_PLAYER_NAME],targetn[MAX_PLAYER_NAME];
GetPlayerName(playerid,adminname,sizeof(adminname));
new exp=gettime()+(60*m)+(60*60*h);
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),"The %s %s (%d) Has Banned You For %i Hours %i Minutes | Reason: %s",AdmRank, adminname, playerid,h,m,res);
format(banma,sizeof(banma),"The %s %s (%d) Has Banned %s (%d) For %i Hours %i Minutes | Reason: %s",AdmRank, adminname, playerid,targetn,tid,h,m,res);
SendClientMessage(tid,0xFF0000AA,banmt);
SendClientMessageToAll(0x00FFFFFF,banma);
SetTimerEx("KickPlayer",100,false,"i",tid);
foreach(Player, i)
{
if(PlayerInfo[i][pAdmin] > 0)
{
new Message8[188];
format(Message8, sizeof(Message8), "[ADM] The {FF0000}%s {FF5900}%s (%d) Has Banned %s (%d) For %i Hours %i Minutes | Reason: %s.",AdmRank, adminname, playerid, targetn, tid, h,m,res), SendClientMessage(i, 0xFF5900FF, Message8);
print(Message8);
}
}
return 1;
}