Unknown Command ???
#1

I have updated my script but when i use any commands it gives me
Server: Unknown command
And there is more than 20 commands and all don't work ?
Please help !
Reply
#2

Did you type return 1 at the end of each command?

Also, show the last 3 lines of your gamemode
Reply
#3

Yes here is an example
PHP код:
CMD:setlevel(playerid, params[])
{
    new 
targetid, level, string[128];
    if(
PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_RED, "Command not found on server! /help");
    if(
sscanf(params,"ui", targetid, level)) return SendClientMessage(playerid, COLOR_RED,"Administrator level: /setlevel (id) (level)");
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "Player is not connected to the server");
    if(
level < 0) return SendClientMessage(playerid, COLOR_RED, "You have filled in an invalid administrator level (below minimum level)");
    if(
level > 5) return SendClientMessage(playerid, COLOR_RED, "You have filled in an invalid administrator level (above maximum level)");
    if(
LoggedIn[targetid] == false) return SendClientMessage(playerid, COLOR_RED, "Player is not logged in his account");
    if(
PlayerInfo[playerid][pAdmin] == 5 || IsPlayerAdmin(playerid))
    {
         switch(
level)
        {
            case 
0: LevelName = ADMIN_LEVEL_0;
             case 
1: LevelName = ADMIN_LEVEL_1;
              case 
2: LevelName = ADMIN_LEVEL_2;
             case 
3: LevelName = ADMIN_LEVEL_3;
              case 
4: LevelName = ADMIN_LEVEL_4;
              case 
5: LevelName = ADMIN_LEVEL_5;
        }
    }
    
format(string, sizeof(string), "Administrator %s has set level %s to %s", PlayerName(playerid), PlayerName(targetid), LevelName);
    
SendToAdmins(COLOR_RED, string);
    new 
INI:File = INI_Open(UserPath(targetid));
    
INI_SetTag(File,"data");
    
INI_WriteInt(File,"Admin",level);
    
INI_Close(File);
       return 
1;
} 
Reply
#4

You're not supposed to use zcmds inside OnPlayerCommandText callback, make sure that.
Reply
#5

Is this a filterscript?
Reply
#6

Nothing !
Reply
#7

no it is my gamemode
Reply
#8

How many command processors do you have included in your script?
Reply
#9

all my includes
PHP код:
#include <a_samp>
#include <sscanf2>
#include <zcmd>
#include <YSI\y_ini>
#include <streamer>
#include <cpstream>
#include <foreach> 
Reply
#10

post your
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
public OnPlayerCommandReceived(playerid, cmdtext[])
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)