Szerző Téma: [FS]Reakcióteszt (elsõ szkriptem! :D)  (Megtekintve 1290 alkalommal)

[FS]Reakcióteszt (elsõ szkriptem! :D)
« Dátum: 2014. Június 03. - 22:03:17 »
0 Show voters
Sziasztok!
Kezdõ pawno scripterként azon gondolkoztam, hogy mi is legyen az elsõ publikálható FS-em, és a végén úgy döntöttem, hogy ez az egyszerû, csak a_samp.inc és fixchars.h include-okat használó reakcióteszt lesz FreeRoam és Fun szerverekre. Nyugodtan használjátok fel, de kérlek ne töröljétek ki belõle a nevemet!
 
//*A szkriptet [EAX]AdvancedHD készítette!
//*Kérlek ne töröld ki ezt a két sort!
#include <a_samp>
#include <fixchars>
#if !defined Loop
#define Loop(%0,%1) \\
        for(new %0 = 0; %0 != %1; %0++)
#endif
#if !defined function
#define function%0(%1) \\
        forward%0(%1); public%0(%1)
#endif
#if !defined PURPLE
#define PURPLE \\
    0xBF60FFFF
#endif
#if !defined GREEN
#define GREEN \\
    0x94D317FF
#endif
#if !defined TIME
#define TIME \\
    180000
#endif
new
        xCharacters[][] =
        {
            \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\",
                \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\",
            \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\",
                \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\",
            \"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"
        },
        xChars[16] = \"\",
        xReactionTimer,
        xCash,
        xScore,
        bool: xTestBusy
