Problem with this command
#1

I wanna make command for myself setting prefix.
There is the command
Код:
CMD:hellixpower(playerid, params[])
{
        new playerName[MAX_PLAYER_NAME];
		GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
        if(!strcmp(playerName, "[mW]HellixBG", true, 12))
        {
    	new prefix[16];
        if ( sscanf ( params, "us", prefix)) return SendClientMessage(playerid, 0xFF0000FF, "Използвай: /hellixpower [текст]");
        new Name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
        dini_Set(LOCAL_TAGCONF, Name, prefix);
        }
        else return SCM(playerid, 0xFF0000FF, "ERROR: Грешна команда, моля проверете командите /cmds.");
        return 1;
}
And it says Unknown command
Help me
Код:
#define MAX_CHAR 50
#define LOCAL_TAGCONF "Tags/config.ini"
CheckPrefix(playerid)
{
        new pref[16], Name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
        format ( pref, sizeof ( pref ), dini_Get(LOCAL_TAGCONF, Name));
        return pref;
}

OnGameModeInit             if ( !fexist(LOCAL_TAGCONF))
        {
                dini_Create(LOCAL_TAGCONF);
                if ( !fexist(LOCAL_TAGCONF))
                {
                        print("Config.ini nao pode ser criado. ( Diretorio Inexistente )");
                        print("No diretorio scriptfiles crie uma pasta: TAGS");
                        return 1;
                }
        }
OnPlayerText
        if ( strcmp(CheckPrefix(playerid), "None", false))
        {
                new Str[128], Name[MAX_PLAYER_NAME];
                GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
                format ( Str, sizeof ( Str ), "{FF0000}[{FFFFFF}%s{FF0000}%s: %s", CheckPrefix(playerid), Name, text);
                SendClientMessageToAll(-1, Str);
                return 0;
        }
Reply


Messages In This Thread
Problem with this command - by HellixBG - 16.07.2017, 16:25
Re: Problem with this command - by HellixBG - 16.07.2017, 16:34
Re: Problem with this command - by FailerZ - 16.07.2017, 19:40
Re: Problem with this command - by HellixBG - 17.07.2017, 10:53
Re: Problem with this command - by Tass007 - 17.07.2017, 11:08
Re: Problem with this command - by FailerZ - 17.07.2017, 12:12

Forum Jump:


Users browsing this thread: 1 Guest(s)