SA-MP Forums Archive
mq help - 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: mq help (/showthread.php?tid=521055)



mq help - ScripteRNaBEEL - 21.06.2014

THis is my code and i want to add this msg "%s(%d) won the Math Quiz, He/She won the $%d + %i score Answer: %d Solve In This(0) Secs"

Код:
public OnPlayerText(playerid, text[])
    {
            if(strval(text) == answer && endm == 1)
            {
                format(str, sizeof(str), "%s(%d) won the Math Quiz, He/She won the $%d + %i score Answer: %d  ", GetName(playerid), playerid, PRIZE, PRIZESCORE, answer);
                SendClientMessageToAll(COLOR_YELLOW, str);
                GivePlayerMoney(playerid, 3000);
                SetPlayerScore(playerid, GetPlayerScore(playerid) + PRIZESCORE);
                KillTimer(timermath2);
                endm = 0;
                return 0;
            }
            return 1;
    }



Re: mq help - BroZeus - 21.06.2014

so to do timer u gotta do like this--
pawn Код:
new itime;//on top


itime=gettime();//when u start quiz


public OnPlayerText(playerid, text[])
    {
            if(strval(text) == answer && endm == 1)
            {
new ctime=gettime()-itime;
                format(str, sizeof(str), "%s(%d) won the Math Quiz, He/She won the $%d + %i score Answer: %d  and has taken %i seconds to complete it", GetName(playerid), playerid, PRIZE, PRIZESCORE, answer, ctime);//note the changes in this line
                SendClientMessageToAll(COLOR_YELLOW, str);
                GivePlayerMoney(playerid, 3000);
                SetPlayerScore(playerid, GetPlayerScore(playerid) + PRIZESCORE);
                KillTimer(timermath2);
                endm = 0;
                return 0;
            }
            return 1;
    }



Re: mq help - ScripteRNaBEEL - 21.06.2014

thanks...