Why does this not work?
#5

Quote:
Originally Posted by JohnTravis
Посмотреть сообщение
How can I do that? Since every player will have different list so i cant listitem 0++.

I tried this and now there is just one message but Wallet1 gives Wallet1 message, Wallet3 gives Wallet2 message.
It's an issue with strcmp. Since the Wallet2 variable is empty for non-admins, strcmp will assume that the strings match. Try this:

pawn Код:
case DIALOG_P:
{
    if(response)
    {
        if(!strcmp(inputtext, Wallet[playerid], true) && strlen(inputtext) == strlen(Wallet[playerid]))
        {
            SendClientMessage(playerid,COLOR_WHITE2,"You Picked Wallet1");
        }
        else if(!strcmp(inputtext, Wallet2[playerid], true) && strlen(inputtext) == strlen(Wallet2[playerid]))
        {
             SendClientMessage(playerid,COLOR_WHITE2,"You Picked Wallet2");
        }
        else if(!strcmp(inputtext, Wallet3[playerid], true) && strlen(inputtext) == strlen(Wallet3[playerid]))
        {
            SendClientMessage(playerid,COLOR_WHITE2,"You Picked  Wallet3");
        }
    }
Reply


Messages In This Thread
Why does this not work? - by JohnTravis - 18.05.2013, 08:03
Re: Why does this not work? - by Emmet_ - 18.05.2013, 08:11
AW: Why does this not work? - by BigETI - 18.05.2013, 08:15
Re: Why does this not work? - by JohnTravis - 18.05.2013, 08:18
Re: Why does this not work? - by Emmet_ - 18.05.2013, 08:23
Re: Why does this not work? - by ]Rafaellos[ - 18.05.2013, 08:24
Re: Why does this not work? - by JohnTravis - 18.05.2013, 08:25
AW: Why does this not work? - by BigETI - 18.05.2013, 08:29
Re: AW: Why does this not work? - by Emmet_ - 18.05.2013, 08:33
Re: Why does this not work? - by JohnTravis - 18.05.2013, 11:19

Forum Jump:


Users browsing this thread: 2 Guest(s)