SERVER Unknown command ??!
#1

i get server unknown command in my /rangeban command...
but it send %s Has been range banned and also it doesn't save D:

PHP код:
CMD:rangeban(playerid,params[])
{
    new 
TargetID;
    new 
Reason[128];
     new 
File:File;
     new 
String[256];
    if(
PlayerInfo[playerid][Adminlevel] >= 3)
    {
        if(!
sscanf(params,"rs[128]",TargetID,Reason))
        {
            
File fopen("UACNR/Bans/Range.txt"io_readwrite);
            
format(String,256,"%s{FFFFFF} has been range-banned ({FF0000}%s{FFFFFF}).",PlayerName(TargetID),Reason);
            
SendClientMessageToAll(Red,String);
            
Kick(TargetID);
            
format(String,256,"%s //(Name: %s)-(Reason: %s)/r/n",GetRangeIp(TargetID),PlayerName(TargetID),Reason);
            
fwrite(File,String);
            
fclose(File);
        }
        else return 
SendClientMessage(playerid,White,"USAGE: {FF0000}/rangeban [Target ID] [Reason]");
    }
    else return 
SendClientMessage(playerid,Red,"Server:- {FFFFFF}you can't excute this command.");
    return 
1;

Reply
#2

Only just saw your PM, sorry for the late response. Give this a try:
pawn Код:
CMD:rangeban(playerid,params[])
{
    new TargetID, Reason[80], String[150];
    if(PlayerInfo[playerid][Adminlevel] < 3) return SendClientMessage(playerid,Red,"Server:- {FFFFFF}you can't excute this command.");
    if(sscanf(params,"us[80]",TargetID,Reason)) return SendClientMessage(playerid,White,"USAGE: {FF0000}/rangeban [Target ID] [Reason]");
    format(String,150,"%s{FFFFFF} has been range-banned ({FF0000}%s{FFFFFF}).",PlayerName(TargetID),Reason);
    SendClientMessageToAll(Red,String);
    new File:myfile = fopen("UACNR/Bans/Range.txt", io_append);
    format(String,150,"%s //(Name: %s)-(Reason: %s)/r/n",GetRangeIp(TargetID),PlayerName(TargetID),Reason);
    fwrite(myfile,String);
    fclose(myfile);
    BanEx(TargetID, "Range Ban");
    return 1;
}
Reply
#3

it don't save or even ban D: and still send me a Server Unknown Command D:
Reply
#4

You're not using a mixtures of ZCMD and strcmp or something in the same script are you? If not, show me your OnPlayerCommandReceived and OnPlayerCommandPerformed function. If you don't have these, or you don't think these are causing the problem, look at your server log, and see if there are any errors appearing in the log, when or after you type the command /rangeban.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)