;
public OnFilterScriptInit()
{
        xReactionTimer = SetTimer(\"xReactionTest\", TIME, 1);
        return 1;
}
public OnFilterScriptExit()
{
        KillTimer(xReactionTimer);
        return 1;
}
public OnPlayerText(playerid, text[])
{
        switch(xTestBusy)
        {
            case true:
            {
                        if(!strcmp(xChars, text, false))
                        {
                            new
                                string[128],
                                pName[MAX_PLAYER_NAME]
                                ;
                                GetPlayerName(playerid, pName, sizeof(pName));
                                format(string, sizeof(string), \"« \\%s\\\" Írta be elõször a reakciótesztet! »\", pName);
                            SendClientMessageToAll(GREEN, string);
                            format(string, sizeof(string), \"« Mivel te írtad be elõször a reakciótesztet, nyertél %d dollárt és %d pontot! Gratulálunk! »\", xCash, xScore);
                            SendClientMessage(playerid, GREEN, string);
                            GivePlayerMoney(playerid, xCash);
                                SetPlayerScore(playerid, GetPlayerScore(playerid) + xScore);
                                xReactionTimer = SetTimer(\"xReactionTest\", TIME, 1);
                            xTestBusy = false;
                        }
                }
        }
        return 1;
}
function xReactionProgress()
{
   switch(xTestBusy)
        {
            case true:
            {
                    new
                        string[128]
                        ;
                        format(string, sizeof(string), \"« Senki sem írta be a reakciótesztet! A következõ %d perc múlva lesz. »\", (TIME/60000));
                    SendClientMessageToAll(PURPLE, string);
                xReactionTimer = SetTimer(\"xReactionTest\", TIME, 1);
       }
        }
        return 1;
}
function xReactionTest()
{
        new
                xLength = (random(8) + 2),
                string[128]
        ;
        xCash = (random(10000) + 20000);
        xScore = (random(2)+1);
        format(xChars, sizeof(xChars), \"\");
        Loop(x, xLength) format(xChars, sizeof(xChars), \"%s%s\", xChars, xCharacters[random(sizeof(xCharacters))][0]);
        format(string, sizeof(string), \"« Aki elõször beírja, hogy %s , az nyer %d dollárt és %d pontot! »\", xChars, xCash, xScore);
        SendClientMessageToAll(PURPLE, string);
        KillTimer(xReactionTimer);
        xTestBusy = true;
        SetTimer(\"xReactionProgress\", 30000, 0);
        return 1;
}

[FS]Reakcióteszt (elsõ szkriptem! :D)
« Válasz #1 Dátum: 2014. Június 03. - 22:19:04 »
+4 Show voters
http://forum.sa-mp.com/showthread.php?t=150274
Szégyen, és sajnos egyre több az ilyen gyökér...
 
de kérlek ne töröljétek ki belõle a nevemet![/quote]
És ezt pont te mondod, mikozbe másét lopod,. Hogy lehet valaki ennyire pofátlan?
« Utoljára szerkesztve: 2014. Június 03. - 22:21:49 írta kadaradam »

Nem elérhető Cappsy

  • Adminisztrátor
  • 2754
    • Profil megtekintése
[FS]Reakcióteszt (elsõ szkriptem! :D)
« Válasz #2 Dátum: 2014. Június 03. - 23:07:01 »
0 Show voters
[gmod]Ennyire hülyének nézünk ki? :). Egy pawn nyelvhez, nem értõ ember is megtudja mondani, hogy valószínûleg nem te csináltad. Témát zárom..[/gmod]

[FS]Reakcióteszt (elsõ szkriptem! :D)
« Válasz #3 Dátum: 2014. Június 03. - 22:03:17 »
0 Show voters
Sziasztok!
Kezdõ pawno scripterként azon gondolkoztam, hogy mi is legyen az elsõ publikálható FS-em, és a végén úgy döntöttem, hogy ez az egyszerû, csak a_samp.inc és fixchars.h include-okat használó reakcióteszt lesz FreeRoam és Fun szerverekre. Nyugodtan használjátok fel, de kérlek ne töröljétek ki belõle a nevemet!
 
//*A szkriptet [EAX]AdvancedHD készítette!
//*Kérlek ne töröld ki ezt a két sort!
#include <a_samp>
#include <fixchars>
#if !defined Loop
#define Loop(%0,%1) \\
        for(new %0 = 0; %0 != %1; %0++)
#endif
#if !defined function
#define function%0(%1) \\
        forward%0(%1); public%0(%1)
#endif
#if !defined PURPLE
#define PURPLE \\
    0xBF60FFFF
#endif
#if !defined GREEN
#define GREEN \\
    0x94D317FF
#endif
#if !defined TIME
#define TIME \\
    180000
#endif
new
        xCharacters[][] =
        {
            \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\",
                \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\",
            \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\",
                \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\",
            \"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"
        },
        xChars[16] = \"\",
        xReactionTimer,
        xCash,
        xScore,
        bool: xTestBusy
;
public OnFilterScriptInit()
{
        xReactionTimer = SetTimer(\"xReactionTest\", TIME, 1);
        return 1;
}
public OnFilterScriptExit()
{
        KillTimer(xReactionTimer);
        return 1;
}
public OnPlayerText(playerid, text[])
{
        switch(xTestBusy)
        {
            case true:
            {
                        if(!strcmp(xChars, text, false))
                        {
                            new
                                string[128],
                                pName[MAX_PLAYER_NAME]
                                ;
                                GetPlayerName(playerid, pName, sizeof(pName));
                                format(string, sizeof(string), \"« \\%s\\\" Írta be elõször a reakciótesztet! »\", pName);
                            SendClientMessageToAll(GREEN, string);
                            format(string, sizeof(string), \"« Mivel te írtad be elõször a reakciótesztet, nyertél %d dollárt és %d pontot! Gratulálunk! »\", xCash, xScore);
                            SendClientMessage(playerid, GREEN, string);
                            GivePlayerMoney(playerid, xCash);
                                SetPlayerScore(playerid, GetPlayerScore(playerid) + xScore);
                                xReactionTimer = SetTimer(\"xReactionTest\", TIME, 1);
                            xTestBusy = false;
                        }
                }
        }
        return 1;
}
function xReactionProgress()
{
   switch(xTestBusy)
        {
            case true:
            {
                    new
                        string[128]
                        ;
                        format(string, sizeof(string), \"« Senki sem írta be a reakciótesztet! A következõ %d perc múlva lesz. »\", (TIME/60000));
                    SendClientMessageToAll(PURPLE, string);
                xReactionTimer = SetTimer(\"xReactionTest\", TIME, 1);
       }
        }
        return 1;
}
function xReactionTest()
{
        new
                xLength = (random(8) + 2),
                string[128]
        ;
        xCash = (random(10000) + 20000);
        xScore = (random(2)+1);
        format(xChars, sizeof(xChars), \"\");
        Loop(x, xLength) format(xChars, sizeof(xChars), \"%s%s\", xChars, xCharacters[random(sizeof(xCharacters))][0]);
        format(string, sizeof(string), \"« Aki elõször beírja, hogy %s , az nyer %d dollárt és %d pontot! »\", xChars, xCash, xScore);
        SendClientMessageToAll(PURPLE, string);
        KillTimer(xReactionTimer);
        xTestBusy = true;
        SetTimer(\"xReactionProgress\", 30000, 0);
        return 1;
}

[FS]Reakcióteszt (elsõ szkriptem! :D)
« Válasz #4 Dátum: 2014. Június 03. - 22:19:04 »
0 Show voters
http://forum.sa-mp.com/showthread.php?t=150274
Szégyen, és sajnos egyre több az ilyen gyökér...
 
de kérlek ne töröljétek ki belõle a nevemet![/quote]
És ezt pont te mondod, mikozbe másét lopod,. Hogy lehet valaki ennyire pofátlan?
« Utoljára szerkesztve: 2014. Június 03. - 22:21:49 írta kadaradam »

Nem elérhető Cappsy

  • Adminisztrátor
  • 2754
    • Profil megtekintése
[FS]Reakcióteszt (elsõ szkriptem! :D)
« Válasz #5 Dátum: 2014. Június 03. - 23:07:01 »
0 Show voters
[gmod]Ennyire hülyének nézünk ki? :). Egy pawn nyelvhez, nem értõ ember is megtudja mondani, hogy valószínûleg nem te csináltad. Témát zárom..[/gmod]

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal