Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Problem with this command

$
0
0
I wanna make command for myself setting prefix.
There is the command
Code:

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
Code:

#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;
        }


Viewing all articles
Browse latest Browse all 18226

Trending Articles