SA-MP Forums Archive
Unknown Command ??? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Unknown Command ??? (/showthread.php?tid=557567)



Unknown Command ??? - nezo2001 - 14.01.2015

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 !


Re: Unknown Command ??? - ATGOggy - 14.01.2015

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

Also, show the last 3 lines of your gamemode


Re: Unknown Command ??? - nezo2001 - 14.01.2015

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;




Re: Unknown Command ??? - Ironboy - 14.01.2015

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


Re: Unknown Command ??? - ATGOggy - 14.01.2015

Is this a filterscript?


Re: Unknown Command ??? - nezo2001 - 14.01.2015

Nothing !


Re: Unknown Command ??? - nezo2001 - 14.01.2015

no it is my gamemode


Re: Unknown Command ??? - Accent - 14.01.2015

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


Re: Unknown Command ??? - nezo2001 - 14.01.2015

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



Re: Unknown Command ??? - xVIP3Rx - 14.01.2015

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