SA-MP Forums Archive
OnPlayerText returns 1 whereas it souldn't - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnPlayerText returns 1 whereas it souldn't (/showthread.php?tid=105735)



OnPlayerText returns 1 whereas it souldn't - Coicatak - 30.10.2009

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(IsPlayerNPC(playerid)) return 1;
    new playername[MAX_PLAYER_NAME];
    new string[256];


    if(RegStep[playerid] > 0)
    {
        if(RegStep[playerid] == 1)
        {
            if(!strcmp("homme", text, true))
            {
                PlayerInfo[playerid][pSex] = SEX_MALE;
                SendClientMessage(playerid, YELLOW2, "D'accord, donc vous кtes un homme.");
                SendClientMessage(playerid, RED, "Deuxiиme question: Quel est votre date de naissance? (jj/mm/aaaa)");
                RegStep[playerid] = 2;
                RandomSkin(playerid);
            }
            else if(!strcmp("femme", text, true))
            {
                PlayerInfo[playerid][pSex] = SEX_FEMALE;
                SendClientMessage(playerid, YELLOW2, "D'accord, donc vous кtes une femme.");
                SendClientMessage(playerid, RED, "Deuxiиme question: Quel est votre date de naissance? (jj/mm/aaaa)");
                RegStep[playerid] = 2;
                RandomSkin(playerid);
            }
            else
            {
                SendClientMessage(playerid, RED, "Pardon? Tapez \"homme\" ou \"femme\".");
            }
        }

        else if(RegStep[playerid] == 2)
        {
                //some code here
        }
        return 0;
    }
    //some code here
    return 0;
}
Well when you type "homme" or "femme" it displays it on the chatbox (for instance Coicatak: homme) whereas it souldn't...

Any help please?


Re: OnPlayerText returns 1 whereas it souldn't - gemadon - 31.10.2009

Put return 0 under the RandomSkin, both of them


Re: OnPlayerText returns 1 whereas it souldn't - Coicatak - 31.10.2009

I tried this also it still does the same...


Re: OnPlayerText returns 1 whereas it souldn't - Coicatak - 11.11.2009

Bumb. Any help please??


Re: OnPlayerText returns 1 whereas it souldn't - Coicatak - 15.11.2009

Quote:
Originally Posted by Coicatak
Bumb. Any help please??



Re: OnPlayerText returns 1 whereas it souldn't - dice7 - 15.11.2009

Show the whole code. With this there is no way for it to return 1 unless you're an npc