03.05.2013, 09:05
Can someone help me with a Fast event ? i want to add on my server but i'm not so exper to do it.
I finded this code but i don't know how to add on gamemode or where,can you help me with it?
new EventText[(10 + 1)]; //10 is the size of the text + 1 for the EOS mark (you can write 11, too)
---------------------------------------------------------------------------------------------------------
//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);
-----------------------------------------------------------------------------------------------------------
//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)
}
-----------------------------------------------------------------------------------------------------------
So can you help me with this codes to add on gamemode,i just don't know where to add them...
I finded this code but i don't know how to add on gamemode or where,can you help me with it?
new EventText[(10 + 1)]; //10 is the size of the text + 1 for the EOS mark (you can write 11, too)
---------------------------------------------------------------------------------------------------------
//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);
-----------------------------------------------------------------------------------------------------------
//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)
}
-----------------------------------------------------------------------------------------------------------
So can you help me with this codes to add on gamemode,i just don't know where to add them...