Fast Event
#2

Here would be an explained example
pawn Код:
new EventText[(10 + 1)]; //10 is the size of the text + 1 for the EOS mark (you can write 11, too)
pawn Код:
//Where you want to start the event (often used in some timer)
for(new c = 1; c < sizeof EventText; c++) //fills the array with random letters or numbers
    EventText[c - 1] = ((random(2)) ? ((random(2)) ? ('a' + random(26)) : ('A' + random(26))) : ('0' + random(10)));
SendClientMessageToAll(0x0000FFAA, "***** Who types the word as fastest gets 10_000$:");
SendClientMessageToAll(0x0000FFAA, EventText);
pawn Код:
//OnPlayerText
if(EventText[0] != EOS) //checks if the first cell isnt the end of the string
    if(strcmp(text, EventText, false) == 0) //checks if the typed text match
    {
        SendClientMessage(playerid, 0xFFFFFFAA, "*** You were the fastest!");
        GivePlayerMoney(playerid, 10_000);
        EventText[0] = EOS; //sets the first cell to END OF STRING (mark it as empty)
    }
Offtopic: Did you made the avatar by yourself ?
Reply


Messages In This Thread
Fast Event - by DokerJr - 24.01.2010, 13:43
Re: Fast Event - by Nero_3D - 24.01.2010, 14:16
Re: Fast Event - by Akkan - 25.01.2010, 14:42
Re: Fast Event - by On_Top_Non_Stop - 25.01.2010, 16:19
Re: Fast Event - by Akkan - 27.01.2010, 15:21
Re: Fast Event - by On_Top_Non_Stop - 27.01.2010, 19:10
Re: Fast Event - by Akkan - 28.01.2010, 10:10
Re: Fast Event - by WrathOfGenesis - 28.01.2010, 11:47
Re: Fast Event - by Akkan - 28.01.2010, 22:45
Re: Fast Event - by Akkan - 30.01.2010, 19:29

Forum Jump:


Users browsing this thread: 3 Guest(s)