Who type first winss....
#4

Use this code
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[0], Question, false) == 0)
        {
            new string[128];
                format(string, sizeof(string), "$$$ %s has won $%d,- by typing '%s' the fastest! $$$", PlayerName[playerid], RandomQuestionMoney, Question);
                SendClientMessageToAll(COLOR_GREEN, string);
                SetPlayerScore(playerid, GetPlayerScore(playerid) + RandomQuestionScore);
                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: 2 Guest(s)