SA-MP Forums Archive
help with onplayertext - 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)
+--- Thread: help with onplayertext (/showthread.php?tid=501659)



help with onplayertext - HitterHitman - 19.03.2014

This is my onplayertext
pawn Код:
new pname[24];
    new string[128];
    new string2[128];
    if(strfind(text, answer, true) && answered == 0)
    {
        GetPlayerName(playerid, pname, sizeof(pname));

        format(string, sizeof(string), "'%s' has won with the correct answer '%d'.Rewards: +1000$ and +%d score!", pname, answer, score);
        SendClientMessageToAll(green, string);
        GivePlayerMoney(playerid, 1000);

        answered = 1;
        SetPlayerScore(playerid, GetPlayerScore(playerid) + score);
        score = 0;
        return 1;
    }
I have defined answer = 1; but it needs "1" at strfind how can i do this?


Re: help with onplayertext - Matess - 19.03.2014

Just define answer like string. And this: "correct answer '%d'" get from other variable not from player.