Speaking Tag
#1

So i have made a dialog which makes you be able to choose your tag you speak with in a certain channel.. But im having trouble doing it

Pretty much how could i make it so when you choose a option on the dialog it changes so when you speak in /newb the tag you choose come up

Please Help

I have this in my Player enum

pawn Код:
NewbTag
pawn Код:
command(newbie, playerid, params[])
{
    new
        string[128];

    if(isnull(params))
    {
        SendClientMessage(playerid, WHITE, "SYNTAX: /n(ewbie) [message]");
    }
    else
    {
        if(Player[playerid][PlayingHours] < 1)
        {
            format(string, sizeof(string), "[Newbie]%s %s says: %s", NewbTag, GetNameNoUnderScore(playerid), params);
            SendClientMessageToAll(PURPLE, string);
        }
    }
}
pawn Код:
command(setntag, playerid, params)
{
    if(Player[playerid][Mapper] == 1 && Player[playerid][PlayingHours] >= 1 && Player[playerid][PlayingHours] < 25)
    {
        ShowPlayerDialog(playerid, 980, DIALOG_STYLE_LIST, "Choose Your NTag", "Mapper\nPlayer", "Ok", "Close");
    }
}
This is on dialog response

pawn Код:
case 980:
            {
                switch(listitem)
                {
                    case 0:
                    {
                        SendClientMessage(playerid, WHITE, "You tag has changed to mapper"):
                        Player[playerid][NewbTag] = mapper;
                }
                }
So pretty much im trying to get it so what you choose in the dialog will appear as your tag in /newb please help me

Help Is Appreciated
Reply
#2

Why did you used 'case' ?
Reply
#3

Quote:
Originally Posted by Firo
Посмотреть сообщение
Why did you used 'case' ?
Is it wrong ? How can i make it so you can speak in /newb with what you selected ?

Help Is Appreciated
Reply
#4

pawn Код:
command(newbie, playerid, params[])
{
    new string[128];
    if(isnull(params))
    {
        SendClientMessage(playerid, WHITE, "SYNTAX: /n(ewbie) [message]");
    }
    else
    {
        if(Player[playerid][PlayingHours] < 1)
        {
            new NewbTag[10];
            switch(Player[playerid][NewbTag])
            {
                case 0: { NewbTag = "Mapper"; }
                case 1: { NewbTag = "Player"; }
            }
            format(string, sizeof(string), "[Newbie] %s %s says: %s", NewbTag, GetNameNoUnderScore(playerid), params);
            SendClientMessageToAll(PURPLE, string);
        }
    }
}
command(setntag, playerid, params)
{
    if(Player[playerid][Mapper] == 1 && Player[playerid][PlayingHours] >= 1 && Player[playerid][PlayingHours] < 25)
    {
        ShowPlayerDialog(playerid, 980, DIALOG_STYLE_LIST, "Choose Your NTag", "Mapper\nPlayer", "Ok", "Close");
    }
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case 980:
        {
            switch(listitem)
            {
                case 0:
                {
                    SendClientMessage(playerid, WHITE, "Your tag has been changed to Mapper"):
                    Player[playerid][NewbTag] = 1;
                    return 1;
                }
                case 1:
                {
                    SendClientMessage(playerid, WHITE, "Your tag has been changed to Player");
                    Player[playerid][NewbTag] = 2;
                }
            }
        }
    }
    return 0;
}
This is an example. This should work. This simply makes it so that if you selected Mapper, your NewbTag player variable is set to 1, and player is set to 2. So it checks the players variable, and labels them Mapper and Player when they use /newb.

Hope I helped (I may have done something wrong, very tired right now).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)