mq help
#1

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;
    }
Reply
#2

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;
    }
Reply
#3

thanks...
Reply


Forum Jump:


Users browsing this thread: