help with onplayertext
#1

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?
Reply
#2

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


Forum Jump:


Users browsing this thread: 1 Guest(s)