Undercover command
#1

pawn Код:
CMD:undercover(playerid, params[])
{
    if (GetFactionType(playerid) != FACTION_POLICE)
        return SendErrorMessage(playerid, "You must be a police officer.");

    switch (listitem)
    {
        case 0:
        {
            PlayerData[playerid][pClothesType] = 1;

            switch (PlayerData[playerid][pGender])
            {
                 case 1:
                    ShowModelSelectionMenu(playerid, "Clothes", MODEL_SELECTION_CLOTHES, g_aMaleSkins, sizeof(g_aMaleSkins), -16.0, 0.0, -55.0);

                case 2:
                    ShowModelSelectionMenu(playerid, "Clothes", MODEL_SELECTION_CLOTHES, g_aFemaleSkins, sizeof(g_aFemaleSkins), -16.0, 0.0, -55.0);
                }
                }
    }
    return 1;
}
pawn Код:
Dialog:Undercover(playerid, response, listitem, inputtext[])
{
    switch (listitem)
    {
        case 0:
        {
            PlayerData[playerid][pClothesType] = 1;

            switch (PlayerData[playerid][pGender])
            {
                case 1:
                    ShowModelSelectionMenu(playerid, "Clothes", MODEL_SELECTION_CLOTHES, g_aMaleSkins, sizeof(g_aMaleSkins), -16.0, 0.0, -55.0);

                case 2:
                    ShowModelSelectionMenu(playerid, "Clothes", MODEL_SELECTION_CLOTHES, g_aFemaleSkins, sizeof(g_aFemaleSkins), -16.0, 0.0, -55.0);
            }
            }
    }
    return 1;
}
Current error:
pawn Код:
error 017: undefined symbol "listitem"

Okay so, I am creating a undercover command that is restricted to Police factions only. Basically, I need the command to be doing this: When the player type in the command he will get the dialog where he can click on the skin he want. Then he will receive the skin. Do I have to use dialog or I need the command only? If someone is able to remake the command and the dialog if needed, I would be very thankful.
Reply
#2

Remove the "switch (listitem)" part from the command.
Reply
#3

I tried to remove it but here are the errors:
pawn Код:
(33561) : error 014: invalid statement; not in switch
(33561) : warning 215: expression has no effect
(33561) : error 001: expected token: ";", but found ":"
(33561) : error 029: invalid expression, assumed zero
(33561) : fatal error 107: too many error messages on one line
Reply
#4

pawn Код:
CHange Dialog:Undercover(playerid, response, listitem, inputtext[])
{
    switch (listitem)
    {
        case 0:
        {
            PlayerData[playerid][pClothesType] = 1;

            switch (PlayerData[playerid][pGender])
            {
                case 1:
                    ShowModelSelectionMenu(playerid, "Clothes", MODEL_SELECTION_CLOTHES, g_aMaleSkins, sizeof(g_aMaleSkins), -16.0, 0.0, -55.0);

                case 2:
                    ShowModelSelectionMenu(playerid, "Clothes", MODEL_SELECTION_CLOTHES, g_aFemaleSkins, sizeof(g_aFemaleSkins), -16.0, 0.0, -55.0);
            }
            }
    }
    return 1;
}









To

Dialog:Undercover(playerid, response, listitem, inputtext[])
{
    PlayerData[playerid][pClothesType] = 1;
    switch (PlayerData[playerid][pGender])
    {
        case 1:
            ShowModelSelectionMenu(playerid, "Clothes", MODEL_SELECTION_CLOTHES, g_aMaleSkins, sizeof(g_aMaleSkins), -16.0, 0.0, -55.0);
        case 2:
            ShowModelSelectionMenu(playerid, "Clothes", MODEL_SELECTION_CLOTHES, g_aFemaleSkins, sizeof(g_aFemaleSkins), -16.0, 0.0, -55.0);
    }
    return 1;
}
Reply
#5

What about the command? It keeps giving the error
pawn Код:
error 017: undefined symbol "listitem"
Reply
#6

pawn Код:
CMD:undercover(playerid, params[])
{
    if (GetFactionType(playerid) != FACTION_POLICE)
        return SendErrorMessage(playerid, "You must be a police officer.");

    PlayerData[playerid][pClothesType] = 1;

    switch (PlayerData[playerid][pGender])
    {
        case 1:
            ShowModelSelectionMenu(playerid, "Clothes", MODEL_SELECTION_CLOTHES, g_aMaleSkins, sizeof(g_aMaleSkins), -16.0, 0.0, -55.0);

        case 2:
            ShowModelSelectionMenu(playerid, "Clothes", MODEL_SELECTION_CLOTHES, g_aFemaleSkins, sizeof(g_aFemaleSkins), -16.0, 0.0, -55.0);
    }
    return 1;
}
Reply
#7

Thank you, Emmet_ but when I click on the skin I want, nothing happens. My skin doesn't change, just the menu is closed.
Reply
#8

ever heard of??
pawn Код:
ShowModelSelectionMenu(playerid, ListID, header_text[], dialogBGcolor = 0x4A5A6BBB, previewBGcolor = 0x88888899 , tdSelectionColor = 0xFFFF00AA)

forward OnPlayerModelSelection(playerid, response, listid, modelid);

public OnPlayerModelSelection(playerid, response, listid, modelid)
{
return 1;
}
Reply
#9

Quote:
Originally Posted by Quickie
Посмотреть сообщение
ever heard of??
pawn Код:
ShowModelSelectionMenu(playerid, ListID, header_text[], dialogBGcolor = 0x4A5A6BBB, previewBGcolor = 0x88888899 , tdSelectionColor = 0xFFFF00AA)

forward OnPlayerModelSelection(playerid, response, listid, modelid);

public OnPlayerModelSelection(playerid, response, listid, modelid)
{
return 1;
}
Where do I put it in?
Reply
#10

Create a dialog response of MODE_SELECTION_CLOTHES, and simply set skin, i expect you know how to.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)