SA-MP Forums Archive
[Help] TK Reaction - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help] TK Reaction (/showthread.php?tid=569311)



[Help] TK Reaction - Markoni990 - 29.03.2015

How to do this for tk points as in this picture?

PHP код:
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
; 
PHP код:
OnPlayerText()
{
    switch(
xTestBusy)
    {
        case 
true:
        {
            if(!
strcmp(xChars, text, false))
            {
                new 
pName[MAX_PLAYER_NAME];
                
GetPlayerName(playerid, pName, sizeof(pName));
                
format(string, sizeof(string), "{FF0000}[TK]{FFFFFF}Najbrzi je bio {FF0000}%s (%i){FFFFFF}i osvaja nagradu od $%d i sada ima {FF0000}%d {FFFFFF}TK POENA. »", pName,GetTimerInSeconds(GetTickCount()));
                
SendClientMessageToAll(GREEN, string);
                
GivePlayerMoney(playerid, xCash);
                
PlayerInfo[playerid][pExp] += 1;
                
xReactionTimer = SetTimer("xReactionTest", TIMEE, 1);
                
xTestBusy = false;
            }
        }
    } 
PHP код:
FUNCTION: xReactionProgress()
{
    switch(
xTestBusy)
    {
        case 
true:
        {
            new
                
string[128]
            ;
            
format(string, sizeof(string), "{C0C0C0}« Niko nije pobedio na {FFFFFF}'Reakcije-Test.' {C0C0C0}nov test pocinja za {FFFFFF}%d {C0C0C0}minuta. »", (TIMEE/60000));
            
SendClientMessageToAll(PURPLE, string);
            
xReactionTimer = SetTimer("xReactionTest", TIMEE, 1);
            
xTestBusy = false;
        }
    }
    return 
1;
}
FUNCTION: 
xReactionTest()
{
    new
        
xLength = (random(8) + 2),
        
string[128]
    ;
    
xCash = (random(1000) + 1000);
    
xScore = (random(1)+1);
    
format(xChars, sizeof(xChars), "");
    
Loop(x, xLength) format(xChars, sizeof(xChars), "%s%s", xChars, xCharacters[random(sizeof(xCharacters))][0]);
    
format(string, sizeof(string), "{FF0000}[TK]{FFFFFF}Ko prvi upise u cetu {FF0000}%s{FFFFFF} dobija %d$. TRENUTNI REKORD: %i sek.", xChars, xCash, xScore);
    
SendClientMessageToAll(PURPLE, string);
    
KillTimer(xReactionTimer);
    
xTestBusy = true;
    
SetTimer("xReactionProgress", 50000, 0);
    return 
1;
} 



AW: [Help] TK Reaction - Markoni990 - 29.03.2015

BUMP!


AW: [Help] TK Reaction - Markoni990 - 29.03.2015

BUMP


AW: [Help] TK Reaction - Markoni990 - 29.03.2015

BUMP


AW: [Help] TK Reaction - Markoni990 - 30.03.2015

BUMP!


Re: [Help] TK Reaction - KayJ - 30.03.2015

DON'T BUMP THE THREAD FOR FUCKING REASON.
http://forum.sa-mp.com/announcement.php?f=12 - Rules
http://forum.sa-mp.com/forumdisplay.php?f=33 - Check your language board is there or not!

- I wish I can neg rep you for thread bumping....


AW: [Help] TK Reaction - Markoni990 - 30.03.2015

BUMP!


Re: [Help] TK Reaction - CalvinC - 31.03.2015

There's a reason there's rules, try reading them for once.

And try explaining the problem more thoroughly, you haven't said what the problem is, just "how do i do this for tk points", i don't even know what "tk points" are supposed to be?
Or what you mean by "how do i do this for"?