Help with Command setleader
#1

pawn Code:
CMD:setleader(playerid, params[]) {
    if(playerVariables[playerid][pAdminLevel] >= 3) {
        new
            groupID,
            userID;

        if(sscanf(params, "ud", userID, groupID)) {
            return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/setleader [playerid] [groupid]");
        }
        else {
            if(groupID < 1 || groupID > MAX_GROUPS) return SendClientMessage(playerid, COLOR_GREY, "Invalid group ID.");

            playerVariables[userID][pGroup] = groupID;
            playerVariables[userID][pGroupRank] = 6;

            new

                string[128];

            GetPlayerName(userID, szPlayerName, MAX_PLAYER_NAME);

            format(string, sizeof(string), "You have set %s to lead group %s.", szPlayerName, groupVariables[groupID][gGroupName]);
            SendClientMessage(playerid, COLOR_WHITE, string);

            GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);

            format(string, sizeof(string), "Administrator %s has set you to lead group %s.", szPlayerName, groupVariables[groupID][gGroupName]);
            SendClientMessage(userID, COLOR_WHITE, string);
        }
    }

    return 1;
}
When I type in /setleader 0[ID] 1[GroupID] it says Server: Unknown Command. Help me please.
Reply
#2

Maybe try
pawn Code:
COMMAND:setleader(playerid, params[])
?
Reply
#3

The command format would not change anything..
Reply
#4

pawn Code:
CMD:setleader(playerid, params[])
{
    if(playerVariables[playerid][pAdminLevel] >= 3)
    {
        new
            groupID,
            userID;
        if(sscanf(params, "ud", userID, groupID)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/setleader [playerid] [groupid]");
        if(groupID < 1 || groupID > MAX_GROUPS) return SendClientMessage(playerid, COLOR_GREY, "Invalid group ID.");
        playerVariables[userID][pGroup] = groupID;
        playerVariables[userID][pGroupRank] = 6;
        new
        string[128];
        GetPlayerName(userID, szPlayerName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "You have set %s to lead group %s.", szPlayerName, groupVariables[groupID][gGroupName]);
        SendClientMessage(playerid, COLOR_WHITE, string);
        GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "Administrator %s has set you to lead group %s.", szPlayerName, groupVariables[groupID][gGroupName]);
        SendClientMessage(userID, COLOR_WHITE, string);
    }
    return 1;
}
Reply
#5

Comment your command with at start /* and */ at end
And add blank cmd
pawn Code:
CMD:setleader(playerid, params[])
{
    return 1;
}
I guess its says Unknown command again...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)