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(playeridparams[])
{
    new 
targetidlevelstring[128];
    if(
PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playeridCOLOR_RED"Command not found on server! /help");
    if(
sscanf(params,"ui"targetidlevel)) return SendClientMessage(playeridCOLOR_RED,"Administrator level: /setlevel (id) (level)");
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_RED"Player is not connected to the server");
    if(
level 0) return SendClientMessage(playeridCOLOR_RED"You have filled in an invalid administrator level (below minimum level)");
    if(
level 5) return SendClientMessage(playeridCOLOR_RED"You have filled in an invalid administrator level (above maximum level)");
    if(
LoggedIn[targetid] == false) return SendClientMessage(playeridCOLOR_RED"Player is not logged in his account");
    if(
PlayerInfo[playerid][pAdmin] == || IsPlayerAdmin(playerid))
    {
         switch(
level)
        {
            case 
0LevelName ADMIN_LEVEL_0;
             case 
1LevelName ADMIN_LEVEL_1;
              case 
2LevelName ADMIN_LEVEL_2;
             case 
3LevelName ADMIN_LEVEL_3;
              case 
4LevelName ADMIN_LEVEL_4;
              case 
5LevelName ADMIN_LEVEL_5;
        }
    }
    
format(stringsizeof(string), "Administrator %s has set level %s to %s"PlayerName(playerid), PlayerName(targetid), LevelName);
    
SendToAdmins(COLOR_REDstring);
    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)