Who type first winss....
#6

Ok ive tested this and it works for me.

pawn Код:
#include <a_samp>
 
#define COLOR_GREEN 0x00A800AA
 
new MinQuestionScore = 1;
new MaxQuestionScore = 7;
new RandomQuestionScore;
 
new QuestionStarted;
new Question[32];
 
new PlayerName[MAX_PLAYERS][MAX_PLAYER_NAME];
 
forward SendQuestionForScore();
 
public OnFilterScriptInit()
{
        SetTimer("SendQuestionForScore", 240000, true);
        return 1;
}
 
public OnFilterScriptExit()
{
        return 1;
}
 
public SendQuestionForScore()
{
        new string[128];
        new qstring[32];
        RandomQuestionScore = MinQuestionScore+random(MaxQuestionScore-MinQuestionScore);
        format(qstring, sizeof(qstring), "%d%d%d%d%d%d%d%d", random(9), random(9), random(9), random(9), random(9), random(9), random(9), random(9));
        strmid(Question, qstring, false, strlen(qstring), 32);
    format(string, sizeof(string), "** Question: Are you still alive? **: The fastest who types %s will earn $%d,-!", qstring, RandomQuestionMoney);
        SendClientMessageToAll(COLOR_GREEN, string);
        QuestionStarted = 1;
        return 1;
}
 
public OnPlayerText(playerid, text[])
{
        if(QuestionStarted == 1 && strfind(text,Question,true) != -1)
    {
            new string[128];
            format(string, sizeof(string), "$$$ %s has won $%d,- by typing '%s' the fastest! $$$", Nam, RandomQuestionMoney, Question);
            SendClientMessageToAll(COLOR_GREEN, string);
            GivePlayerMoney(playerid, RandomQuestionMoney);
            QuestionStarted = 0;
            return 0;
    }
        return 1;
}
Reply


Messages In This Thread
Who type first winss.... - by kbalor - 30.08.2012, 14:30
Re: Who type first winss.... - by Dan. - 30.08.2012, 14:32
Re: Who type first winss.... - by C00K13M0N$73R - 30.08.2012, 14:32
Re: Who type first winss.... - by [HK]Ryder[AN] - 30.08.2012, 15:32
Re: Who type first winss.... - by kbalor - 30.08.2012, 15:50
Re: Who type first winss.... - by romas3110 - 30.08.2012, 16:05

Forum Jump:


Users browsing this thread: 1 Guest(s)